about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2022-06-15 21:31:28 +0200
committerest31 <MTest31@outlook.com>2022-06-16 00:03:27 +0200
commit471fa05fef0b09e0430a80e3d7f205ef19fc4a86 (patch)
treed04efcd01ddc0925b6d943908f97edb757c17d92 /compiler/rustc_errors/src
parent3bdec3c8abdc48e46715d7b14b764af28da1cee3 (diff)
downloadrust-471fa05fef0b09e0430a80e3d7f205ef19fc4a86.tar.gz
rust-471fa05fef0b09e0430a80e3d7f205ef19fc4a86.zip
Make #[cfg(bootstrap)] not error in proc macros on later stages
As was discovered in https://github.com/rust-lang/rust/pull/93628#issuecomment-1154697627 ,
adding #[cfg(bootstrap)] to a rust-internal proc macro crate
would yield an unexpected cfg name error, at least on later
stages wher the bootstrap cfg arg wasn't set.

rustc already passes arguments to mark bootstrap as expected,
however the means of delivery through the RUSTFLAGS env var
is unable to reach proc macro crates, as described
in the issue linked in the code this commit touches.

This wouldn't be an issue for cfg args that get passed through
RUSTFLAGS, as they would never become *active* either, so
any usage of one of these flags in a proc macro's code would
legitimately yield a lint warning. But since dc302587e2cf5105a3a864319d7e7bcb434bba20,
rust takes extra measures to pass --cfg=bootstrap even in
proc macros, by passing it via the wrapper. Thus, we need
to send the flags to mark bootstrap as expected also from the
wrapper, so that #[cfg(bootstrap)] also works from proc macros.

I want to thank Urgau and jplatte for helping me find the cause of this. ❤️
Diffstat (limited to 'compiler/rustc_errors/src')
0 files changed, 0 insertions, 0 deletions