]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/constructor-lifetime-args.rs
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 but only 1 lifetime argument was supplied
19 S
::<'
static, '
static, '
static>(&0, &0);
20 //~^ ERROR this struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
23 //~^ ERROR this enum takes 2 lifetime arguments but only 1 lifetime argument was supplied
24 E
::V
::<'
static, '
static, '
static>(&0);
25 //~^ ERROR this enum takes 2 lifetime arguments but 3 lifetime arguments were supplied