]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/trait-object-delimiters.rs
Auto merge of #103019 - Kobzol:ci-multistage-python, r=Mark-Simulacrum
[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 foo2_no_space(_: &dyn(Drop + AsRef<str>)) {} //~ ERROR incorrect braces around trait bounds
9
10 fn foo3(_: &dyn {Drop + AsRef<str>}) {} //~ ERROR expected parameter name, found `{`
11 //~^ ERROR expected one of `!`, `(`, `)`, `*`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
12 //~| ERROR at least one trait is required for an object type
13
14 fn foo4(_: &dyn <Drop + AsRef<str>>) {} //~ ERROR expected identifier, found `<`
15
16 fn foo5(_: &(dyn Drop + dyn AsRef<str>)) {} //~ ERROR invalid `dyn` keyword
17 //~^ ERROR only auto traits can be used as additional traits in a trait object
18
19 fn main() {}