We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d7e5df commit 1f63a52Copy full SHA for 1f63a52
src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs
@@ -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