mirror-linux/rust/proc-macro2
Miguel Ojeda 4c4e62321a rust: proc-macro2: rebuild if the version text changes
The Rust compiler cannot use dependencies built by other versions, e.g.:

    error[E0514]: found crate `proc_macro2` compiled by an incompatible version of rustc
     --> rust/quote/ext.rs:5:5
      |
    5 | use proc_macro2::{TokenStream, TokenTree};
      |     ^^^^^^^^^^^
      |
      = note: the following crate versions were found:
              crate `proc_macro2` compiled by rustc 1.92.0 (ded5c06cf 2025-12-08): ./rust/libproc_macro2.rlib
      = help: please recompile that crate using this compiler (rustc 1.93.0 (254b59607 2026-01-19)) (consider running `cargo clean` first)

Thus trigger a rebuild if the version text changes like we do in other
top-level cases (e.g. see commit aeb0e24abb ("kbuild: rust: replace
proc macros dependency on `core.o` with the version text")).

The build errors for now are hard to trigger, since we do not yet use
the new crates we just introduced (the use cases are coming in the next
merge window), but they can still be seen if e.g. one manually removes
one of the targets, so fix it already.

Fixes: 158a3b7211 ("rust: proc-macro2: enable support in kbuild")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260122054135.138445-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-01-23 10:44:27 +01:00
..
probe
README.md rust: proc-macro2: add `README.md` 2025-11-24 17:15:40 +01:00
detection.rs
extra.rs
fallback.rs rust: proc-macro2: remove `unicode_ident` dependency 2025-11-24 17:15:39 +01:00
lib.rs rust: proc-macro2: rebuild if the version text changes 2026-01-23 10:44:27 +01:00
location.rs
marker.rs
parse.rs
probe.rs
rcvec.rs
wrapper.rs

README.md

proc-macro2

These source files come from the Rust proc-macro2 crate, version 1.0.101 (released 2025-08-16), hosted in the https://github.com/dtolnay/proc-macro2 repository, licensed under "Apache-2.0 OR MIT" and only modified to add the SPDX license identifiers and to remove the unicode-ident dependency.

For copyright details, please see:

https://github.com/dtolnay/proc-macro2/blob/1.0.101/README.md#license
https://github.com/dtolnay/proc-macro2/blob/1.0.101/LICENSE-APACHE
https://github.com/dtolnay/proc-macro2/blob/1.0.101/LICENSE-MIT