]>
Commit | Line | Data |
---|---|---|
17df50a5 XL |
1 | error: ambiguous `+` in a type |
2 | --> $DIR/trait-object-delimiters.rs:3:13 | |
3 | | | |
4 | LL | fn foo1(_: &dyn Drop + AsRef<str>) {} | |
5 | | ^^^^^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(dyn Drop + AsRef<str>)` | |
6 | ||
7 | error: incorrect braces around trait bounds | |
8 | --> $DIR/trait-object-delimiters.rs:6:17 | |
9 | | | |
10 | LL | fn foo2(_: &dyn (Drop + AsRef<str>)) {} | |
11 | | ^ ^ | |
12 | | | |
13 | help: remove the parentheses | |
14 | | | |
94222f64 XL |
15 | LL - fn foo2(_: &dyn (Drop + AsRef<str>)) {} |
16 | LL + fn foo2(_: &dyn Drop + AsRef<str>) {} | |
923072b8 | 17 | | |
17df50a5 XL |
18 | |
19 | error: expected parameter name, found `{` | |
20 | --> $DIR/trait-object-delimiters.rs:8:17 | |
21 | | | |
22 | LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {} | |
23 | | ^ expected parameter name | |
24 | ||
94222f64 | 25 | error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `{` |
17df50a5 XL |
26 | --> $DIR/trait-object-delimiters.rs:8:17 |
27 | | | |
28 | LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {} | |
94222f64 | 29 | | -^ expected one of 9 possible tokens |
17df50a5 XL |
30 | | | |
31 | | help: missing `,` | |
32 | ||
33 | error: expected identifier, found `<` | |
34 | --> $DIR/trait-object-delimiters.rs:12:17 | |
35 | | | |
36 | LL | fn foo4(_: &dyn <Drop + AsRef<str>>) {} | |
37 | | ^ expected identifier | |
38 | ||
39 | error: invalid `dyn` keyword | |
40 | --> $DIR/trait-object-delimiters.rs:14:25 | |
41 | | | |
42 | LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {} | |
43 | | ^^^ help: remove this keyword | |
44 | | | |
45 | = help: `dyn` is only needed at the start of a trait `+`-separated list | |
46 | ||
47 | error[E0225]: only auto traits can be used as additional traits in a trait object | |
48 | --> $DIR/trait-object-delimiters.rs:3:24 | |
49 | | | |
50 | LL | fn foo1(_: &dyn Drop + AsRef<str>) {} | |
51 | | ---- ^^^^^^^^^^ additional non-auto trait | |
52 | | | | |
53 | | first non-auto trait | |
54 | | | |
c295e0f8 | 55 | = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}` |
17df50a5 XL |
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[E0224]: at least one trait is required for an object type | |
59 | --> $DIR/trait-object-delimiters.rs:8:13 | |
60 | | | |
61 | LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {} | |
62 | | ^^^ | |
63 | ||
64 | error[E0225]: only auto traits can be used as additional traits in a trait object | |
65 | --> $DIR/trait-object-delimiters.rs:14:29 | |
66 | | | |
67 | LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {} | |
68 | | ---- ^^^^^^^^^^ additional non-auto trait | |
69 | | | | |
70 | | first non-auto trait | |
71 | | | |
c295e0f8 | 72 | = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}` |
17df50a5 XL |
73 | = 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> |
74 | ||
75 | error: aborting due to 9 previous errors | |
76 | ||
77 | Some errors have detailed explanations: E0224, E0225. | |
78 | For more information about an error, try `rustc --explain E0224`. |