rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.06k stars 12.69k forks source link

CURRENT_RUSTC_VERSION does not work with `#[deprecated]` #126323

Open RalfJung opened 4 months ago

RalfJung commented 4 months ago

Found by @m-ou-se here:

   Compiling libc v0.2.155
   Compiling memchr v2.5.0
   Compiling std v0.0.0 (/checkout/library/std)
   Compiling compiler_builtins v0.1.109
error: 'since' must be a Rust version number, such as "1.31.0"
   |
   |
82 |     #[deprecated(since = "CURRENT_RUSTC_VERSION", note = "this never returns anything useful")]

error: could not compile `core` (lib) due to 1 previous error
Build completed unsuccessfully in 0:00:26
RalfJung commented 4 months ago

Cc @est31 I think?

est31 commented 4 months ago

The CURRENT_RUSTC_VERSION replacement script works great, it's just a textual find an replace. But I suppose whatever parses deprecated needs to be taught about CURRENT_RUSTC_VERSION, and we'll probably need a way to restrict usage to inside rustc only, maybe via a feature or something.

tbu- commented 4 months ago

title: '[deprecated]#[deprecated]

veera-sivarajan commented 4 months ago

@rustbot label -needs-triage +A-attributes +T-libs +requires-internal-features