2022-12-26 15:43:31 -08:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
|
2023-09-08 01:35:51 +00:00
|
|
|
fn no_restriction<'a, T: 'a>(x: &'a ()) -> &'a () {
|
2022-12-26 15:43:31 -08:00
|
|
|
with_restriction::<T>(x) //~ ERROR the parameter type `T` may not live long enough
|
|
|
|
}
|
|
|
|
|
|
|
|
fn with_restriction<'b, T: 'b>(x: &'b ()) -> &'b () {
|
|
|
|
x
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|