Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add const-eval support for indirects
- Loading branch information
Showing
4 changed files
with
59 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// compile-flags: -C overflow-checks=on | ||
|
||
fn main() { | ||
let x = (2u32 as u8) + 1; | ||
} | ||
|
||
// END RUST SOURCE | ||
// START rustc.main.ConstProp.before.mir | ||
// bb0: { | ||
// ... | ||
// _2 = const 2u32 as u8 (Misc); | ||
// _3 = CheckedAdd(move _2, const 1u8); | ||
// assert(!move (_3.1: bool), "attempt to add with overflow") -> bb1; | ||
//} | ||
// END rustc.main.ConstProp.before.mir | ||
// START rustc.main.ConstProp.after.mir | ||
// bb0: { | ||
// ... | ||
// _2 = const 2u8; | ||
// _3 = (const 3u8, const false); | ||
// assert(!const false, "attempt to add with overflow") -> bb1; | ||
// } | ||
// END rustc.main.ConstProp.after.mir |