8000 Third-party crates support: `proc-macro2`, `quote`, `syn`, `serde` and `serde_derive` by ojeda · Pull Request #1007 · Rust-for-Linux/linux · GitHub
[go: up one dir, main page]

Skip to content

Third-party crates support: proc-macro2, quote, syn, serde and serde_derive #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: rust-next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Next Next commit
rust: serde_derive: add SPDX License Identifiers
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
ojeda committed May 8, 2023
commit 16bebcf19f5c73fff139699acbfc902353af059e
2 changes: 2 additions & 0 deletions rust/serde_derive/bound.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::collections::HashSet;

use syn;
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/de.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Literal, Span, TokenStream};
use quote::ToTokens;
use syn::punctuated::Punctuated;
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/dummy.rs
10000
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Ident, TokenStream};
use quote::format_ident;

Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/fragment.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::TokenStream;
use quote::ToTokens;
use syn::token;
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/ast.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! A Serde ast, parsed from the Syn ast and ready to generate Rust code.

use internals::attr;
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/attr.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use internals::symbol::*;
use internals::{ungroup, Ctxt};
use proc_macro2::{Spacing, Span, TokenStream, TokenTree};
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/case.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Code to convert the Rust-styled field/variant (e.g. `my_field`, `MyType`) to the
//! case of the source (e.g. `my-field`, `MY_FIELD`).

Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/check.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use internals::ast::{Container, Data, Field, Style};
use internals::attr::{Identifier, TagType};
use internals::{ungroup, Ctxt, Derive};
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/ctxt.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use quote::ToTokens;
use std::cell::RefCell;
use std::fmt::Display;
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

pub mod ast;
pub mod attr;

Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/receiver.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use internals::respan::respan;
use proc_macro2::Span;
use quote::ToTokens;
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/respan.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Group, Span, TokenStream, TokenTree};

pub(crate) fn respan(stream: TokenStream, span: Span) -> TokenStream {
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/internals/symbol.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use std::fmt::{self, Display};
use syn::{Ident, Path};

Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! This crate provides Serde's two derive macros.
//!
//! ```edition2018
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/pretend.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::TokenStream;
use quote::format_ident;

Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/ser.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Span, TokenStream};
use syn::spanned::Spanned;
use syn::{self, Ident, Index, Member};
Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/this.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use internals::ast::Container;
use syn::{Path, PathArguments, Token};

Expand Down
2 changes: 2 additions & 0 deletions rust/serde_derive/try.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use proc_macro2::{Punct, Spacing, TokenStream};

// None of our generated code requires the `From::from` error conversion
Expand Down
0