]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/trait-object-trait-parens.stderr
Rollup merge of #86374 - bossmc:enable-static-pie-for-gnu, r=nagisa
[rust.git] / src / test / ui / parser / trait-object-trait-parens.stderr
1 error: `?Trait` is not permitted in trait object types
2   --> $DIR/trait-object-trait-parens.rs:8:24
3    |
4 LL |     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
5    |                        ^^^^^^^^
6
7 error: `?Trait` is not permitted in trait object types
8   --> $DIR/trait-object-trait-parens.rs:13:16
9    |
10 LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
11    |                ^^^^^^
12
13 error: `?Trait` is not permitted in trait object types
14   --> $DIR/trait-object-trait-parens.rs:18:44
15    |
16 LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
17    |                                            ^^^^^^^^
18
19 warning: trait objects without an explicit `dyn` are deprecated
20   --> $DIR/trait-object-trait-parens.rs:8:16
21    |
22 LL |     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
23    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24    |
25    = note: `#[warn(bare_trait_objects)]` on by default
26    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
27    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
28 help: use `dyn`
29    |
30 LL -     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
31 LL +     let _: Box<dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)>;
32    | 
33
34 error[E0225]: only auto traits can be used as additional traits in a trait object
35   --> $DIR/trait-object-trait-parens.rs:8:35
36    |
37 LL |     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
38    |                -----              ^^^^^^^^^^^^^^^^^^^ additional non-auto trait
39    |                |
40    |                first non-auto trait
41    |
42    = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Obj + for<'a> Trait<'a> {}`
43    = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
44
45 warning: trait objects without an explicit `dyn` are deprecated
46   --> $DIR/trait-object-trait-parens.rs:13:16
47    |
48 LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
49    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50    |
51    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
52    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
53 help: use `dyn`
54    |
55 LL -     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
56 LL +     let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>;
57    | 
58
59 error[E0225]: only auto traits can be used as additional traits in a trait object
60   --> $DIR/trait-object-trait-parens.rs:13:47
61    |
62 LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
63    |                         -------------------   ^^^^^ additional non-auto trait
64    |                         |
65    |                         first non-auto trait
66    |
67    = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: for<'a> Trait<'a> + Obj {}`
68    = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
69
70 warning: trait objects without an explicit `dyn` are deprecated
71   --> $DIR/trait-object-trait-parens.rs:18:16
72    |
73 LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
74    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75    |
76    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
77    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
78 help: use `dyn`
79    |
80 LL -     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
81 LL +     let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>;
82    | 
83
84 error[E0225]: only auto traits can be used as additional traits in a trait object
85   --> $DIR/trait-object-trait-parens.rs:18:36
86    |
87 LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
88    |                -----------------   ^^^^^ additional non-auto trait
89    |                |
90    |                first non-auto trait
91    |
92    = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: for<'a> Trait<'a> + Obj {}`
93    = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
94
95 error: aborting due to 6 previous errors; 3 warnings emitted
96
97 For more information about this error, try `rustc --explain E0225`.