File: equal-lifetime-params-not-ok.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 (59 lines) | stat: -rw-r--r-- 2,148 bytes parent folder | download | duplicates (3)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
error: non-defining opaque type use in defining scope
  --> $DIR/equal-lifetime-params-not-ok.rs:10:22
   |
LL |     fn test<'a>() -> Opaque<'a, 'a> {}
   |                      ^^^^^^^^^^^^^^ generic argument `'a` used twice
   |
note: for this opaque type
  --> $DIR/equal-lifetime-params-not-ok.rs:9:27
   |
LL |     type Opaque<'a, 'b> = impl super::Trait<'a, 'b>;
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^

error: non-defining opaque type use in defining scope
  --> $DIR/equal-lifetime-params-not-ok.rs:10:37
   |
LL |     fn test<'a>() -> Opaque<'a, 'a> {}
   |                                     ^^
   |
note: lifetime used multiple times
  --> $DIR/equal-lifetime-params-not-ok.rs:9:17
   |
LL |     type Opaque<'a, 'b> = impl super::Trait<'a, 'b>;
   |                 ^^  ^^

error: non-defining opaque type use in defining scope
  --> $DIR/equal-lifetime-params-not-ok.rs:17:49
   |
LL |     fn test<'a: 'b, 'b: 'a>() -> Opaque<'a, 'b> {}
   |                                                 ^^
   |
note: lifetime used multiple times
  --> $DIR/equal-lifetime-params-not-ok.rs:16:17
   |
LL |     type Opaque<'a, 'b> = impl super::Trait<'a, 'b>;
   |                 ^^  ^^

error: non-defining opaque type use in defining scope
  --> $DIR/equal-lifetime-params-not-ok.rs:23:61
   |
LL |     fn test<'a: 'b, 'b: 'a>(a: &'a str) -> Opaque<'a, 'b> { a }
   |                                                             ^
   |
note: lifetime used multiple times
  --> $DIR/equal-lifetime-params-not-ok.rs:22:17
   |
LL |     type Opaque<'a, 'b> = impl super::Trait<'a, 'b>;
   |                 ^^  ^^

error[E0792]: expected generic lifetime parameter, found `'static`
  --> $DIR/equal-lifetime-params-not-ok.rs:33:42
   |
LL |     type Opaque<'a> = impl super::Trait<'a, 'a>;
   |                 -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
LL |     fn test<'a: 'static>() -> Opaque<'a> {}
   |                                          ^^

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0792`.