-
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
Add {ignore,needs}-{rustc,std}-debug-assertions
directive support
#131913
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. |
r? bootstrap |
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.
LGTM!
Only one question:
//@ ignore-debug: precondition checks in ptr::read make them a bad candidate for MIR inlining | ||
//@ ignore-std-debug-assertions | ||
// Reason: precondition checks in ptr::read make them a bad 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.
Can't the comment format be the same (without newline) as it was before? Or is it due to the tidy length check?
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 it definitely can be, but it gets quite long and I found it a bit easier to read on a different line.
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.
(and yes it would hit the tidy line length check lol)
@bors r+ |
…onur-ozkan Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support 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 rust-lang#123987. r? bootstrap (or compiler tbh)
…onur-ozkan Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support 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 rust-lang#123987. r? bootstrap (or compiler tbh)
…llaumeGomez Rollup of 8 pull requests Successful merges: - rust-lang#130586 (Set "symbol name" in raw-dylib import libraries to the decorated name) - rust-lang#131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support) - rust-lang#132095 (Fix rust-lang#131977 parens mangled in shared mut static lint suggestion) - rust-lang#132131 ([StableMIR] API to retrieve definitions from crates) - rust-lang#132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config) - rust-lang#132738 (Initialize channel `Block`s directly on the heap) - rust-lang#132739 (Fix `librustdoc/scrape_examples.rs` formatting) - rust-lang#132740 (Update test for LLVM 20's new vector splat syntax) r? `@ghost` `@rustbot` modify labels: rollup
…onur-ozkan Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support 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 rust-lang#123987. r? bootstrap (or compiler tbh)
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#130586 (Set "symbol name" in raw-dylib import libraries to the decorated name) - rust-lang#131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support) - rust-lang#132095 (Fix rust-lang#131977 parens mangled in shared mut static lint suggestion) - rust-lang#132131 ([StableMIR] API to retrieve definitions from crates) - rust-lang#132639 (core: move intrinsics.rs into intrinsics folder) - rust-lang#132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config) - rust-lang#132737 (bootstrap: Print better message if lock pid isn't available) - rust-lang#132739 (Fix `librustdoc/scrape_examples.rs` formatting) - rust-lang#132740 (Update test for LLVM 20's new vector splat syntax) - rust-lang#132741 (Update mips64 data layout to match LLVM 20 change) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131913 - jieyouxu:only_debug_assertions, r=onur-ozkan Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support 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 rust-lang#123987. r? bootstrap (or compiler tbh)
…onur-ozkan Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support 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 rust-lang#123987. r? bootstrap (or compiler tbh)
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#130586 (Set "symbol name" in raw-dylib import libraries to the decorated name) - rust-lang#131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support) - rust-lang#132095 (Fix rust-lang#131977 parens mangled in shared mut static lint suggestion) - rust-lang#132131 ([StableMIR] API to retrieve definitions from crates) - rust-lang#132639 (core: move intrinsics.rs into intrinsics folder) - rust-lang#132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config) - rust-lang#132737 (bootstrap: Print better message if lock pid isn't available) - rust-lang#132739 (Fix `librustdoc/scrape_examples.rs` formatting) - rust-lang#132740 (Update test for LLVM 20's new vector splat syntax) - rust-lang#132741 (Update mips64 data layout to match LLVM 20 change) r? `@ghost` `@rustbot` modify labels: rollup
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)