rust/tests/ui/impl-trait/precise-capturing/rpitit-impl-captures-too-much.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
335 B
Rust
Raw Normal View History

2024-09-29 12:41:13 -05:00
#![feature(precise_capturing_in_traits)]
struct Invariant<'a>(&'a mut &'a mut ());
trait Trait {
fn hello(self_: Invariant<'_>) -> impl Sized + use<Self>;
}
impl Trait for () {
fn hello(self_: Invariant<'_>) -> impl Sized + use<'_> {}
//~^ ERROR return type captures more lifetimes than trait definition
}
fn main() {}