diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /tests/run-make/const_fn_mir | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/const_fn_mir')
-rw-r--r-- | tests/run-make/const_fn_mir/dump.mir | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/tests/run-make/const_fn_mir/dump.mir b/tests/run-make/const_fn_mir/dump.mir index 9cc70d3b0..ced170bbe 100644 --- a/tests/run-make/const_fn_mir/dump.mir +++ b/tests/run-make/const_fn_mir/dump.mir @@ -1,48 +1,45 @@ // WARNING: This output format is intended for human consumers only // and is subject to change without notice. Knock yourself out. fn foo() -> i32 { - let mut _0: i32; // return place in scope 0 at main.rs:4:19: 4:22 - let mut _1: (i32, bool); // in scope 0 at main.rs:5:5: 5:10 + let mut _0: i32; + let mut _1: (i32, bool); bb0: { - _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at main.rs:5:5: 5:10 - assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at main.rs:5:5: 5:10 + _1 = CheckedAdd(const 5_i32, const 6_i32); + assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue]; } bb1: { - _0 = move (_1.0: i32); // scope 0 at main.rs:5:5: 5:10 - return; // scope 0 at main.rs:6:2: 6:2 + _0 = move (_1.0: i32); + return; } } // MIR FOR CTFE fn foo() -> i32 { - let mut _0: i32; // return place in scope 0 at main.rs:4:19: 4:22 - let mut _1: (i32, bool); // in scope 0 at main.rs:5:5: 5:10 + let mut _0: i32; + let mut _1: (i32, bool); bb0: { - _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at main.rs:5:5: 5:10 - assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at main.rs:5:5: 5:10 + _1 = CheckedAdd(const 5_i32, const 6_i32); + assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue]; } bb1: { - _0 = move (_1.0: i32); // scope 0 at main.rs:5:5: 5:10 - return; // scope 0 at main.rs:6:2: 6:2 + _0 = move (_1.0: i32); + return; } } fn main() -> () { - let mut _0: (); // return place in scope 0 at main.rs:8:11: 8:11 - let _1: i32; // in scope 0 at main.rs:9:5: 9:10 + let mut _0: (); + let _1: i32; bb0: { - _1 = foo() -> bb1; // scope 0 at main.rs:9:5: 9:10 - // mir::Constant - // + span: main.rs:9:5: 9:8 - // + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) } + _1 = foo() -> [return: bb1, unwind continue]; } bb1: { - return; // scope 0 at main.rs:10:2: 10:2 + return; } } |