File tree 3 files changed +34
-0
lines changed
compiler/rustc_mir_transform/src
3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ impl<'tcx> MirLint<'tcx> for ConstProp {
63
63
return ;
64
64
}
65
65
66
+ if body. tainted_by_errors . is_some ( ) {
67
+ return ;
68
+ }
69
+
66
70
// Check if it's even possible to satisfy the 'where' clauses
67
71
// for this item.
68
72
// This branch will never be taken for any normal function.
Original file line number Diff line number Diff line change
1
+ // compile-flags: --emit link
2
+
3
+ fn main ( ) {
4
+ let a: [ i32 ; 0 ] = [ ] ;
5
+ match [ a[ ..] ] {
6
+ //~^ ERROR cannot move a value of type `[i32]
7
+ //~| ERROR cannot move out of type `[i32]`, a non-copy slice
8
+ [ [ ] ] => ( ) ,
9
+ _ => ( ) ,
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ error[E0161]: cannot move a value of type `[i32]`
2
+ --> $DIR/issue-115203.rs:5:12
3
+ |
4
+ LL | match [a[..]] {
5
+ | ^^^^^ the size of `[i32]` cannot be statically determined
6
+
7
+ error[E0508]: cannot move out of type `[i32]`, a non-copy slice
8
+ --> $DIR/issue-115203.rs:5:12
9
+ |
10
+ LL | match [a[..]] {
11
+ | ^^^^^
12
+ | |
13
+ | cannot move out of here
14
+ | move occurs because value has type `[i32]`, which does not implement the `Copy` trait
15
+
16
+ error: aborting due to 2 previous errors
17
+
18
+ Some errors have detailed explanations: E0161, E0508.
19
+ For more information about an error, try `rustc --explain E0161`.
You can’t perform that action at this time.
0 commit comments