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 parentheses around trait bounds
8 --> $DIR/trait-object-delimiters.rs:6:17
10 LL | fn foo2(_: &dyn (Drop + AsRef<str>)) {}
13 help: fix the parentheses
15 LL - fn foo2(_: &dyn (Drop + AsRef<str>)) {}
16 LL + fn foo2(_: &(dyn Drop + AsRef<str>)) {}
19 error: incorrect parentheses around trait bounds
20 --> $DIR/trait-object-delimiters.rs:8:25
22 LL | fn foo2_no_space(_: &dyn(Drop + AsRef<str>)) {}
25 help: fix the parentheses
27 LL - fn foo2_no_space(_: &dyn(Drop + AsRef<str>)) {}
28 LL + fn foo2_no_space(_: &(dyn Drop + AsRef<str>)) {}
31 error: expected parameter name, found `{`
32 --> $DIR/trait-object-delimiters.rs:10:17
34 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
35 | ^ expected parameter name
37 error: expected one of `!`, `(`, `)`, `*`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
38 --> $DIR/trait-object-delimiters.rs:10:17
40 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
41 | -^ expected one of 10 possible tokens
45 error: expected identifier, found `<`
46 --> $DIR/trait-object-delimiters.rs:14:17
48 LL | fn foo4(_: &dyn <Drop + AsRef<str>>) {}
49 | ^ expected identifier
51 error: invalid `dyn` keyword
52 --> $DIR/trait-object-delimiters.rs:16:25
54 LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
55 | ^^^ help: remove this keyword
57 = help: `dyn` is only needed at the start of a trait `+`-separated list
59 error[E0225]: only auto traits can be used as additional traits in a trait object
60 --> $DIR/trait-object-delimiters.rs:3:24
62 LL | fn foo1(_: &dyn Drop + AsRef<str>) {}
63 | ---- ^^^^^^^^^^ additional non-auto trait
65 | first non-auto trait
67 = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
68 = 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>
70 error[E0224]: at least one trait is required for an object type
71 --> $DIR/trait-object-delimiters.rs:10:13
73 LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
76 error[E0225]: only auto traits can be used as additional traits in a trait object
77 --> $DIR/trait-object-delimiters.rs:16:29
79 LL | fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {}
80 | ---- ^^^^^^^^^^ additional non-auto trait
82 | first non-auto trait
84 = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef<str> {}`
85 = 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>
87 error: aborting due to 10 previous errors
89 Some errors have detailed explanations: E0224, E0225.
90 For more information about an error, try `rustc --explain E0224`.