rust/tests/ui/impl-trait/in-trait/unconstrained-lt.rs
2025-06-30 08:06:08 +00:00

15 lines
292 B
Rust

trait Foo {
fn test() -> impl Sized;
}
impl<'a, T> Foo for T {
//~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
fn test() -> &'a () {
//~^ WARN: does not match trait method signature
&()
}
}
fn main() {}