]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/dropck/dropck_traits.rs
2 //! Regression test for #34426, regarding HRTB in drop impls
4 // All of this Drop impls should compile.
6 pub trait Lifetime
<'a
> {}
7 impl<'a
> Lifetime
<'a
> for i32 {}
12 for<'a
> L
: Lifetime
<'a
>,
17 impl<L
> Drop
for Foo
<L
>
19 for<'a
> L
: Lifetime
<'a
>,
27 for<'a
> L
: Lifetime
<'a
>,
32 impl<T
: for<'a
> Lifetime
<'a
>> Drop
for Foo2
<T
>
34 for<'x
> T
: Lifetime
<'x
>,
39 pub trait Lifetime2
<'a
, 'b
> {}
40 impl<'a
, 'b
> Lifetime2
<'a
, 'b
> for i32 {}
45 for<'a
, 'b
> L
: Lifetime2
<'a
, 'b
>,
50 impl<L
> Drop
for Bar
<L
>
52 for<'a
, 'b
> L
: Lifetime2
<'a
, 'b
>,
58 struct FnHolder
<T
: for<'a
> Fn(&'a T
, dyn for<'b
> Lifetime2
<'a
, 'b
>) -> u8>(T
);
60 impl<T
: for<'a
> Fn(&'a T
, dyn for<'b
> Lifetime2
<'a
, 'b
>) -> u8> Drop
for FnHolder
<T
> {
65 let _foo
= Foo { l: 0 }
;
67 let _bar
= Bar { l: 0 }
;