Skip to content

Commit 1bd6e16

Browse files
committed
Address FIXME
1 parent c3ab4f2 commit 1bd6e16

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

tests/mir-opt/building/custom/projections.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ fn unions(u: U) -> i32 {
2121
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
2222
fn tuples(i: (u32, i32)) -> (u32, i32) {
2323
mir!(
24-
// FIXME(JakobDegen): This is necessary because we can't give type hints for `RET`
25-
let temp: (u32, i32);
24+
type RET = (u32, i32);
2625
{
27-
temp.0 = i.0;
28-
temp.1 = i.1;
29-
30-
RET = temp;
26+
RET.0 = i.0;
27+
RET.1 = i.1;
3128
Return()
3229
}
3330
)

tests/mir-opt/building/custom/projections.tuples.built.after.mir

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
fn tuples(_1: (u32, i32)) -> (u32, i32) {
44
let mut _0: (u32, i32); // return place in scope 0 at $DIR/projections.rs:+0:29: +0:39
5-
let mut _2: (u32, i32); // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
65

76
bb0: {
8-
(_2.0: u32) = (_1.0: u32); // scope 0 at $DIR/projections.rs:+5:13: +5:25
9-
(_2.1: i32) = (_1.1: i32); // scope 0 at $DIR/projections.rs:+6:13: +6:25
10-
_0 = _2; // scope 0 at $DIR/projections.rs:+8:13: +8:23
11-
return; // scope 0 at $DIR/projections.rs:+9:13: +9:21
7+
(_0.0: u32) = (_1.0: u32); // scope 0 at $DIR/projections.rs:+4:13: +4:24
8+
(_0.1: i32) = (_1.1: i32); // scope 0 at $DIR/projections.rs:+5:13: +5:24
9+
return; // scope 0 at $DIR/projections.rs:+6:13: +6:21
1210
}
1311
}

0 commit comments

Comments
 (0)