1 // All lifetime parameters in struct constructors are currently considered early bound,
2 // i.e., `S::<ARGS>` is interpreted kinda like an associated item `S::<ARGS>::ctor`.
3 // This behavior is a bit weird, because if equivalent constructor were written manually
4 // it would get late bound lifetime parameters.
5 // Variant constructors behave in the same way, lifetime parameters are considered
6 // belonging to the enum and being early bound.
7 // https://github.com/rust-lang/rust/issues/30904
9 struct S<'a, 'b>(&'a u8, &'b u8);
18 //~^ ERROR this struct takes 2 lifetime arguments
19 S::<'static, 'static, 'static>(&0, &0);
20 //~^ ERROR this struct takes 2 lifetime arguments
23 //~^ ERROR this enum takes 2 lifetime arguments
24 E::V::<'static, 'static, 'static>(&0);
25 //~^ ERROR this enum takes 2 lifetime arguments