error: ambiguous `+` in a type --> $DIR/trait-object-delimiters.rs:3:13 | LL | fn foo1(_: &dyn Drop + AsRef) {} | ^^^^^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(dyn Drop + AsRef)` error: incorrect parentheses around trait bounds --> $DIR/trait-object-delimiters.rs:6:17 | LL | fn foo2(_: &dyn (Drop + AsRef)) {} | ^ ^ | help: fix the parentheses | LL - fn foo2(_: &dyn (Drop + AsRef)) {} LL + fn foo2(_: &(dyn Drop + AsRef)) {} | error: incorrect parentheses around trait bounds --> $DIR/trait-object-delimiters.rs:8:25 | LL | fn foo2_no_space(_: &dyn(Drop + AsRef)) {} | ^ ^ | help: fix the parentheses | LL - fn foo2_no_space(_: &dyn(Drop + AsRef)) {} LL + fn foo2_no_space(_: &(dyn Drop + AsRef)) {} | error: expected parameter name, found `{` --> $DIR/trait-object-delimiters.rs:10:17 | LL | fn foo3(_: &dyn {Drop + AsRef}) {} | ^ expected parameter name error: expected one of `!`, `(`, `)`, `*`, `,`, `?`, `async`, `const`, `for`, `~`, lifetime, or path, found `{` --> $DIR/trait-object-delimiters.rs:10:17 | LL | fn foo3(_: &dyn {Drop + AsRef}) {} | -^ expected one of 12 possible tokens | | | help: missing `,` error: expected identifier, found `<` --> $DIR/trait-object-delimiters.rs:14:17 | LL | fn foo4(_: &dyn >) {} | ^ expected identifier error: invalid `dyn` keyword --> $DIR/trait-object-delimiters.rs:16:25 | LL | fn foo5(_: &(dyn Drop + dyn AsRef)) {} | ^^^ help: remove this keyword | = help: `dyn` is only needed at the start of a trait `+`-separated list error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-delimiters.rs:3:24 | LL | fn foo1(_: &dyn Drop + AsRef) {} | ---- ^^^^^^^^^^ additional non-auto trait | | | first non-auto trait | = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0224]: at least one trait is required for an object type --> $DIR/trait-object-delimiters.rs:10:13 | LL | fn foo3(_: &dyn {Drop + AsRef}) {} | ^^^ error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-delimiters.rs:16:29 | LL | fn foo5(_: &(dyn Drop + dyn AsRef)) {} | ---- ^^^^^^^^^^ additional non-auto trait | | | first non-auto trait | = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Drop + AsRef {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error: aborting due to 10 previous errors Some errors have detailed explanations: E0224, E0225. For more information about an error, try `rustc --explain E0224`.