Skip to content

Commit 1f63a52

Browse files
committed
Regression test for rust-lang#56327.
1 parent 6d7e5df commit 1f63a52

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// compile-pass
2+
3+
// rust-lang/rust#56327: Some occurrences of `dyn` within a macro are
4+
// not instances of identifiers, and thus should *not* be caught by the
5+
// keyword_ident lint.
6+
//
7+
// Otherwise, rustfix replaces the type `Box<dyn Drop>` with
8+
// `Box<r#dyn Drop>`, which is injecting a bug rather than fixing
9+
// anything.
10+
11+
#![deny(rust_2018_compatibility)]
12+
13+
macro_rules! foo {
14+
() => {
15+
fn generated_foo() {
16+
let _x: Box<dyn Drop>;
17+
}
18+
}
19+
}
20+
21+
foo!();
22+
23+
fn main() {
24+
generated_foo();
25+
}

0 commit comments

Comments
 (0)