rust/src/test/ui/parser/trait-object-trait-parens.rs

16 lines
645 B
Rust
Raw Normal View History

trait Trait<'a> {}
fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
fn main() {
let _: Box<(Copy) + (?Sized) + (for<'a> Trait<'a>)>;
//~^ ERROR `?Trait` is not permitted in trait object types
//~| WARN trait objects without an explicit `dyn` are deprecated
let _: Box<(?Sized) + (for<'a> Trait<'a>) + (Copy)>;
//~^ WARN trait objects without an explicit `dyn` are deprecated
let _: Box<(for<'a> Trait<'a>) + (Copy) + (?Sized)>;
2019-03-30 17:06:09 -05:00
//~^ ERROR use of undeclared lifetime name `'a`
//~| ERROR `?Trait` is not permitted in trait object types
//~| WARN trait objects without an explicit `dyn` are deprecated
}