Skip to content

Commit d6a1744

Browse files
borsgitbot
authored and
gitbot
committed
Auto merge of rust-lang#135709 - lqd:bring-back-len, r=compiler-errors
Temporarily bring back `Rvalue::Len` r? `@compiler-errors` as requested in rust-lang#135671 (comment) > However, in the mean time, I'd rather we not crunch trying to find and more importantly validate the soundness of a solution 🤔 Agreed. To fix the IMO P-critical rust-lang#135671 for which we somehow didn't have test coverage, this PR temporarily reverts: - rust-lang#133734 - its bugfix rust-lang#134371 - rust-lang#134330 cc `@scottmcm` I added the few samples from that issue as a test, but we can add more in the future, in particular it seems `@steffahn` [will work on that](rust-lang#135671 (comment)). Fixes rust-lang#135671. And if we want to land this, it should also be nominated for beta backport.
2 parents fe9afd2 + e5ee93d commit d6a1744

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/intrinsics/mir.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
//!
234234
//! - Operands implicitly convert to `Use` rvalues.
235235
//! - `&`, `&mut`, `addr_of!`, and `addr_of_mut!` all work to create their associated rvalue.
236-
//! - [`Discriminant`] and [`CopyForDeref`] have associated functions.
236+
//! - [`Discriminant`], [`Len`], and [`CopyForDeref`] have associated functions.
237237
//! - Unary and binary operations use their normal Rust syntax - `a * b`, `!c`, etc.
238238
//! - The binary operation `Offset` can be created via [`Offset`].
239239
//! - Checked binary operations are represented by wrapping the associated binop in [`Checked`].
@@ -401,6 +401,7 @@ define!("mir_storage_dead", fn StorageDead<T>(local: T));
401401
define!("mir_assume", fn Assume(operand: bool));
402402
define!("mir_deinit", fn Deinit<T>(place: T));
403403
define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool));
404+
define!("mir_len", fn Len<T>(place: T) -> usize);
404405
define!(
405406
"mir_ptr_metadata",
406407
fn PtrMetadata<P: ?Sized>(place: *const P) -> <P as ::core::ptr::Pointee>::Metadata

0 commit comments

Comments
 (0)