From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../rust/darling_macro/.cargo-checksum.json | 1 + third_party/rust/darling_macro/Cargo.toml | 34 +++++++++++++++++ third_party/rust/darling_macro/LICENSE | 21 +++++++++++ third_party/rust/darling_macro/src/lib.rs | 43 ++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 third_party/rust/darling_macro/.cargo-checksum.json create mode 100644 third_party/rust/darling_macro/Cargo.toml create mode 100644 third_party/rust/darling_macro/LICENSE create mode 100644 third_party/rust/darling_macro/src/lib.rs (limited to 'third_party/rust/darling_macro') 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..1c83597772 --- /dev/null +++ b/third_party/rust/darling_macro/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"f9ca47216222c1dc994ecdd2e10117060f025c1306bc93b93f5b3683c50033cd","LICENSE":"8ea93490d74a5a1b1af3ff71d786271b3f1e5f0bea79ac16e02ec533cef040d6","src/lib.rs":"1dbd1ed31a7db5ff7995bd1dd494e962645e6ff62b0f88807fe1b6025523f187"},"package":"b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685"} \ 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..8b7fe72669 --- /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.14.3" +authors = ["Ted Driggs "] +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.14.3" + +[dependencies.quote] +version = "1.0.18" + +[dependencies.syn] +version = "1.0.91" 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..de9709fb73 --- /dev/null +++ b/third_party/rust/darling_macro/src/lib.rs @@ -0,0 +1,43 @@ +// This is needed for 1.31.0 to keep compiling +extern crate proc_macro; + +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() +} -- cgit v1.2.3