-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: return ealry when has tainted in mir-lint
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// compile-flags: --emit link | ||
|
||
fn main() { | ||
let a: [i32; 0] = []; | ||
match [a[..]] { | ||
//~^ ERROR cannot move a value of type `[i32] | ||
//~| ERROR cannot move out of type `[i32]`, a non-copy slice | ||
[[]] => (), | ||
_ => (), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0161]: cannot move a value of type `[i32]` | ||
--> $DIR/issue-115203.rs:5:12 | ||
| | ||
LL | match [a[..]] { | ||
| ^^^^^ the size of `[i32]` cannot be statically determined | ||
|
||
error[E0508]: cannot move out of type `[i32]`, a non-copy slice | ||
--> $DIR/issue-115203.rs:5:12 | ||
| | ||
LL | match [a[..]] { | ||
| ^^^^^ | ||
| | | ||
| cannot move out of here | ||
| move occurs because value has type `[i32]`, which does not implement the `Copy` trait | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0161, E0508. | ||
For more information about an error, try `rustc --explain E0161`. |