rust/tests/ui/regions/regions-infer-at-fn-not-param.rs

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

20 lines
436 B
Rust
Raw Normal View History

struct Parameterized1<'a> {
2019-05-28 13:46:13 -05:00
g: Box<dyn FnMut() + 'a>
}
struct NotParameterized1 {
2019-05-28 13:46:13 -05:00
g: Box<dyn FnMut() + 'static>
}
struct NotParameterized2 {
2019-05-28 13:46:13 -05:00
g: Box<dyn FnMut() + 'static>
}
fn take1<'a>(p: Parameterized1) -> Parameterized1<'a> { p }
//~^ ERROR explicit lifetime required in the type of `p`
fn take3(p: NotParameterized1) -> NotParameterized1 { p }
fn take4(p: NotParameterized2) -> NotParameterized2 { p }
fn main() {}