Skip to content

Commit 02878e8

Browse files
committed
Add Offset binary op to custom mir
1 parent b8288e5 commit 02878e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/intrinsics/mir.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
//! - `&`, `&mut`, `addr_of!`, and `addr_of_mut!` all work to create their associated rvalue.
233233
//! - [`Discriminant`] and [`Len`] have associated functions.
234234
//! - Unary and binary operations use their normal Rust syntax - `a * b`, `!c`, etc.
235+
//! - The binary operation `Offset` can be created via [`Offset`].
235236
//! - Checked binary operations are represented by wrapping the associated binop in [`Checked`].
236237
//! - Array repetition syntax (`[foo; 10]`) creates the associated rvalue.
237238
//!
@@ -289,6 +290,7 @@ define!(
289290
fn Discriminant<T>(place: T) -> <T as ::core::marker::DiscriminantKind>::Discriminant
290291
);
291292
define!("mir_set_discriminant", fn SetDiscriminant<T>(place: T, index: u32));
293+
define!("mir_offset", fn Offset<T, U>(ptr: T, count: U) -> T);
292294
define!(
293295
"mir_field",
294296
/// Access the field with the given index of some place.

0 commit comments

Comments
 (0)