Originally, when the Rust upstream `alloc` standard library crate was
vendored in commit
057b8d257107 ("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>
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use core::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Once;
+// 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.
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
#[cfg(wrap_proc_macro)]
use crate::imp;
#[cfg(span_locations)]
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
//! [![github]](https://github.com/dtolnay/proc-macro2) [![crates-io]](https://crates.io/crates/proc-macro2) [![docs-rs]](crate)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use core::cmp::Ordering;
/// A line-column pair representing the start or end of a `Span`.
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use alloc::rc::Rc;
use core::marker::PhantomData;
use core::panic::{RefUnwindSafe, UnwindSafe};
+// 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,
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
#![allow(dead_code)]
#[cfg(proc_macro_span)]
+// 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.
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
// The subset of Span's API stabilized in Rust 1.88.
extern crate proc_macro;
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
// The subset of Span's API stabilized in Rust 1.88.
extern crate proc_macro;
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use alloc::rc::Rc;
use alloc::vec;
use core::mem;
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
use crate::detection::inside_proc_macro;
use crate::fallback::{self, FromStr2 as _};
#[cfg(span_locations)]