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>) {}
18 error: expected parameter name, found `{`
19 --> $DIR/trait-object-delimiters.rs:8:17
21 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
22 | ^ expected parameter name
24 error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, lifetime, or path, found `{`
25 --> $DIR/trait-object-delimiters.rs:8:17
27 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
28 | -^ expected one of 8 possible tokens
32 error: expected identifier, found `<`
33 --> $DIR/trait-object-delimiters.rs:12:17
35 LL | fn foo4(_: &dyn <Drop + AsRef<str>>) {}
36 | ^ expected identifier
38 error: invalid `dyn` keyword
39 --> $DIR/trait-object-delimiters.rs:14:25
41 LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
42 | ^^^ help: remove this keyword
44 = help: `dyn` is only needed at the start of a trait `+`-separated list
46 error[E0225]: only auto traits can be used as additional traits in a trait object
47 --> $DIR/trait-object-delimiters.rs:3:24
49 LL | fn foo1(_: &dyn Drop + AsRef<str>) {}
50 | ---- ^^^^^^^^^^ additional non-auto trait
52 | first non-auto trait
54 = help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
55 = 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 error[E0224]: at least one trait is required for an object type
58 --> $DIR/trait-object-delimiters.rs:8:13
60 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
63 error[E0225]: only auto traits can be used as additional traits in a trait object
64 --> $DIR/trait-object-delimiters.rs:14:29
66 LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
67 | ---- ^^^^^^^^^^ additional non-auto trait
69 | first non-auto trait
71 = help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
72 = 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 error: aborting due to 9 previous errors
76 Some errors have detailed explanations: E0224, E0225.
77 For more information about an error, try `rustc --explain E0224`.