summary refs log tree commit diff
path: root/src/test/ui/parser/trait-object-trait-parens.rs
blob: a113de14b6fbc5db9a01e8c6c2c61a8ca67de123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)>;
    //~^ 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
}