Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
strict_provenance_lints
)
)]
#![cfg_attr(feature = "nightly", warn(fuzzy_provenance_casts))]
#![cfg_attr(feature = "nightly", warn(implicit_provenance_casts))]
#![cfg_attr(feature = "rustc-dep-of-std", feature(rustc_attrs))]
#![cfg_attr(feature = "nightly", expect(internal_features))]
#![cfg_attr(
Expand Down
6 changes: 3 additions & 3 deletions src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl<T> Bucket<T> {
// where: T0...Tlast - our stored data; C0...Clast - control bytes or metadata for data.
if T::IS_ZERO_SIZED {
// this can not be UB
self.ptr.as_ptr() as usize - 1
self.ptr.as_ptr().addr() - 1
} else {
unsafe { offset_from(base.as_ptr(), self.ptr.as_ptr()) }
}
Expand Down Expand Up @@ -462,7 +462,7 @@ impl<T> Bucket<T> {
unsafe fn next_n(&self, offset: usize) -> Self {
let ptr = if T::IS_ZERO_SIZED {
// invalid pointer is good enough for ZST
invalid_mut(self.ptr.as_ptr() as usize + offset)
invalid_mut(self.ptr.as_ptr().addr() + offset)
} else {
unsafe { self.ptr.as_ptr().sub(offset) }
};
Expand Down Expand Up @@ -3577,7 +3577,7 @@ impl<T> RawIterRange<T> {
#[cfg_attr(feature = "inline-more", inline)]
unsafe fn new(ctrl: *const u8, data: Bucket<T>, len: usize) -> Self {
debug_assert_ne!(len, 0);
debug_assert_eq!(ctrl as usize % Group::WIDTH, 0);
debug_assert!(ctrl.cast::<Group>().is_aligned());
// SAFETY: The caller must uphold the safety rules for the [`RawIterRange::new`]
let end = unsafe { ctrl.add(len) };

Expand Down
Loading