rust: proc-macro2: add SPDX License Identifiers

Originally, when the Rust upstream `alloc` standard library crate was
vendored in commit 057b8d2571 ("rust: adapt `alloc` crate to the
kernel"), the SPDX License Identifiers were added to every file so that
the license on those was clear.

Thus do the same for the `proc-macro2` crate.

This makes `scripts/spdxcheck.py` pass.

Reviewed-by: Gary Guo <gary@garyguo.net>
Tested-by: Gary Guo <gary@garyguo.net>
Tested-by: Jesung Yang <y.j3ms.n@gmail.com>
Link: https://patch.msgid.link/20251124151837.2184382-8-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
Miguel Ojeda 2025-11-24 16:18:19 +01:00
parent 3a8b546a27
commit a9acfceb96
13 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use core::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Once;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! Items which do not have a correspondence to any API in the proc_macro crate,
//! but are necessary to include in proc-macro2.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
#[cfg(wrap_proc_macro)]
use crate::imp;
#[cfg(span_locations)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! [![github]](https://github.com/dtolnay/proc-macro2)&ensp;[![crates-io]](https://crates.io/crates/proc-macro2)&ensp;[![docs-rs]](crate)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use core::cmp::Ordering;
/// A line-column pair representing the start or end of a `Span`.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use alloc::rc::Rc;
use core::marker::PhantomData;
use core::panic::{RefUnwindSafe, UnwindSafe};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use crate::fallback::{
self, is_ident_continue, is_ident_start, Group, Ident, LexError, Literal, Span, TokenStream,
TokenStreamBuilder,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
#![allow(dead_code)]
#[cfg(proc_macro_span)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
// This code exercises the surface area that we expect of Span's unstable API.
// If the current toolchain is able to compile it, then proc-macro2 is able to
// offer these APIs too.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
// The subset of Span's API stabilized in Rust 1.88.
extern crate proc_macro;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
// The subset of Span's API stabilized in Rust 1.88.
extern crate proc_macro;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use alloc::rc::Rc;
use alloc::vec;
use core::mem;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use crate::detection::inside_proc_macro;
use crate::fallback::{self, FromStr2 as _};
#[cfg(span_locations)]