Skip to content

CURRENT_RUSTC_VERSION does not work with #[deprecated] #126323

Closed

Description

@RalfJung

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

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 12, 2024
  2. RalfJung commented on Jun 12, 2024

    @RalfJung
    MemberAuthor

    Cc @est31 I think?

  3. est31 commented on Jun 12, 2024

    @est31
    Member

    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.

  4. tbu- commented on Jun 12, 2024

    @tbu-
  5. changed the title [-]CURRENT_RUSTC_VERSION does not work with `'[deprecated]`[/-] [+]CURRENT_RUSTC_VERSION does not work with `#[deprecated]`[/+] on Jun 12, 2024
  6. veera-sivarajan commented on Jun 12, 2024

    @veera-sivarajan
    Contributor

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

  7. added
    A-attributesArea: Attributes (`#[…]`, `#![…]`)
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 12, 2024
  8. cyrgani commented on Mar 9, 2026

    @cyrgani
    Contributor

    Fixed by #152488.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustL-deprecatedLint: deprecatedT-libsRelevant to the library team, which will review and decide on the PR/issue.requires-internal-featuresThis issue requires the use of internal features.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions