]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/trait-object-trait-parens.stderr
Rollup merge of #89317 - JulianKnodt:precise_errors, r=BoxyUwU
[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    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)`
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
29 warning: trait objects without an explicit `dyn` are deprecated
30   --> $DIR/trait-object-trait-parens.rs:13:16
31    |
32 LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
33    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn ?Sized + (for<'a> Trait<'a>) + (Obj)`
34    |
35    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
36    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
37
38 warning: trait objects without an explicit `dyn` are deprecated
39   --> $DIR/trait-object-trait-parens.rs:18:16
40    |
41 LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
42    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn for<'a> Trait<'a> + (Obj) + (?Sized)`
43    |
44    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
45    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
46
47 error[E0225]: only auto traits can be used as additional traits in a trait object
48   --> $DIR/trait-object-trait-parens.rs:8:35
49    |
50 LL |     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
51    |                -----              ^^^^^^^^^^^^^^^^^^^ additional non-auto trait
52    |                |
53    |                first non-auto trait
54    |
55    = 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> {}`
56    = 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>
57
58 error[E0225]: only auto traits can be used as additional traits in a trait object
59   --> $DIR/trait-object-trait-parens.rs:13:47
60    |
61 LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
62    |                         -------------------   ^^^^^ additional non-auto trait
63    |                         |
64    |                         first non-auto trait
65    |
66    = 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 {}`
67    = 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>
68
69 error[E0225]: only auto traits can be used as additional traits in a trait object
70   --> $DIR/trait-object-trait-parens.rs:18:36
71    |
72 LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
73    |                -----------------   ^^^^^ additional non-auto trait
74    |                |
75    |                first non-auto trait
76    |
77    = 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 {}`
78    = 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>
79
80 error: aborting due to 6 previous errors; 3 warnings emitted
81
82 For more information about this error, try `rustc --explain E0225`.