]> git.proxmox.com Git - rustc.git/blame - src/test/ui/parser/trait-object-trait-parens.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / parser / trait-object-trait-parens.rs
CommitLineData
0731742a 1trait Trait<'a> {}
223e47cc 2
ba9703b0
XL
3trait Obj {}
4
cc61c64b
XL
5fn f<T: (Copy) + (?Sized) + (for<'a> Trait<'a>)>() {}
6
7fn main() {
ba9703b0
XL
8 let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
9 //~^ ERROR `?Trait` is not permitted in trait object types
10 //~| ERROR only auto traits can be used as additional traits
11 //~| WARN trait objects without an explicit `dyn` are deprecated
136023e0 12 //~| WARN this is accepted in the current edition
17df50a5 13 let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
0731742a 14 //~^ ERROR `?Trait` is not permitted in trait object types
ba9703b0 15 //~| ERROR only auto traits can be used as additional traits
dc9dc135 16 //~| WARN trait objects without an explicit `dyn` are deprecated
136023e0 17 //~| WARN this is accepted in the current edition
17df50a5 18 let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
ba9703b0
XL
19 //~^ ERROR `?Trait` is not permitted in trait object types
20 //~| ERROR only auto traits can be used as additional traits
dc9dc135 21 //~| WARN trait objects without an explicit `dyn` are deprecated
136023e0 22 //~| WARN this is accepted in the current edition
cc61c64b 23}