2022-04-13 11:08:58 +00:00
|
|
|
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
|
2022-11-03 04:22:24 +00:00
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
|
|
|
LL | let _bar = foo.clone();
|
|
|
|
| ++++++++
|
2022-04-13 11:08:58 +00:00
|
|
|
|
2022-09-23 14:22:36 +00:00
|
|
|
error[E0493]: destructor of `String` cannot be evaluated at compile-time
|
2022-04-13 11:08:58 +00:00
|
|
|
--> $DIR/repeat-drop-2.rs:7:25
|
|
|
|
|
|
|
|
|
LL | const _: [String; 0] = [String::new(); 0];
|
|
|
|
| -^^^^^^^^^^^^^----
|
|
|
|
| ||
|
2022-09-23 14:22:36 +00:00
|
|
|
| |the destructor for this type cannot be evaluated in constants
|
2022-04-13 11:08:58 +00:00
|
|
|
| value is dropped here
|
|
|
|
|
2022-06-21 22:54:17 +00:00
|
|
|
error[E0381]: used binding `x` isn't initialized
|
2022-04-13 11:08:58 +00:00
|
|
|
--> $DIR/repeat-drop-2.rs:12:14
|
|
|
|
|
|
2022-06-21 18:57:45 +00:00
|
|
|
LL | let x: u8;
|
2022-06-21 22:54:17 +00:00
|
|
|
| - binding declared here but left uninitialized
|
2022-04-13 11:08:58 +00:00
|
|
|
LL | let _ = [x; 0];
|
2022-06-21 18:57:45 +00:00
|
|
|
| ^ `x` used here but it isn't initialized
|
2022-09-23 07:28:48 +00:00
|
|
|
|
|
|
|
|
help: consider assigning a value
|
|
|
|
|
|
|
|
|
LL | let x: u8 = 0;
|
|
|
|
| +++
|
2022-04-13 11:08:58 +00:00
|
|
|
|
|
|
|
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`.
|