Make std::mem::needs_drop accept ?Sized

This commit is contained in:
Nikolai Vazquez
2022-06-03 03:28:19 -04:00
parent 20ad820928
commit fd38f663cd
6 changed files with 18 additions and 4 deletions

View File

@@ -592,7 +592,7 @@ pub const unsafe fn align_of_val_raw<T: ?Sized>(val: *const T) -> usize {
#[stable(feature = "needs_drop", since = "1.21.0")]
#[rustc_const_stable(feature = "const_mem_needs_drop", since = "1.36.0")]
#[rustc_diagnostic_item = "needs_drop"]
pub const fn needs_drop<T>() -> bool {
pub const fn needs_drop<T: ?Sized>() -> bool {
intrinsics::needs_drop::<T>()
}