Skip to content

Bootstrap: Build compiler crates that ought to compile on stable without RUSTC_BOOTSTRAP=1 #117937

Open

Description

@fmease

Uplifted from #117819 (comment).

There exist some compiler crates (e.g., rustc_lexer and rustc_parse_format) which ought not use unstable features since they are used by other tools like rust-analyzer which has a “no nightly” policy. The aforementioned crates do contain comments informing rustc devs about it, they are easy to miss however.

If bootstrap were to compile those crates without RUSTC_BOOTSTRAP=1, the issue of PRs accidentally adding #![feature]s to such crates could be prevented in the future.

Alternative: A rustc-internal or regular lint triggering on #![feature]s.

Activity

  1. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Nov 15, 2023
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 15, 2023
  3. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 15, 2023
  4. lukas-code commented on Nov 15, 2023

    @lukas-code
    Contributor

    Alternative: A rustc-internal or regular lint triggering on #![feature]s.

    FWIW, there is already the unstable_features lint. The docs say it's deprecated, but is appears to work perfectly fine.

  5. bjorn3 commented on Nov 15, 2023

    @bjorn3
    Member

    And we have -Zallow-feature to explicitly list the set of allowed unstable features. Could be set in the rustc wrapper of bootstrap depending on the crate name.

  6. clubby789 commented on Nov 15, 2023

    @clubby789
    Contributor

    The docs say it's deprecated, but is appears to work perfectly fine

    Seems like this note was added in #26417, when use of unstable features was turned into a compiler error rather than a lint

  7. fmease commented on Nov 15, 2023

    @fmease
    MemberAuthor

    Okay, I guess I'm gonna submit a t-lang-nominated PR later undeprecating unstable_features and applying it to the two affected crates.

  8. self-assigned this
    on Nov 20, 2023
  9. added a commit that references this issue on Jan 21, 2024
  10. removed their assignment
    on Jan 22, 2024
  11. added 3 commits that reference this issue on Jan 22, 2024
  12. added a commit that references this issue on Jan 22, 2024
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

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions