rust/tests/ui/impl-trait/in-bindings/region-lifetimes.rs
2025-06-24 19:55:42 +06:00

18 lines
339 B
Rust

//@ 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;
}