Skip to content

Commit 7a4f33b

Browse files
authored
Rollup merge of rust-lang#98783 - RalfJung:jumpscares, r=fee1-dead
interpret: make a comment less scary This slipped past my review: "has no meaning" could be read as "is undefined behavior". That is certainly not what we mean so be more clear.
2 parents 05aebf8 + 65944ce commit 7a4f33b

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
202202
let ptr = self.scalar_to_ptr(scalar)?;
203203
match ptr.into_pointer_or_addr() {
204204
Ok(ptr) => M::expose_ptr(self, ptr)?,
205-
Err(_) => {} // do nothing, exposing an invalid pointer has no meaning
205+
Err(_) => {} // Do nothing, exposing an invalid pointer (`None` provenance) is a NOP.
206206
};
207207
Ok(self.cast_from_int_like(scalar, src.layout, cast_ty)?.into())
208208
}

0 commit comments

Comments
 (0)