Fix some unsizing problems in mir

This commit is contained in:
hkalbasi 2023-06-26 01:57:12 +03:30
parent 5eb4796d3d
commit 6d2d1387af
5 changed files with 135 additions and 51 deletions

View file

@ -37,6 +37,7 @@
//! iterator: option
//! iterators: iterator, fn
//! manually_drop: drop
//! non_null:
//! non_zero:
//! option: panic
//! ord: eq, option
@ -386,6 +387,19 @@ pub mod ptr {
type Metadata;
}
// endregion:pointee
// region:non_null
#[rustc_layout_scalar_valid_range_start(1)]
#[rustc_nonnull_optimization_guaranteed]
pub struct NonNull<T: ?Sized> {
pointer: *const T,
}
// region:coerce_unsized
impl<T: ?Sized, U: ?Sized> crate::ops::CoerceUnsized<NonNull<U>> for NonNull<T> where
T: crate::marker::Unsize<U>
{
}
// endregion:coerce_unsized
// endregion:non_null
}
pub mod ops {