-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make rustc consider itself a stable compiler when RUSTC_BOOTSTRAP=-1
#132993
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: the option `Z` is only accepted on the nightly compiler | ||
|
||
help: consider switching to a nightly toolchain: `rustup default nightly` | ||
|
||
note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html> | ||
|
||
note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features> | ||
|
||
error: 1 nightly option were parsed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//! Check `RUSTC_BOOTSTRAP`'s behavior in relation to feature stability and what rustc considers | ||
//! itself to be (stable vs non-stable ). | ||
//! | ||
//! `RUSTC_BOOTSTRAP` accepts: | ||
//! | ||
//! - `1`: cheat, allow usage of unstable features even if rustc thinks it is a stable compiler. | ||
//! - `x,y,z`: comma-delimited list of crates. | ||
//! - `-1`: force rustc to think it is a stable compiler. | ||
|
||
// ignore-tidy-linelength | ||
|
||
//@ revisions: default_nightly cheat cheat_single_crate cheat_multi_crate force_stable invalid_zero invalid_junk | ||
//@ only-nightly | ||
|
||
//@[default_nightly] unset-rustc-env:RUSTC_BOOTSTRAP | ||
//@[default_nightly] check-pass | ||
|
||
// For a nightly compiler, this is same as `default_nightly` as if `RUSTC_BOOTSTRAP` was unset. | ||
//@[invalid_zero] rustc-env:RUSTC_BOOTSTRAP=0 | ||
//@[invalid_zero] check-pass | ||
|
||
// Invalid values are silently discarded, same as `default_nightly`, i.e. as if `RUSTC_BOOTSTRAP` | ||
// was unset. | ||
//@[invalid_junk] rustc-env:RUSTC_BOOTSTRAP=* | ||
//@[invalid_junk] check-pass | ||
|
||
//@[cheat] rustc-env:RUSTC_BOOTSTRAP=1 | ||
//@[cheat] check-pass | ||
|
||
//@[cheat_single_crate] rustc-env:RUSTC_BOOTSTRAP=x | ||
//@[cheat_single_crate] check-pass | ||
|
||
//@[cheat_multi_crate] rustc-env:RUSTC_BOOTSTRAP=x,y,z | ||
//@[cheat_multi_crate] check-pass | ||
|
||
// Note: compiletest passes some `-Z` flags to the compiler for ui testing purposes, so here we | ||
// instead abuse the fact that `-Z unstable-options` is also part of rustc's stability story and is | ||
// also affected by `RUSTC_BOOTSTRAP`. | ||
//@[force_stable] rustc-env:RUSTC_BOOTSTRAP=-1 | ||
//@[force_stable] compile-flags: -Z unstable-options | ||
//@[force_stable] regex-error-pattern: error: the option `Z` is only accepted on the nightly compiler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. N.B.: this doesn't check in a snapshot because the exact error message will be different between beta/stable/dev depending on channel info. |
||
|
||
#![crate_type = "lib"] | ||
|
||
// Note: `rustc_attrs` is a perma-unstable internal feature that is unlikely to change, which is | ||
// used as a proxy to check `RUSTC_BOOTSTRAP` versus stability checking logic. | ||
#![feature(rustc_attrs)] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(there's a typo on
rustc_bootstap.rs
^^)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no