]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-61963.rs
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / suggestions / issue-61963.rs
1 // aux-build:issue-61963.rs
2 // aux-build:issue-61963-1.rs
3 #![deny(bare_trait_objects)]
4
5 #[macro_use]
6 extern crate issue_61963;
7 #[macro_use]
8 extern crate issue_61963_1;
9
10 // This test checks that the bare trait object lint does not trigger on macro attributes that
11 // generate code which would trigger the lint.
12
13 pub struct Baz;
14 pub trait Bar {}
15 pub struct Qux<T>(T);
16
17 #[dom_struct]
18 pub struct Foo {
19     //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
20     //~| WARN this is accepted in the current edition
21     //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
22     //~| WARN this is accepted in the current edition
23     //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
24     //~| WARN this is accepted in the current edition
25     //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
26     //~| WARN this is accepted in the current edition
27     qux: Qux<Qux<Baz>>,
28     bar: Box<Bar>,
29     //~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
30     //~| WARN this is accepted in the current edition
31     //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
32     //~| WARN this is accepted in the current edition
33     //~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
34     //~| WARN this is accepted in the current edition
35 }
36
37 fn main() {}