summaryrefslogtreecommitdiffstats
path: root/src/test/ui/proc-macro/derive-helper-shadowing.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/proc-macro/derive-helper-shadowing.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/proc-macro/derive-helper-shadowing.rs')
-rw-r--r--src/test/ui/proc-macro/derive-helper-shadowing.rs56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/test/ui/proc-macro/derive-helper-shadowing.rs b/src/test/ui/proc-macro/derive-helper-shadowing.rs
deleted file mode 100644
index 80d982d25..000000000
--- a/src/test/ui/proc-macro/derive-helper-shadowing.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-// edition:2018
-// aux-build:test-macros.rs
-// aux-build:derive-helper-shadowing.rs
-
-#[macro_use]
-extern crate test_macros;
-#[macro_use]
-extern crate derive_helper_shadowing;
-
-use test_macros::empty_attr as empty_helper;
-
-macro_rules! gen_helper_use {
- () => {
- #[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope
- struct W;
- }
-}
-
-#[empty_helper] //~ ERROR `empty_helper` is ambiguous
- //~| WARN derive helper attribute is used before it is introduced
- //~| WARN this was previously accepted
-#[derive(Empty)]
-struct S {
- #[empty_helper] // OK, no ambiguity, derive helpers have highest priority
- field: [u8; {
- use empty_helper; //~ ERROR `empty_helper` is ambiguous
-
- #[empty_helper] // OK, no ambiguity, derive helpers have highest priority
- struct U;
-
- mod inner {
- // OK, no ambiguity, the non-helper attribute is not in scope here, only the helper.
- #[empty_helper]
- struct V;
-
- gen_helper_use!();
-
- #[derive(GenHelperUse)] //~ ERROR cannot find attribute `empty_helper` in this scope
- struct Owo;
-
- use empty_helper as renamed;
- #[renamed] //~ ERROR cannot use a derive helper attribute through an import
- struct Wow;
- }
-
- 0
- }]
-}
-
-// OK, no ambiguity, only the non-helper attribute is in scope.
-#[empty_helper]
-struct Z;
-
-fn main() {
- let s = S { field: [] };
-}