@@ -12,6 +12,36 @@ help: consider adding an explicit lifetime bound
12
12
LL | fn g<T: 'static>(data: &[T]) {
13
13
| +++++++++
14
14
15
+ error[E0310]: the parameter type `T` may not live long enough
16
+ --> $DIR/issue_74400.rs:12:5
17
+ |
18
+ LL | f(data, identity)
19
+ | ^^^^^^^^^^^^^^^^^
20
+ | |
21
+ | the parameter type `T` must be valid for the static lifetime...
22
+ | ...so that the type `T` will meet its required lifetime bounds
23
+ |
24
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
25
+ help: consider adding an explicit lifetime bound
26
+ |
27
+ LL | fn g<T: 'static>(data: &[T]) {
28
+ | +++++++++
29
+
30
+ error[E0310]: the parameter type `T` may not live long enough
31
+ --> $DIR/issue_74400.rs:12:5
32
+ |
33
+ LL | f(data, identity)
34
+ | ^^^^^^^^^^^^^^^^^
35
+ | |
36
+ | the parameter type `T` must be valid for the static lifetime...
37
+ | ...so that the type `T` will meet its required lifetime bounds
38
+ |
39
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
40
+ help: consider adding an explicit lifetime bound
41
+ |
42
+ LL | fn g<T: 'static>(data: &[T]) {
43
+ | +++++++++
44
+
15
45
error[E0308]: mismatched types
16
46
--> $DIR/issue_74400.rs:12:5
17
47
|
@@ -35,7 +65,7 @@ LL | f(data, identity)
35
65
= note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `FnOnce<(&'1 T,)>`, for any lifetime `'1`...
36
66
= note: ...but it actually implements `FnOnce<(&'2 T,)>`, for some specific lifetime `'2`
37
67
38
- error: aborting due to 3 previous errors
68
+ error: aborting due to 5 previous errors
39
69
40
70
Some errors have detailed explanations: E0308, E0310.
41
71
For more information about an error, try `rustc --explain E0308`.
0 commit comments