You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
regression: error: module should be marked with the #[cfg(test)] attribute #140225
[INFO] [stdout] error: module should be marked with the `#[cfg(test)]` attribute
[INFO] [stdout]
[INFO] [stdout] = help: add `#[cfg(test)]` to the module
[INFO] [stdout]
[INFO] [stdout] --> crates/after-test_test/src/lib.rs:3:1
[INFO] [stdout] |
[INFO] [stdout] 3 | / mod panics {
[INFO] [stdout] 4 | | fn panic_with_message() {
[INFO] [stdout] 5 | | panic!("This is a panic message");
[INFO] [stdout] ... |
[INFO] [stdout] 10 | | fn test_should_panic() {}
[INFO] [stdout] 11 | | }
[INFO] [stdout] | |_^
(and several more like that)
That particular error message comes from their own proc-macro. The module does have the expected attribute, but I suppose something must have changed in how we provide that to the macro.
#[after_test::cleanup(panic_with_message)]#[cfg(test)]mod panics {fnpanic_with_message(){panic!("This is a panic message");}#[test]#[should_panic(expected = "This is a panic message")]fntest_should_panic(){}}
Version it worked on
It most recently worked on: 1.86.0
Version with regression
rustc 1.87.0-beta.5 (386abeb93 2025-04-19) in crater #139827.
Activity
cyrgani commentedon Apr 23, 2025
cargo testwith the following reduced macro:and usage
beta is indeed just printing
but stable gets
cyrgani commentedon Apr 23, 2025
Regression in rust-lang-ci@8d60e92
The PR introducing the regression in this rollup is #138844: expand: Leave traces when expanding
cfgattributessearched nightlies: from nightly-2025-01-01 to nightly-2025-04-23
regressed nightly: nightly-2025-03-28
searched commit range: a2e6356...3f55023
regressed commit: 3f55023
bisected with cargo-bisect-rustc v0.6.9
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
cargo bisect-rustc --start=2025-01-01 -- test@rustbot label S-has-mcve S-has-bisection
jieyouxu commentedon Apr 24, 2025
cc @petrochenkov: can you please double-check if this is intended observable behavior change re. #138844.
jieyouxu commentedon Apr 24, 2025
I also tagged #138844 w/ compat relnotes (#140243) to be safe.
petrochenkov commentedon Apr 24, 2025
Yes, this is an intended change.
jieyouxu commentedon May 1, 2025
Closing in favor of compat relnotes (#140243) since this is an intended change.