mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add test demonstrating current beta #[align] name resolution regression
See RUST-143834.
(cherry picked from commit b2e94bf020)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//~ NOTE `align` could refer to a built-in attribute
|
||||
|
||||
// Anti-regression test to demonstrate that at least we mitigated breakage from adding a new
|
||||
// `#[align]` built-in attribute.
|
||||
|
||||
// Needs edition >= 2018 macro use behavior.
|
||||
//@ edition: 2018
|
||||
|
||||
macro_rules! align {
|
||||
//~^ NOTE `align` could also refer to the macro defined here
|
||||
() => {
|
||||
/* .. */
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) use align;
|
||||
//~^ ERROR `align` is ambiguous
|
||||
//~| NOTE ambiguous name
|
||||
//~| NOTE ambiguous because of a name conflict with a builtin attribute
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,22 @@
|
||||
error[E0659]: `align` is ambiguous
|
||||
--> $DIR/fn-align-nameres-ambiguity-143834.rs:16:16
|
||||
|
|
||||
LL | pub(crate) use align;
|
||||
| ^^^^^ ambiguous name
|
||||
|
|
||||
= note: ambiguous because of a name conflict with a builtin attribute
|
||||
= note: `align` could refer to a built-in attribute
|
||||
note: `align` could also refer to the macro defined here
|
||||
--> $DIR/fn-align-nameres-ambiguity-143834.rs:9:1
|
||||
|
|
||||
LL | / macro_rules! align {
|
||||
LL | |
|
||||
LL | | () => {
|
||||
LL | | /* .. */
|
||||
LL | | };
|
||||
LL | | }
|
||||
| |_^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0659`.
|
||||
Reference in New Issue
Block a user