Fix invalid syntax in impl Trait parameter type suggestions for E0311
This commit is contained in:
parent
ef4046e4f3
commit
621d412241
14 changed files with 365 additions and 39 deletions
|
@ -0,0 +1,13 @@
|
|||
// run-rustfix
|
||||
|
||||
#![allow(warnings)]
|
||||
|
||||
fn no_restriction<'a, T: 'a>(x: &'a ()) -> &() {
|
||||
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() {}
|
Loading…
Add table
Add a link
Reference in a new issue