diff options
| author | Ralf Jung <post@ralfj.de> | 2023-02-14 14:55:50 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-02-14 14:55:50 +0100 |
| commit | 91d25168cd85d712bbc3435ad8e9f76733b802b4 (patch) | |
| tree | 8469cb69c311317ec354fca010307eeab4984977 /compiler/rustc_middle/src/mir/interpret/pointer.rs | |
| parent | 2d91939bb7130a8e6c092a290b7d37f654e3c23c (diff) | |
| download | rust-91d25168cd85d712bbc3435ad8e9f76733b802b4.tar.gz rust-91d25168cd85d712bbc3435ad8e9f76733b802b4.zip | |
interpret: rename Pointer::from_addr → from_addr_invalid
Diffstat (limited to 'compiler/rustc_middle/src/mir/interpret/pointer.rs')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/pointer.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/pointer.rs b/compiler/rustc_middle/src/mir/interpret/pointer.rs index b0830991076..ab667c22a14 100644 --- a/compiler/rustc_middle/src/mir/interpret/pointer.rs +++ b/compiler/rustc_middle/src/mir/interpret/pointer.rs @@ -251,14 +251,16 @@ impl<Prov> Pointer<Option<Prov>> { } impl<Prov> Pointer<Option<Prov>> { + /// Creates a pointer to the given address, with invalid provenance (i.e., cannot be used for + /// any memory access). #[inline(always)] - pub fn from_addr(addr: u64) -> Self { + pub fn from_addr_invalid(addr: u64) -> Self { Pointer { provenance: None, offset: Size::from_bytes(addr) } } #[inline(always)] pub fn null() -> Self { - Pointer::from_addr(0) + Pointer::from_addr_invalid(0) } } |
