2024-02-16 14:02:50 -06:00
|
|
|
//@ run-rustfix
|
2022-12-26 17:43:31 -06:00
|
|
|
|
|
|
|
#![allow(warnings)]
|
|
|
|
|
2023-09-07 20:35:51 -05:00
|
|
|
fn no_restriction<'a, T: 'a>(x: &'a ()) -> &'a () {
|
2022-12-26 17:43:31 -06: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() {}
|