]> git.proxmox.com Git - rustc.git/blame - src/test/ui/parser/trait-object-trait-parens.stderr
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / ui / parser / trait-object-trait-parens.stderr
CommitLineData
0731742a 1error: `?Trait` is not permitted in trait object types
ba9703b0 2 --> $DIR/trait-object-trait-parens.rs:8:24
0731742a 3 |
ba9703b0
XL
4LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
5 | ^^^^^^^^
0731742a
XL
6
7error: `?Trait` is not permitted in trait object types
17df50a5 8 --> $DIR/trait-object-trait-parens.rs:13:16
0731742a 9 |
17df50a5
XL
10LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
11 | ^^^^^^
ba9703b0
XL
12
13error: `?Trait` is not permitted in trait object types
17df50a5 14 --> $DIR/trait-object-trait-parens.rs:18:44
ba9703b0 15 |
17df50a5
XL
16LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
17 | ^^^^^^^^
0731742a 18
dc9dc135 19warning: trait objects without an explicit `dyn` are deprecated
ba9703b0 20 --> $DIR/trait-object-trait-parens.rs:8:16
dc9dc135 21 |
ba9703b0 22LL | 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 28help: use `dyn`
17df50a5 29 |
f2b60f7d
FG
30LL | let _: Box<dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)>;
31 | +++
ba9703b0
XL
32
33error[E0225]: only auto traits can be used as additional traits in a trait object
34 --> $DIR/trait-object-trait-parens.rs:8:35
35 |
36LL | 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
44warning: trait objects without an explicit `dyn` are deprecated
45 --> $DIR/trait-object-trait-parens.rs:13:16
46 |
47LL | 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>
52help: use `dyn`
53 |
f2b60f7d
FG
54LL | let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>;
55 | +++
a2a8927a 56
ba9703b0 57error[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
60LL | 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
68warning: trait objects without an explicit `dyn` are deprecated
69 --> $DIR/trait-object-trait-parens.rs:18:16
70 |
71LL | 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>
76help: use `dyn`
77 |
f2b60f7d
FG
78LL | let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>;
79 | +++
a2a8927a 80
ba9703b0 81error[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
84LL | 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 92error: aborting due to 6 previous errors; 3 warnings emitted
0731742a 93
ba9703b0 94For more information about this error, try `rustc --explain E0225`.