]> git.proxmox.com Git - rustc.git/blob - src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / dyn-keyword / issue-56327-dyn-trait-in-macro-is-okay.rs
1 // check-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 }