1 // We don't need those errors. Ideally we would silence them, but to do so we need to move the
2 // lint from being an early-lint during parsing to a late-lint, because it needs to be aware of
4 #![allow(bare_trait_objects)]
8 fn foo(_x: Box<Foo + Send>) { } //~ ERROR expected trait, found struct `Foo`
10 type TypeAlias<T> = Box<dyn Vec<T>>; //~ ERROR expected trait, found struct `Vec`
13 fn a() -> A + 'static { //~ ERROR expected trait, found
16 fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) { //~ ERROR expected trait, found
19 fn c() -> 'static + A { //~ ERROR expected trait, found
22 fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) { //~ ERROR expected trait, found
25 fn e() -> 'static + A + 'static { //~ ERROR expected trait, found
26 //~^ ERROR only a single explicit lifetime bound is permitted
29 fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) { //~ ERROR expected trait, found
30 //~^ ERROR only a single explicit lifetime bound is permitted
35 fn g() -> Traitor + 'static { //~ ERROR expected trait, found struct `Traitor`