This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,13 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
28
28
let param_env = tcx. param_env ( src. def_id ( ) ) . with_reveal_all ( ) ;
29
29
let move_data = match MoveData :: gather_moves ( body, tcx, param_env) {
30
30
Ok ( move_data) => move_data,
31
- Err ( _) => bug ! ( "No `move_errors` should be allowed in MIR borrowck" ) ,
31
+ Err ( ( move_data, _) ) => {
32
+ tcx. sess . delay_span_bug (
33
+ body. span ,
34
+ "No `move_errors` should be allowed in MIR borrowck" ,
35
+ ) ;
36
+ move_data
37
+ }
32
38
} ;
33
39
let elaborate_patch = {
34
40
let body = & * body;
Original file line number Diff line number Diff line change
1
+ struct Bug {
2
+ A : [ ( ) ; { * "" } . len ( ) ] ,
3
+ //~^ ERROR: cannot move a value of type str
4
+ //~| ERROR: cannot move out of a shared reference
5
+ }
6
+
7
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0161]: cannot move a value of type str: the size of str cannot be statically determined
2
+ --> $DIR/issue-67947.rs:2:13
3
+ |
4
+ LL | A: [(); { *"" }.len()],
5
+ | ^^^^^^^
6
+
7
+ error[E0507]: cannot move out of a shared reference
8
+ --> $DIR/issue-67947.rs:2:15
9
+ |
10
+ LL | A: [(); { *"" }.len()],
11
+ | ^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
12
+
13
+ error: aborting due to 2 previous errors
14
+
15
+ Some errors have detailed explanations: E0161, E0507.
16
+ For more information about an error, try `rustc --explain E0161`.
You can’t perform that action at this time.
0 commit comments