]> git.proxmox.com Git - rustc.git/blame - src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / gat-trait-path-parenthesised-args.rs
CommitLineData
5869c6ff 1#![feature(generic_associated_types)]
5869c6ff
XL
2
3trait X {
4 type Y<'a>;
5869c6ff
XL
5}
6
7fn 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
17df50a5
XL
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
5869c6ff 12
923072b8
FG
13
14fn 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
5869c6ff 18fn main() {}