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 {
2828 let param_env = tcx. param_env ( src. def_id ( ) ) . with_reveal_all ( ) ;
2929 let move_data = match MoveData :: gather_moves ( body, tcx, param_env) {
3030 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+ }
3238 } ;
3339 let elaborate_patch = {
3440 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