fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.5 KiB94 linesraw
1error: `?Trait` is not permitted in trait object types
2  --> $DIR/trait-object-trait-parens.rs:8:24
3   |
4LL |     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
5   |                        ^^^^^^^^
6
7error: `?Trait` is not permitted in trait object types
8  --> $DIR/trait-object-trait-parens.rs:13:16
9   |
10LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
11   |                ^^^^^^
12
13error: `?Trait` is not permitted in trait object types
14  --> $DIR/trait-object-trait-parens.rs:18:44
15   |
16LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
17   |                                            ^^^^^^^^
18
19warning: trait objects without an explicit `dyn` are deprecated
20  --> $DIR/trait-object-trait-parens.rs:8:16
21   |
22LL |     let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
23   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24   |
25   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
26   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
27   = note: `#[warn(bare_trait_objects)]` on by default
28help: use `dyn`
29   |
30LL |     let _: Box<dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)>;
31   |                +++
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>)>;
37   |                -----              ^^^^^^^^^^^^^^^^^^^ additional non-auto trait
38   |                |
39   |                first non-auto trait
40   |
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> {}`
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>
43
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   |
54LL |     let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>;
55   |                +++
56
57error[E0225]: only auto traits can be used as additional traits in a trait object
58  --> $DIR/trait-object-trait-parens.rs:13:47
59   |
60LL |     let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
61   |                         -------------------   ^^^^^ additional non-auto trait
62   |                         |
63   |                         first non-auto trait
64   |
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 {}`
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>
67
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   |
78LL |     let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>;
79   |                +++
80
81error[E0225]: only auto traits can be used as additional traits in a trait object
82  --> $DIR/trait-object-trait-parens.rs:18:36
83   |
84LL |     let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
85   |                -----------------   ^^^^^ additional non-auto trait
86   |                |
87   |                first non-auto trait
88   |
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 {}`
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>
91
92error: aborting due to 6 previous errors; 3 warnings emitted
93
94For more information about this error, try `rustc --explain E0225`.