]> git.lizzy.rs Git - rust.git/blob - tests/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.fixed
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / lifetimes / suggest-introducing-and-adding-missing-lifetime.fixed
1 // run-rustfix
2
3 #![allow(warnings)]
4
5 fn no_restriction<'a, T: 'a>(x: &'a ()) -> &() {
6     with_restriction::<T>(x) //~ ERROR the parameter type `T` may not live long enough
7 }
8
9 fn with_restriction<'b, T: 'b>(x: &'b ()) -> &'b () {
10     x
11 }
12
13 fn main() {}