-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add {ignore,needs}-{rustc,std}-debug-assertions
directive support
#131913
base: master
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,7 @@ | |||
//@ compile-flags: -O -C no-prepopulate-passes | |||
//@ only-x86_64 (to not worry about usize differing) | |||
//@ ignore-debug: precondition checks make mem::replace not a candidate for MIR inlining |
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.
Just to check: we have some lint or w/e that will fail CI if someone adds a test with ignore-debug
as we merge this PR?
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.
compiletest (currently) has an allowlist of known directives, I've removed ignore-debug from that so compiletest will error if someone writes ignore-debug (should be in the first commit) which will fail locally and in CI. (This is current stopgap solution before fixing how directives are handled)
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 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.
It will fail looking like (I know it's not super user friendly)
Testing stage1 compiletest suite=ui mode=ui (x86_64-pc-windows-msvc)
error: detected unknown compiletest test directive `only-debug` in X:\repos\rust\tests\ui\print_type_sizes\niche-filling.rs:13
errors encountered during EarlyProps parsing: X:\repos\rust\tests\ui\print_type_sizes\niche-filling.rs
thread 'main' panicked at src\tools\compiletest\src\header.rs:68:13:
errors encountered during EarlyProps parsing
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
"ignore-debug", | ||
"ignore-debug-assertions-rustc", |
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.
Specifically here
30e1d8a
to
2653a4a
Compare
This PR modifies If appropriate, please update |
Accompanying rustc-dev-guide PR: rust-lang/rustc-dev-guide#2101 |
{ignore,needs}-debug-assertions-{rustc,std}
directive support{ignore,needs}-{rustc,std}-debug-assertions
directive support
debug_assertions: Option<bool> = "debug-assertions", | ||
rustc_debug_assertions: Option<bool> = "debug-assertions", | ||
randomize_layout: Option<bool> = "randomize-layout", | ||
debug_assertions_std: Option<bool> = "debug-assertions-std", | ||
std_debug_assertions: Option<bool> = "debug-assertions-std", |
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.
I did not change the config.toml
user-facing toml name.
2653a4a
to
014191d
Compare
Changes since last review
|
@rustbot ready |
This comment was marked as resolved.
This comment was marked as resolved.
014191d
to
c46a1ca
Compare
This comment has been minimized.
This comment has been minimized.
c46a1ca
to
2021e10
Compare
Rebased and split compiletest/bootstrap changes into two commits, but no functional changes. @rustbot ready |
This comment was marked as resolved.
This comment was marked as resolved.
…ive support And retire the old `only-debug` directive which was ambiguous and only for std debug assertions.
And rename local variables and field names in bootstrap from `debug_assertions{,_std}` -> `{rustc,std}-debug-assertions` to avoid confusion where applicable.
2021e10
to
0d5cc8e
Compare
Rebased, no changes. |
Add
{ignore,needs}-{rustc,std}-debug-assertions
compiletest directives and retire the old{ignore,only}-debug
directives. The old{ignore,only}-debug
directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having{ignore,only}-debug
will be very confusing.cc @matthiaskrgr
Closes #123987.
r? bootstrap (or compiler tbh)