forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#110190 - cbeuw:mir-offset, r=oli-obk
Custom MIR: Support `BinOp::Offset` Since offset doesn't have an infix operator, a new function `Offset` is added which is lowered to `Rvalue::BinaryOp(BinOp::Offset, ..)` r? ``@oli-obk`` or ``@tmiasko`` or ``@JakobDegen``
- Loading branch information
Showing
4 changed files
with
28 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
10 changes: 10 additions & 0 deletions
10
tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
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,10 @@ | ||
// MIR for `raw_pointer_offset` after built | ||
|
||
fn raw_pointer_offset(_1: *const i32) -> *const i32 { | ||
let mut _0: *const i32; // return place in scope 0 at $DIR/references.rs:+0:45: +0:55 | ||
|
||
bb0: { | ||
_0 = Offset(_1, const 1_isize); // scope 0 at $DIR/references.rs:+2:9: +2:33 | ||
return; // scope 0 at $DIR/references.rs:+3:9: +3:17 | ||
} | ||
} |
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