Skip to content

Commit 2efefe6

Browse files
authored
Rollup merge of rust-lang#129939 - RalfJung:rvalue-len, r=compiler-errors
explain why Rvalue::Len still exists I just spent a bit of time trying to remove this until I realized why that's non-trivial. Let's document that for the next person. :)
2 parents 4a8135c + 98f74b4 commit 2efefe6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: compiler/rustc_middle/src/mir/syntax.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,9 @@ pub enum Rvalue<'tcx> {
13071307
/// If the type of the place is an array, this is the array length. For slices (`[T]`, not
13081308
/// `&[T]`) this accesses the place's metadata to determine the length. This rvalue is
13091309
/// ill-formed for places of other types.
1310+
///
1311+
/// This cannot be a `UnOp(PtrMetadata, _)` because that expects a value, and we only
1312+
/// have a place, and `UnOp(PtrMetadata, RawPtr(place))` is not a thing.
13101313
Len(Place<'tcx>),
13111314

13121315
/// Performs essentially all of the casts that can be performed via `as`.

0 commit comments

Comments
 (0)