]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/trait-object-delimiters.rs
Test drop_tracking_mir before querying generator.
[rust.git] / tests / ui / parser / trait-object-delimiters.rs
1 // edition:2018
2
3 fn foo1(_: &dyn Drop + AsRef<str>) {} //~ ERROR ambiguous `+` in a type
4 //~^ ERROR only auto traits can be used as additional traits in a trait object
5
6 fn foo2(_: &dyn (Drop + AsRef<str>)) {} //~ ERROR incorrect braces around trait bounds
7
8 fn foo3(_: &dyn {Drop + AsRef<str>}) {} //~ ERROR expected parameter name, found `{`
9 //~^ ERROR expected one of `!`, `(`, `)`, `*`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
10 //~| ERROR at least one trait is required for an object type
11
12 fn foo4(_: &dyn <Drop + AsRef<str>>) {} //~ ERROR expected identifier, found `<`
13
14 fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {} //~ ERROR invalid `dyn` keyword
15 //~^ ERROR only auto traits can be used as additional traits in a trait object
16
17 fn main() {}