diff options
| author | Ralf Jung <post@ralfj.de> | 2022-07-26 21:49:34 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-08-26 13:20:56 -0400 |
| commit | 2e52fe01cfe8c26cbd414c4ff24d53f6e5cea29d (patch) | |
| tree | 5ff5db8fbea93741ed028c502c53b315a24ed10a /compiler/rustc_const_eval | |
| parent | da13935ecc5b07e3e6deebc68bde049440430461 (diff) | |
| download | rust-2e52fe01cfe8c26cbd414c4ff24d53f6e5cea29d.tar.gz rust-2e52fe01cfe8c26cbd414c4ff24d53f6e5cea29d.zip | |
remove some now-unnecessary parameters from check_bytes
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/validity.rs | 6 |
2 files changed, 3 insertions, 12 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 692022c0bab..91607f2ad77 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -962,15 +962,10 @@ impl<'tcx, 'a, Prov: Provenance, Extra> AllocRef<'a, 'tcx, Prov, Extra> { } /// `range` is relative to this allocation reference, not the base of the allocation. - pub fn check_bytes( - &self, - range: AllocRange, - allow_uninit: bool, - allow_ptr: bool, - ) -> InterpResult<'tcx> { + pub fn check_bytes(&self, range: AllocRange) -> InterpResult<'tcx> { Ok(self .alloc - .check_bytes(&self.tcx, self.range.subrange(range), allow_uninit, allow_ptr) + .check_bytes(&self.tcx, self.range.subrange(range)) .map_err(|e| e.to_interp_error(self.alloc_id))?) } diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index f04a82a8a4c..5a636b38f38 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -893,11 +893,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M> // We also accept uninit, for consistency with the slow path. let alloc = self.ecx.get_ptr_alloc(mplace.ptr, size, mplace.align)?.expect("we already excluded size 0"); - match alloc.check_bytes( - alloc_range(Size::ZERO, size), - /*allow_uninit*/ false, - /*allow_ptr*/ false, - ) { + match alloc.check_bytes(alloc_range(Size::ZERO, size)) { // In the happy case, we needn't check anything else. Ok(()) => {} // Some error happened, try to provide a more detailed description. |
