]>
git.proxmox.com Git - rustc.git/blob - tests/ui/impl-header-lifetime-elision/path-underscore.rs
1 // Test that `impl MyTrait for Foo<'_>` works.
9 struct Foo
<'a
> { x: &'a u32 }
11 impl MyTrait
for Foo
<'_
> {
14 fn impls_my_trait
<T
: MyTrait
>() { }
16 fn impls_my_trait_val
<T
: MyTrait
>(_
: T
) {
17 impls_my_trait
::<T
>();
20 fn random_where_clause()
21 where for<'a
> Foo
<'a
>: MyTrait { }
25 let f
= Foo { x: &x }
;
27 // This type is `Foo<'x>` for a local lifetime `'x`; so the impl
28 // must apply to any lifetime to apply to this.
29 impls_my_trait_val(f
);
31 impls_my_trait
::<Foo
<'
static>>();
33 random_where_clause();