summaryrefslogtreecommitdiffstats
path: root/third_party/rust/darling_macro
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/rust/darling_macro
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/darling_macro')
-rw-r--r--third_party/rust/darling_macro/.cargo-checksum.json1
-rw-r--r--third_party/rust/darling_macro/Cargo.toml34
-rw-r--r--third_party/rust/darling_macro/LICENSE21
-rw-r--r--third_party/rust/darling_macro/src/lib.rs40
4 files changed, 96 insertions, 0 deletions
diff --git a/third_party/rust/darling_macro/.cargo-checksum.json b/third_party/rust/darling_macro/.cargo-checksum.json
new file mode 100644
index 0000000000..15190d2fc0
--- /dev/null
+++ b/third_party/rust/darling_macro/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"Cargo.toml":"9df103094522de168893c7805273fe0de11ab18405db65d669af71aa6e810955","LICENSE":"8ea93490d74a5a1b1af3ff71d786271b3f1e5f0bea79ac16e02ec533cef040d6","src/lib.rs":"728be3bb12c9cdaaf0520bce87e489a0820e436c78fa3627e238fc1acc11dd7f"},"package":"29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a"} \ No newline at end of file
diff --git a/third_party/rust/darling_macro/Cargo.toml b/third_party/rust/darling_macro/Cargo.toml
new file mode 100644
index 0000000000..aff2b3e952
--- /dev/null
+++ b/third_party/rust/darling_macro/Cargo.toml
@@ -0,0 +1,34 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "darling_macro"
+version = "0.20.1"
+authors = ["Ted Driggs <ted.driggs@outlook.com>"]
+description = """
+Internal support for a proc-macro library for reading attributes into structs when
+implementing custom derives. Use https://crates.io/crates/darling in your code.
+"""
+license = "MIT"
+repository = "https://github.com/TedDriggs/darling"
+
+[lib]
+proc-macro = true
+
+[dependencies.darling_core]
+version = "=0.20.1"
+
+[dependencies.quote]
+version = "1.0.18"
+
+[dependencies.syn]
+version = "2.0.15"
diff --git a/third_party/rust/darling_macro/LICENSE b/third_party/rust/darling_macro/LICENSE
new file mode 100644
index 0000000000..0b48eadc9d
--- /dev/null
+++ b/third_party/rust/darling_macro/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Ted Driggs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/third_party/rust/darling_macro/src/lib.rs b/third_party/rust/darling_macro/src/lib.rs
new file mode 100644
index 0000000000..8da0272ebf
--- /dev/null
+++ b/third_party/rust/darling_macro/src/lib.rs
@@ -0,0 +1,40 @@
+use darling_core::{derive, Error};
+use proc_macro::TokenStream;
+use syn::parse_macro_input;
+
+#[proc_macro_derive(FromMeta, attributes(darling))]
+pub fn derive_from_meta(input: TokenStream) -> TokenStream {
+ derive::from_meta(&parse_macro_input!(input)).into()
+}
+
+#[proc_macro_derive(FromMetaItem, attributes(darling))]
+pub fn derive_from_meta_item(_input: TokenStream) -> TokenStream {
+ Error::custom("darling::FromMetaItem has been replaced by darling::FromMeta")
+ .write_errors()
+ .into()
+}
+
+#[proc_macro_derive(FromAttributes, attributes(darling))]
+pub fn derive_from_attributes(input: TokenStream) -> TokenStream {
+ derive::from_attributes(&parse_macro_input!(input)).into()
+}
+
+#[proc_macro_derive(FromDeriveInput, attributes(darling))]
+pub fn derive_from_input(input: TokenStream) -> TokenStream {
+ derive::from_derive_input(&parse_macro_input!(input)).into()
+}
+
+#[proc_macro_derive(FromField, attributes(darling))]
+pub fn derive_field(input: TokenStream) -> TokenStream {
+ derive::from_field(&parse_macro_input!(input)).into()
+}
+
+#[proc_macro_derive(FromTypeParam, attributes(darling))]
+pub fn derive_type_param(input: TokenStream) -> TokenStream {
+ derive::from_type_param(&parse_macro_input!(input)).into()
+}
+
+#[proc_macro_derive(FromVariant, attributes(darling))]
+pub fn derive_variant(input: TokenStream) -> TokenStream {
+ derive::from_variant(&parse_macro_input!(input)).into()
+}