2018-12-17 03:21:47 +00:00
|
|
|
struct Parameterized1<'a> {
|
2019-05-28 18:46:13 +00:00
|
|
|
g: Box<dyn FnMut() + 'a>
|
2012-08-24 00:02:41 +00:00
|
|
|
}
|
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
struct NotParameterized1 {
|
2019-05-28 18:46:13 +00:00
|
|
|
g: Box<dyn FnMut() + 'static>
|
2012-08-24 00:02:41 +00:00
|
|
|
}
|
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
struct NotParameterized2 {
|
2019-05-28 18:46:13 +00:00
|
|
|
g: Box<dyn FnMut() + 'static>
|
2012-08-24 00:02:41 +00:00
|
|
|
}
|
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
fn take1<'a>(p: Parameterized1) -> Parameterized1<'a> { p }
|
2017-11-04 00:30:14 +00:00
|
|
|
//~^ ERROR explicit lifetime required in the type of `p`
|
2013-05-24 01:37:37 +00:00
|
|
|
|
2018-12-17 03:21:47 +00:00
|
|
|
fn take3(p: NotParameterized1) -> NotParameterized1 { p }
|
|
|
|
fn take4(p: NotParameterized2) -> NotParameterized2 { p }
|
2012-08-24 00:02:41 +00:00
|
|
|
|
|
|
|
fn main() {}
|