Halloween... time to get rid of 👻
This commit is contained in:
parent
02f9167f94
commit
954fc71962
3 changed files with 19 additions and 15 deletions
|
@ -426,10 +426,10 @@ impl TypeId {
|
|||
#[rustc_const_unstable(feature="const_type_id")]
|
||||
pub const fn of<T: ?Sized + 'static>() -> TypeId {
|
||||
TypeId {
|
||||
#[cfg(boostrap_stdarch_ignore_this)]
|
||||
#[cfg(bootstrap)]
|
||||
// SAFETY: going away soon
|
||||
t: unsafe { intrinsics::type_id::<T>() },
|
||||
#[cfg(not(boostrap_stdarch_ignore_this))]
|
||||
#[cfg(not(bootstrap))]
|
||||
t: intrinsics::type_id::<T>(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,15 +517,19 @@ impl<I> Iterator for StepBy<I> where I: Iterator {
|
|||
// overflow handling
|
||||
loop {
|
||||
let mul = n.checked_mul(step);
|
||||
#[cfg(boostrap_stdarch_ignore_this)]
|
||||
#[cfg(bootstrap)]
|
||||
{
|
||||
// SAFETY: going away soon
|
||||
if unsafe { intrinsics::likely(mul.is_some()) } {
|
||||
return self.iter.nth(mul.unwrap() - 1);
|
||||
}
|
||||
#[cfg(not(boostrap_stdarch_ignore_this))]
|
||||
}
|
||||
#[cfg(not(bootstrap))]
|
||||
{
|
||||
if intrinsics::likely(mul.is_some()) {
|
||||
return self.iter.nth(mul.unwrap() - 1);
|
||||
}
|
||||
}
|
||||
let div_n = usize::MAX / n;
|
||||
let div_step = usize::MAX / step;
|
||||
let nth_n = div_n * n;
|
||||
|
|
|
@ -268,10 +268,10 @@ pub const fn size_of<T>() -> usize {
|
|||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn size_of_val<T: ?Sized>(val: &T) -> usize {
|
||||
#[cfg(boostrap_stdarch_ignore_this)]
|
||||
#[cfg(bootstrap)]
|
||||
// SAFETY: going away soon
|
||||
unsafe { intrinsics::size_of_val(val) }
|
||||
#[cfg(not(boostrap_stdarch_ignore_this))]
|
||||
#[cfg(not(bootstrap))]
|
||||
intrinsics::size_of_val(val)
|
||||
}
|
||||
|
||||
|
@ -316,10 +316,10 @@ pub fn min_align_of<T>() -> usize {
|
|||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_deprecated(reason = "use `align_of_val` instead", since = "1.2.0")]
|
||||
pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
|
||||
#[cfg(boostrap_stdarch_ignore_this)]
|
||||
#[cfg(bootstrap)]
|
||||
// SAFETY: going away soon
|
||||
unsafe { intrinsics::min_align_of_val(val) }
|
||||
#[cfg(not(boostrap_stdarch_ignore_this))]
|
||||
#[cfg(not(bootstrap))]
|
||||
intrinsics::min_align_of_val(val)
|
||||
}
|
||||
|
||||
|
@ -834,11 +834,11 @@ impl<T> fmt::Debug for Discriminant<T> {
|
|||
/// ```
|
||||
#[stable(feature = "discriminant_value", since = "1.21.0")]
|
||||
pub fn discriminant<T>(v: &T) -> Discriminant<T> {
|
||||
#[cfg(boostrap_stdarch_ignore_this)]
|
||||
#[cfg(bootstrap)]
|
||||
// SAFETY: going away soon
|
||||
unsafe {
|
||||
Discriminant(intrinsics::discriminant_value(v), PhantomData)
|
||||
}
|
||||
#[cfg(not(boostrap_stdarch_ignore_this))]
|
||||
#[cfg(not(bootstrap))]
|
||||
Discriminant(intrinsics::discriminant_value(v), PhantomData)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue