about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-bindings/region-lifetimes.rs
blob: 189ab85a27698b057fab05659ca8d61884e03923 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ check-pass

#![feature(impl_trait_in_bindings)]

// A test for #61773 which would have been difficult to support if we
// were to represent `impl_trait_in_bindings` using opaque types.

trait Foo<'a> { }
impl Foo<'_> for &u32 { }

fn bar<'a>(data: &'a u32) {
  let x: impl Foo<'_> = data;
}

fn main() {
  let _: impl Foo<'_> = &44;
}