forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Unrolled build for rust-lang#119577
Rollup merge of rust-lang#119577 - tmiasko:lint, r=oli-obk Migrate memory overlap check from validator to lint The check attempts to identify potential undefined behaviour, rather than whether MIR is well-formed. It belongs in the lint not validator. Follow up to changes from rust-lang#119077.
Showing
13 changed files
with
115 additions
and
264 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
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
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
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
82 changes: 0 additions & 82 deletions
82
tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-abort.diff
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
tests/mir-opt/dest-prop/unreachable.f.DestinationPropagation.panic-unwind.diff
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
// compile-flags: --crate-type=lib -Zlint-mir -Ztreat-err-as-bug | ||
// build-fail | ||
// failure-status: 101 | ||
// dont-check-compiler-stderr | ||
// error-pattern: encountered `Assign` statement with overlapping memory | ||
#![feature(custom_mir, core_intrinsics)] | ||
extern crate core; | ||
use core::intrinsics::mir::*; | ||
|
||
#[custom_mir(dialect = "runtime", phase = "optimized")] | ||
pub fn main() { | ||
mir!( | ||
let a: [u8; 1024]; | ||
{ | ||
a = a; | ||
Return() | ||
} | ||
) | ||
} |
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,23 @@ | ||
// compile-flags: -Zlint-mir -Ztreat-err-as-bug | ||
// build-fail | ||
// failure-status: 101 | ||
// dont-check-compiler-stderr | ||
// error-pattern: encountered overlapping memory in `Move` arguments to `Call` | ||
#![feature(custom_mir, core_intrinsics)] | ||
extern crate core; | ||
use core::intrinsics::mir::*; | ||
|
||
#[custom_mir(dialect = "runtime", phase = "optimized")] | ||
pub fn main() { | ||
mir!( | ||
let a: [u8; 1024]; | ||
{ | ||
Call(a = f(Move(a)), ReturnTo(bb1), UnwindUnreachable()) | ||
} | ||
bb1 = { | ||
Return() | ||
} | ||
) | ||
} | ||
|
||
pub fn f<T: Copy>(a: T) -> T { a } |