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