-
Notifications
You must be signed in to change notification settings - Fork 13.3k
regression: error: module should be marked with the #[cfg(test)]
attribute
#140225
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
Comments
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn cleanup(_: TokenStream, item: TokenStream) -> TokenStream {
dbg!(&item);
TokenStream::new()
} and usage #[y::cleanup]
#[cfg(test)]
mod panics {} beta is indeed just printing
but stable gets
|
Regression in rust-lang-ci@8d60e92 searched nightlies: from nightly-2025-01-01 to nightly-2025-04-23 bisected with cargo-bisect-rustc v0.6.9Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start=2025-01-01 -- test @rustbot label S-has-mcve S-has-bisection |
cc @petrochenkov: can you please double-check if this is intended observable behavior change re. #138844. |
Yes, this is an intended change. |
Closing in favor of compat relnotes (#140243) since this is an intended change. |
(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.
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.@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged
The text was updated successfully, but these errors were encountered: