File tree Expand file tree Collapse file tree 3 files changed +69
-1
lines changed Expand file tree Collapse file tree 3 files changed +69
-1
lines changed Original file line number Diff line number Diff line change @@ -667,3 +667,27 @@ mod issue_10371 {
667667 }
668668 }
669669}
670+
671+ mod issue_13092 {
672+ use std::cell::RefCell;
673+ macro_rules! macro_inner_item {
674+ ($ty:ty) => {
675+ fn foo(_: $ty) {
676+ fn inner(_: $ty) {}
677+ }
678+ };
679+ }
680+
681+ #[derive(Default)]
682+ struct MyStruct;
683+
684+ impl MyStruct {
685+ macro_inner_item!(Self);
686+ }
687+
688+ impl MyStruct {
689+ thread_local! {
690+ static SPECIAL: RefCell<Self> = RefCell::default();
691+ }
692+ }
693+ }
Original file line number Diff line number Diff line change @@ -667,3 +667,27 @@ mod issue_10371 {
667667 }
668668 }
669669}
670+
671+ mod issue_13092 {
672+ use std:: cell:: RefCell ;
673+ macro_rules! macro_inner_item {
674+ ( $ty: ty) => {
675+ fn foo( _: $ty) {
676+ fn inner( _: $ty) { }
677+ }
678+ } ;
679+ }
680+
681+ #[ derive( Default ) ]
682+ struct MyStruct ;
683+
684+ impl MyStruct {
685+ macro_inner_item ! ( MyStruct ) ;
686+ }
687+
688+ impl MyStruct {
689+ thread_local ! {
690+ static SPECIAL : RefCell <MyStruct > = RefCell :: default ( ) ;
691+ }
692+ }
693+ }
Original file line number Diff line number Diff line change @@ -259,5 +259,25 @@ error: unnecessary structure name repetition
259259LL | E::A => {},
260260 | ^ help: use the applicable keyword: `Self`
261261
262- error: aborting due to 43 previous errors
262+ error: unnecessary structure name repetition
263+ --> tests/ui/use_self.rs:685:27
264+ |
265+ LL | macro_inner_item!(MyStruct);
266+ | ^^^^^^^^ help: use the applicable keyword: `Self`
267+
268+ error: unnecessary structure name repetition
269+ --> tests/ui/use_self.rs:690:37
270+ |
271+ LL | static SPECIAL: RefCell<MyStruct> = RefCell::default();
272+ | ^^^^^^^^ help: use the applicable keyword: `Self`
273+
274+ error: unnecessary structure name repetition
275+ --> tests/ui/use_self.rs:690:37
276+ |
277+ LL | static SPECIAL: RefCell<MyStruct> = RefCell::default();
278+ | ^^^^^^^^ help: use the applicable keyword: `Self`
279+ |
280+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
281+
282+ error: aborting due to 46 previous errors
263283
You can’t perform that action at this time.
0 commit comments