|
233 | 233 | //!
|
234 | 234 | //! - Operands implicitly convert to `Use` rvalues.
|
235 | 235 | //! - `&`, `&mut`, `addr_of!`, and `addr_of_mut!` all work to create their associated rvalue.
|
236 |
| -//! - [`Discriminant`], [`Len`], and [`CopyForDeref`] have associated functions. |
| 236 | +//! - [`CopyForDeref`], [`CastTransmute`], [`CastPtrToPtr`], [`CastUnsize`], and [`Discriminant`] |
| 237 | +//! have associated functions. |
237 | 238 | //! - Unary and binary operations use their normal Rust syntax - `a * b`, `!c`, etc.
|
238 | 239 | //! - The binary operation `Offset` can be created via [`Offset`].
|
239 | 240 | //! - Checked binary operations are represented by wrapping the associated binop in [`Checked`].
|
@@ -401,7 +402,6 @@ define!("mir_storage_dead", fn StorageDead<T>(local: T));
|
401 | 402 | define!("mir_assume", fn Assume(operand: bool));
|
402 | 403 | define!("mir_deinit", fn Deinit<T>(place: T));
|
403 | 404 | define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool));
|
404 |
| -define!("mir_len", fn Len<T>(place: T) -> usize); |
405 | 405 | define!(
|
406 | 406 | "mir_ptr_metadata",
|
407 | 407 | fn PtrMetadata<P: ?Sized>(place: *const P) -> <P as ::core::ptr::Pointee>::Metadata
|
@@ -491,6 +491,13 @@ define!(
|
491 | 491 | /// This allows bypassing normal validation to generate strange casts.
|
492 | 492 | fn CastPtrToPtr<T, U>(operand: T) -> U
|
493 | 493 | );
|
| 494 | +define!( |
| 495 | + "mir_cast_unsize", |
| 496 | + /// Emits a `CastKind::PointerCoercion(Unsize)` cast. |
| 497 | + /// |
| 498 | + /// This allows bypassing normal validation to generate strange casts. |
| 499 | + fn CastUnsize<T, U>(operand: T) -> U |
| 500 | +); |
494 | 501 | define!(
|
495 | 502 | "mir_make_place",
|
496 | 503 | #[doc(hidden)]
|
|
0 commit comments