File: generic-associated-const.stderr

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (46 lines) | stat: -rw-r--r-- 1,827 bytes parent folder | download | duplicates (14)
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
error[E0106]: missing lifetime specifier
  --> $DIR/generic-associated-const.rs:15:29
   |
LL |     const GAC_LIFETIME<'a>: &str = "";
   |                             ^ expected named lifetime parameter
   |
help: consider using the `'a` lifetime
   |
LL |     const GAC_LIFETIME<'a>: &'a str = "";
   |                              ++

warning: the feature `generic_const_items` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/generic-associated-const.rs:2:12
   |
LL | #![feature(generic_const_items)]
   |            ^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
   = note: `#[warn(incomplete_features)]` on by default

error: `&` without an explicit lifetime name cannot be used here
  --> $DIR/generic-associated-const.rs:8:29
   |
LL |     const GAC_LIFETIME<'a>: &str = "";
   |                             ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
note: cannot automatically infer `'static` because of other lifetimes in scope
  --> $DIR/generic-associated-const.rs:8:24
   |
LL |     const GAC_LIFETIME<'a>: &str = "";
   |                        ^^
note: the lint level is defined here
  --> $DIR/generic-associated-const.rs:1:9
   |
LL | #![deny(elided_lifetimes_in_associated_constant)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: use the `'static` lifetime
   |
LL |     const GAC_LIFETIME<'a>: &'static str = "";
   |                              +++++++

error: aborting due to 2 previous errors; 1 warning emitted

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