]> git.lizzy.rs Git - rust.git/commitdiff
remove redundant return value Ok(()) of clear_relocations()
authorMatthias Krüger <matthias.krueger@famsik.de>
Sun, 21 Feb 2021 12:25:28 +0000 (13:25 +0100)
committerMatthias Krüger <matthias.krueger@famsik.de>
Sun, 21 Feb 2021 12:25:28 +0000 (13:25 +0100)
compiler/rustc_middle/src/mir/interpret/allocation.rs

index 5ebe38b2d7e09fe9b659a6aee5ef5c24d9dbbde9..449b3a82dcbb7c68f8423071d3a85975fa21b461 100644 (file)
@@ -266,7 +266,7 @@ pub fn get_bytes_mut(
         let range = self.check_bounds(ptr.offset, size);
 
         self.mark_init(ptr, size, true);
-        self.clear_relocations(cx, ptr, size)?;
+        self.clear_relocations(cx, ptr, size);
 
         AllocationExtra::memory_written(self, ptr, size)?;
 
@@ -484,18 +484,13 @@ fn check_relocations(
     /// uninitialized. This is a somewhat odd "spooky action at a distance",
     /// but it allows strictly more code to run than if we would just error
     /// immediately in that case.
-    fn clear_relocations(
-        &mut self,
-        cx: &impl HasDataLayout,
-        ptr: Pointer<Tag>,
-        size: Size,
-    ) -> InterpResult<'tcx> {
+    fn clear_relocations(&mut self, cx: &impl HasDataLayout, ptr: Pointer<Tag>, size: Size) {
         // Find the start and end of the given range and its outermost relocations.
         let (first, last) = {
             // Find all relocations overlapping the given range.
             let relocations = self.get_relocations(cx, ptr, size);
             if relocations.is_empty() {
-                return Ok(());
+                return;
             }
 
             (
@@ -517,8 +512,6 @@ fn clear_relocations(
 
         // Forget all the relocations.
         self.relocations.remove_range(first..last);
-
-        Ok(())
     }
 
     /// Errors if there are relocations overlapping with the edges of the