]>
Commit | Line | Data |
---|---|---|
0731742a | 1 | error: `?Trait` is not permitted in trait object types |
ba9703b0 | 2 | --> $DIR/trait-object-trait-parens.rs:8:24 |
0731742a | 3 | | |
ba9703b0 XL |
4 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; |
5 | | ^^^^^^^^ | |
0731742a XL |
6 | |
7 | error: `?Trait` is not permitted in trait object types | |
17df50a5 | 8 | --> $DIR/trait-object-trait-parens.rs:13:16 |
0731742a | 9 | | |
17df50a5 XL |
10 | LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; |
11 | | ^^^^^^ | |
ba9703b0 XL |
12 | |
13 | error: `?Trait` is not permitted in trait object types | |
17df50a5 | 14 | --> $DIR/trait-object-trait-parens.rs:18:44 |
ba9703b0 | 15 | | |
17df50a5 XL |
16 | LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; |
17 | | ^^^^^^^^ | |
0731742a | 18 | |
dc9dc135 | 19 | warning: trait objects without an explicit `dyn` are deprecated |
ba9703b0 | 20 | --> $DIR/trait-object-trait-parens.rs:8:16 |
dc9dc135 | 21 | | |
ba9703b0 | 22 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; |
a2a8927a | 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
dc9dc135 | 24 | | |
416331ca | 25 | = note: `#[warn(bare_trait_objects)]` on by default |
136023e0 | 26 | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
94222f64 | 27 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> |
a2a8927a | 28 | help: use `dyn` |
17df50a5 | 29 | | |
f2b60f7d FG |
30 | LL | let _: Box<dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)>; |
31 | | +++ | |
ba9703b0 XL |
32 | |
33 | error[E0225]: only auto traits can be used as additional traits in a trait object | |
34 | --> $DIR/trait-object-trait-parens.rs:8:35 | |
35 | | | |
36 | LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | |
3dfed10e XL |
37 | | ----- ^^^^^^^^^^^^^^^^^^^ additional non-auto trait |
38 | | | | |
ba9703b0 | 39 | | first non-auto trait |
3dfed10e | 40 | | |
c295e0f8 | 41 | = 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> {}` |
3dfed10e | 42 | = 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> |
ba9703b0 | 43 | |
a2a8927a XL |
44 | warning: trait objects without an explicit `dyn` are deprecated |
45 | --> $DIR/trait-object-trait-parens.rs:13:16 | |
46 | | | |
47 | LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; | |
48 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
49 | | | |
50 | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! | |
51 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> | |
52 | help: use `dyn` | |
53 | | | |
f2b60f7d FG |
54 | LL | let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>; |
55 | | +++ | |
a2a8927a | 56 | |
ba9703b0 | 57 | error[E0225]: only auto traits can be used as additional traits in a trait object |
17df50a5 | 58 | --> $DIR/trait-object-trait-parens.rs:13:47 |
dc9dc135 | 59 | | |
17df50a5 XL |
60 | LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>; |
61 | | ------------------- ^^^^^ additional non-auto trait | |
62 | | | | |
63 | | first non-auto trait | |
3dfed10e | 64 | | |
c295e0f8 | 65 | = 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 {}` |
3dfed10e | 66 | = 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> |
dc9dc135 | 67 | |
a2a8927a XL |
68 | warning: trait objects without an explicit `dyn` are deprecated |
69 | --> $DIR/trait-object-trait-parens.rs:18:16 | |
70 | | | |
71 | LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; | |
72 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
73 | | | |
74 | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! | |
75 | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> | |
76 | help: use `dyn` | |
77 | | | |
f2b60f7d FG |
78 | LL | let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>; |
79 | | +++ | |
a2a8927a | 80 | |
ba9703b0 | 81 | error[E0225]: only auto traits can be used as additional traits in a trait object |
17df50a5 | 82 | --> $DIR/trait-object-trait-parens.rs:18:36 |
0731742a | 83 | | |
17df50a5 XL |
84 | LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>; |
85 | | ----------------- ^^^^^ additional non-auto trait | |
86 | | | | |
87 | | first non-auto trait | |
3dfed10e | 88 | | |
c295e0f8 | 89 | = 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 {}` |
3dfed10e | 90 | = 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> |
0731742a | 91 | |
ba9703b0 | 92 | error: aborting due to 6 previous errors; 3 warnings emitted |
0731742a | 93 | |
ba9703b0 | 94 | For more information about this error, try `rustc --explain E0225`. |