File: repeat-drop-2.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, 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 (41 lines) | stat: -rw-r--r-- 1,404 bytes parent folder | download | duplicates (4)
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
error[E0493]: destructor of `String` cannot be evaluated at compile-time
  --> $DIR/repeat-drop-2.rs:7:25
   |
LL | const _: [String; 0] = [String::new(); 0];
   |                        -^^^^^^^^^^^^^----
   |                        ||
   |                        |the destructor for this type cannot be evaluated in constants
   |                        value is dropped here

error[E0382]: use of moved value: `foo`
  --> $DIR/repeat-drop-2.rs:4:17
   |
LL |     let foo = String::new();
   |         --- move occurs because `foo` has type `String`, which does not implement the `Copy` trait
LL |     let _bar = foo;
   |                --- value moved here
LL |     let _baz = [foo; 0];
   |                 ^^^ value used here after move
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL |     let _bar = foo.clone();
   |                   ++++++++

error[E0381]: used binding `x` isn't initialized
  --> $DIR/repeat-drop-2.rs:12:14
   |
LL |     let x: u8;
   |         - binding declared here but left uninitialized
LL |     let _ = [x; 0];
   |              ^ `x` used here but it isn't initialized
   |
help: consider assigning a value
   |
LL |     let x: u8 = 42;
   |               ++++

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0381, E0382, E0493.
For more information about an error, try `rustc --explain E0381`.