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