mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-26 19:27:43 +00:00
From `#[align]` -> `#[rustc_align]`. Attributes starting with `rustc`
are always perma-unstable and feature-gated by `feature(rustc_attrs)`.
See regression RUST-143834.
For the underlying problem where even introducing new feature-gated
unstable built-in attributes can break user code such as
```rs
macro_rules! align {
() => {
/* .. */
};
}
pub(crate) use align; // `use` here becomes ambiguous
```
refer to RUST-134963.
Since the `#[align]` attribute is still feature-gated by
`feature(fn_align)`, we can rename it as a mitigation. Note that
`#[rustc_align]` will obviously mean that current unstable user code
using `feature(fn_aling)` will need additionally `feature(rustc_attrs)`,
but this is a short-term mitigation to buy time, and is expected to be
changed to a better name with less collision potential.
See
<https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-07-17/near/529290371>
where mitigation options were considered.
20 lines
363 B
Rust
20 lines
363 B
Rust
// Anti-regression test to demonstrate that at least we mitigated breakage from adding a new
|
|
// `#[align]` built-in attribute.
|
|
//
|
|
// See https://github.com/rust-lang/rust/issues/143834.
|
|
|
|
//@ check-pass
|
|
|
|
// Needs edition >= 2018 macro use behavior.
|
|
//@ edition: 2018
|
|
|
|
macro_rules! align {
|
|
() => {
|
|
/* .. */
|
|
};
|
|
}
|
|
|
|
pub(crate) use align;
|
|
|
|
fn main() {}
|