rust/tests/ui/impl-trait/precise-capturing/forgot-to-capture-lifetime.rs

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

8 lines
354 B
Rust
Raw Permalink Normal View History

2024-06-05 20:18:52 +00:00
fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x }
//~^ ERROR `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
2024-06-05 20:18:52 +00:00
fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<> { x }
//~^ ERROR hidden type for `impl Sized` captures lifetime that does not appear in bounds
2024-04-04 16:54:56 +00:00
fn main() {}