Skip to content

Commit 5d166b7

Browse files
Rollup merge of #151908 - Zalathar:contains-slice, r=chenyukang
Remove unused method `DroplessArena::contains_slice` - This method was added for #120128. - It became unused in #136593. Checking whether a particular slice is within an arena is a bit of a sketchy operation, so if there's no pressing need for it then I think we're better off not having it lying around.
2 parents 271951b + e60c475 commit 5d166b7

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

  • compiler/rustc_arena/src

compiler/rustc_arena/src/lib.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -510,19 +510,6 @@ impl DroplessArena {
510510
}
511511
}
512512

513-
/// Used by `Lift` to check whether this slice is allocated
514-
/// in this arena.
515-
#[inline]
516-
pub fn contains_slice<T>(&self, slice: &[T]) -> bool {
517-
for chunk in self.chunks.borrow_mut().iter_mut() {
518-
let ptr = slice.as_ptr().cast::<u8>().cast_mut();
519-
if chunk.start() <= ptr && chunk.end() >= ptr {
520-
return true;
521-
}
522-
}
523-
false
524-
}
525-
526513
/// Allocates a string slice that is copied into the `DroplessArena`, returning a
527514
/// reference to it. Will panic if passed an empty string.
528515
///

0 commit comments

Comments
 (0)