Allow ambiguous_wide_pointer_comparisons lint for std methods

This commit is contained in:
Urgau
2023-11-10 10:16:29 +01:00
parent 6856a86808
commit 30c7b18d25
4 changed files with 14 additions and 0 deletions

View File

@@ -1885,6 +1885,7 @@ pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usiz
#[inline(always)]
#[must_use = "pointer comparison produces a value"]
#[rustc_diagnostic_item = "ptr_eq"]
#[cfg_attr(not(bootstrap), allow(ambiguous_wide_pointer_comparisons))] // it's actually clear here
pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
a == b
}