Code
I tried this code:
macro_rules! produce_struct {
($name: ident) => {
pub struct $name {}
};
}
#[repr(align(64))]
produce_struct!(Foo);
const _: () = assert!(align_of::<Foo>() == 1);
I expected to see this happen: program accepted, with warnings
warning: unused attribute `repr`
--> <source>:7:1
|
7 | #[repr(align(64))]
| ^^^^^^^^^^^^^^^^^^
|
= note: -Ztrack-diagnostics: created at /rustc-dev/1159e78c4747b02ef996e55082b704c09b970588/compiler/rustc_lint/src/early.rs:40:26
note: the built-in attribute `repr` will be ignored, since it's applied to the macro invocation `produce_struct`
--> <source>:8:1
|
8 | produce_struct!(Foo);
| ^^^^^^^^^^^^^^
= note: `#[warn(unused_attributes)]` on by default
Instead, this happened: program accepted, no warnings issued
Version it worked on
It most recently worked on: rust 1.90 and earlier: https://rust.godbolt.org/z/Wzf519Wbv
Version with regression
1.91 and up, including current beta and nightly
The following attributes are also affected, this compiles without warnings (save for incomplete_features).
#![allow(incomplete_features)]
#![feature(dropck_eyepatch)]
#![feature(export_stable)]
#![feature(register_tool)]
#![feature(sanitize)]
macro_rules! produce_struct {
($name: ident) => {
pub struct $name {}
};
}
#[repr(align(64))]
#[sanitize(address = "off")]
#[register_tool(blah)]
#[link(name = "foo")]
#[export_stable]
#[panic_handler]
#[may_dangle]
produce_struct!(Foo);
Code
I tried this code:
I expected to see this happen: program accepted, with warnings
Instead, this happened: program accepted, no warnings issued
Version it worked on
It most recently worked on: rust 1.90 and earlier: https://rust.godbolt.org/z/Wzf519Wbv
Version with regression
1.91 and up, including current beta and nightly
The following attributes are also affected, this compiles without warnings (save for
incomplete_features).