File tree 1 file changed +17
-4
lines changed
compiler/rustc_error_codes/src/error_codes
1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
` '_ ` lifetime name or ` &T ` without an explicit lifetime name has been used
2
- on illegal place.
2
+ in an illegal place.
3
3
4
4
Erroneous code example:
5
5
@@ -13,7 +13,14 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
13
13
}
14
14
}
15
15
16
- fn and_without_explicit_lifetime<T>()
16
+ fn without_explicit_lifetime<T>()
17
+ where
18
+ T: Iterator<Item = &u32>,
19
+ //^ `&` without an explicit lifetime name
20
+ {
21
+ }
22
+
23
+ fn without_hrtb<T>()
17
24
where
18
25
T: Into<&u32>,
19
26
//^ `&` without an explicit lifetime name
@@ -40,9 +47,15 @@ fn underscore_lifetime<'a>(str1: &'a str, str2: &'a str) -> &'a str {
40
47
}
41
48
}
42
49
43
- fn and_without_explicit_lifetime<'foo, T>()
50
+ fn without_explicit_lifetime<'a, T>()
51
+ where
52
+ T: Iterator<Item = &'a u32>,
53
+ {
54
+ }
55
+
56
+ fn without_hrtb<T>()
44
57
where
45
- T: Into<&'foo u32>,
58
+ T: for<'foo> Into<&'foo u32>,
46
59
{
47
60
}
48
61
```
You can’t perform that action at this time.
0 commit comments