diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-07-02 12:23:42 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-02 12:23:42 +0530 |
| commit | 7a4f33bec9c8613e87d50a8faf4902e4a3c875ff (patch) | |
| tree | 55e79d6827c06db2779b5b436faf980ad45fb31c | |
| parent | 05aebf8f695aa713c2c35f708df064d1d03a71ff (diff) | |
| parent | 65944ce5228c8c1d2038dddbfac23d4d872b5787 (diff) | |
| download | rust-7a4f33bec9c8613e87d50a8faf4902e4a3c875ff.tar.gz rust-7a4f33bec9c8613e87d50a8faf4902e4a3c875ff.zip | |
Rollup merge of #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.
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/cast.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs index 076415b2d1b..2e6c7f47ac1 100644 --- a/compiler/rustc_const_eval/src/interpret/cast.rs +++ b/compiler/rustc_const_eval/src/interpret/cast.rs @@ -202,7 +202,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let ptr = self.scalar_to_ptr(scalar)?; match ptr.into_pointer_or_addr() { Ok(ptr) => M::expose_ptr(self, ptr)?, - Err(_) => {} // do nothing, exposing an invalid pointer has no meaning + Err(_) => {} // Do nothing, exposing an invalid pointer (`None` provenance) is a NOP. }; Ok(self.cast_from_int_like(scalar, src.layout, cast_ty)?.into()) } |
