os-rust/src/test/ui/impl-trait/unactionable_diagnostic.rs

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

24 lines
365 B
Rust
Raw Normal View History

2022-09-01 15:41:13 +00:00
trait Trait {}
struct Foo;
impl Trait for Foo {}
2022-09-23 07:10:11 +00:00
fn foo<'x, P>(
2022-09-01 15:41:13 +00:00
post: P,
2022-09-23 07:10:11 +00:00
x: &'x Foo,
) -> &'x impl Trait {
//~^ HELP: consider adding an explicit lifetime bound...
2022-09-01 15:41:13 +00:00
x
}
fn bar<'t, T>(
post: T,
x: &'t Foo,
) -> &'t impl Trait {
foo(post, x)
//~^ ERROR: the opaque type `foo<T>::{opaque#0}` may not live long enough
}
fn main() {}