File: issue-65285-incorrect-explicit-lifetime-name-needed.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (44 lines) | stat: -rw-r--r-- 1,568 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
error[E0637]: `&` without an explicit lifetime name cannot be used here
  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:5:37
   |
LL | fn should_error<T>() where T : Into<&u32> {}
   |                                     ^ explicit lifetime name needed here
   |
help: consider introducing a higher-ranked lifetime here
   |
LL | fn should_error<T>() where T : for<'a> Into<&'a u32> {}
   |                                +++++++       ++

error[E0106]: missing lifetime specifier
  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:20
   |
LL |     fn foo<'b, L: X<&'b Nested<K>>>();
   |                    ^ expected named lifetime parameter
   |
note: these named lifetimes are available to use
  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:8:9
   |
LL | trait X<'a, K: 'a> {
   |         ^^
LL |     fn foo<'b, L: X<&'b Nested<K>>>();
   |            ^^
help: consider using one of the available lifetimes here
   |
LL |     fn foo<'b, L: X<'lifetime, &'b Nested<K>>>();
   |                     ++++++++++

error[E0106]: missing lifetime specifier
  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:13:16
   |
LL | fn bar<'b, L: X<&'b Nested<i32>>>(){}
   |                ^ expected named lifetime parameter
   |
help: consider using the `'b` lifetime
   |
LL | fn bar<'b, L: X<'b, &'b Nested<i32>>>(){}
   |                 +++

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0106, E0637.
For more information about an error, try `rustc --explain E0106`.