]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / gat-trait-path-parenthesised-args.rs
1 #![feature(generic_associated_types)]
2
3 trait X {
4   type Y<'a>;
5 }
6
7 fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
8   //~^ ERROR: lifetime in trait object type must be followed by `+`
9   //~| ERROR: parenthesized generic arguments cannot be used
10   //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
11   //~| ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
12
13
14 fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
15   //~^ ERROR: parenthesized generic arguments cannot be used
16   //~| ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
17
18 fn main() {}