Deprecate items that accidentally weren't deprecated

Fixes #82080
This commit is contained in:
bstrie 2021-02-14 16:42:38 -05:00
parent 3a5d45f68c
commit 49aa79ec11
22 changed files with 68 additions and 63 deletions

View File

@ -65,9 +65,13 @@ use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, O
#[stable(feature = "drop_in_place", since = "1.8.0")] #[stable(feature = "drop_in_place", since = "1.8.0")]
#[rustc_deprecated( #[rustc_deprecated(
reason = "no longer an intrinsic - use `ptr::drop_in_place` directly", reason = "no longer an intrinsic - use `ptr::drop_in_place` directly",
since = "1.18.0" since = "1.52.0"
)] )]
pub use crate::ptr::drop_in_place; #[inline]
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
// SAFETY: see `ptr::drop_in_place`
unsafe { crate::ptr::drop_in_place(to_drop) }
}
extern "rust-intrinsic" { extern "rust-intrinsic" {
// N.B., these intrinsics take raw pointers because they mutate aliased // N.B., these intrinsics take raw pointers because they mutate aliased

View File

@ -401,9 +401,10 @@
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(reason = "moved to `std::ops::Bound`", since = "1.26.0")] #[rustc_deprecated(reason = "moved to `std::ops::Bound`", since = "1.52.0")]
#[doc(hidden)] #[doc(hidden)]
pub use crate::ops::Bound; pub type Bound<T> = crate::ops::Bound<T>;
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub use alloc_crate::collections::{binary_heap, btree_map, btree_set}; pub use alloc_crate::collections::{binary_heap, btree_map, btree_set};
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]

View File

@ -4,7 +4,7 @@
#![feature(start)] #![feature(start)]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDtor> - shim(Some(StructWithDtor)) @@ drop_in_place_intrinsic-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDtor> - shim(Some(StructWithDtor)) @@ drop_in_place_intrinsic-cgu.0[Internal]
struct StructWithDtor(u32); struct StructWithDtor(u32);
impl Drop for StructWithDtor { impl Drop for StructWithDtor {
@ -16,7 +16,7 @@ impl Drop for StructWithDtor {
#[start] #[start]
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<[StructWithDtor; 2]> - shim(Some([StructWithDtor; 2])) @@ drop_in_place_intrinsic-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<[StructWithDtor; 2]> - shim(Some([StructWithDtor; 2])) @@ drop_in_place_intrinsic-cgu.0[Internal]
let x = [StructWithDtor(0), StructWithDtor(1)]; let x = [StructWithDtor(0), StructWithDtor(1)];
drop_slice_in_place(&x); drop_slice_in_place(&x);
@ -30,7 +30,7 @@ fn drop_slice_in_place(x: &[StructWithDtor]) {
// This is the interesting thing in this test case: Normally we would // This is the interesting thing in this test case: Normally we would
// not have drop-glue for the unsized [StructWithDtor]. This has to be // not have drop-glue for the unsized [StructWithDtor]. This has to be
// generated though when the drop_in_place() intrinsic is used. // generated though when the drop_in_place() intrinsic is used.
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<[StructWithDtor]> - shim(Some([StructWithDtor])) @@ drop_in_place_intrinsic-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<[StructWithDtor]> - shim(Some([StructWithDtor])) @@ drop_in_place_intrinsic-cgu.0[Internal]
::std::intrinsics::drop_in_place(x as *const _ as *mut [StructWithDtor]); ::std::ptr::drop_in_place(x as *const _ as *mut [StructWithDtor]);
} }
} }

View File

@ -37,7 +37,7 @@ enum EnumNoDrop<T1, T2> {
struct NonGenericNoDrop(i32); struct NonGenericNoDrop(i32);
struct NonGenericWithDrop(i32); struct NonGenericWithDrop(i32);
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<NonGenericWithDrop> - shim(Some(NonGenericWithDrop)) @@ generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<NonGenericWithDrop> - shim(Some(NonGenericWithDrop)) @@ generic_drop_glue-cgu.0[Internal]
impl Drop for NonGenericWithDrop { impl Drop for NonGenericWithDrop {
//~ MONO_ITEM fn <NonGenericWithDrop as std::ops::Drop>::drop //~ MONO_ITEM fn <NonGenericWithDrop as std::ops::Drop>::drop
@ -47,11 +47,11 @@ impl Drop for NonGenericWithDrop {
//~ MONO_ITEM fn start //~ MONO_ITEM fn start
#[start] #[start]
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDrop<i8, char>> - shim(Some(StructWithDrop<i8, char>)) @@ generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop<i8, char>> - shim(Some(StructWithDrop<i8, char>)) @@ generic_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn <StructWithDrop<i8, char> as std::ops::Drop>::drop //~ MONO_ITEM fn <StructWithDrop<i8, char> as std::ops::Drop>::drop
let _ = StructWithDrop { x: 0i8, y: 'a' }.x; let _ = StructWithDrop { x: 0i8, y: 'a' }.x;
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDrop<&str, NonGenericNoDrop>> - shim(Some(StructWithDrop<&str, NonGenericNoDrop>)) @@ generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop<&str, NonGenericNoDrop>> - shim(Some(StructWithDrop<&str, NonGenericNoDrop>)) @@ generic_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn <StructWithDrop<&str, NonGenericNoDrop> as std::ops::Drop>::drop //~ MONO_ITEM fn <StructWithDrop<&str, NonGenericNoDrop> as std::ops::Drop>::drop
let _ = StructWithDrop { x: "&str", y: NonGenericNoDrop(0) }.y; let _ = StructWithDrop { x: "&str", y: NonGenericNoDrop(0) }.y;
@ -60,17 +60,17 @@ fn start(_: isize, _: *const *const u8) -> isize {
// This is supposed to generate drop-glue because it contains a field that // This is supposed to generate drop-glue because it contains a field that
// needs to be dropped. // needs to be dropped.
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructNoDrop<NonGenericWithDrop, f64>> - shim(Some(StructNoDrop<NonGenericWithDrop, f64>)) @@ generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<StructNoDrop<NonGenericWithDrop, f64>> - shim(Some(StructNoDrop<NonGenericWithDrop, f64>)) @@ generic_drop_glue-cgu.0[Internal]
let _ = StructNoDrop { x: NonGenericWithDrop(0), y: 0f64 }.y; let _ = StructNoDrop { x: NonGenericWithDrop(0), y: 0f64 }.y;
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<EnumWithDrop<i32, i64>> - shim(Some(EnumWithDrop<i32, i64>)) @@ generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<EnumWithDrop<i32, i64>> - shim(Some(EnumWithDrop<i32, i64>)) @@ generic_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn <EnumWithDrop<i32, i64> as std::ops::Drop>::drop //~ MONO_ITEM fn <EnumWithDrop<i32, i64> as std::ops::Drop>::drop
let _ = match EnumWithDrop::A::<i32, i64>(0) { let _ = match EnumWithDrop::A::<i32, i64>(0) {
EnumWithDrop::A(x) => x, EnumWithDrop::A(x) => x,
EnumWithDrop::B(x) => x as i32 EnumWithDrop::B(x) => x as i32
}; };
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<EnumWithDrop<f64, f32>> - shim(Some(EnumWithDrop<f64, f32>)) @@ generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<EnumWithDrop<f64, f32>> - shim(Some(EnumWithDrop<f64, f32>)) @@ generic_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn <EnumWithDrop<f64, f32> as std::ops::Drop>::drop //~ MONO_ITEM fn <EnumWithDrop<f64, f32> as std::ops::Drop>::drop
let _ = match EnumWithDrop::B::<f64, f32>(1.0) { let _ = match EnumWithDrop::B::<f64, f32>(1.0) {
EnumWithDrop::A(x) => x, EnumWithDrop::A(x) => x,

View File

@ -23,13 +23,13 @@ impl<T> Trait for Struct<T> {
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
let s1 = Struct { _a: 0u32 }; let s1 = Struct { _a: 0u32 };
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Struct<u32>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u32>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal]
//~ MONO_ITEM fn <Struct<u32> as Trait>::foo //~ MONO_ITEM fn <Struct<u32> as Trait>::foo
//~ MONO_ITEM fn <Struct<u32> as Trait>::bar //~ MONO_ITEM fn <Struct<u32> as Trait>::bar
let _ = &s1 as &Trait; let _ = &s1 as &Trait;
let s1 = Struct { _a: 0u64 }; let s1 = Struct { _a: 0u64 };
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Struct<u64>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<Struct<u64>> - shim(None) @@ instantiation_through_vtable-cgu.0[Internal]
//~ MONO_ITEM fn <Struct<u64> as Trait>::foo //~ MONO_ITEM fn <Struct<u64> as Trait>::foo
//~ MONO_ITEM fn <Struct<u64> as Trait>::bar //~ MONO_ITEM fn <Struct<u64> as Trait>::bar
let _ = &s1 as &Trait; let _ = &s1 as &Trait;

View File

@ -5,7 +5,7 @@
#![deny(dead_code)] #![deny(dead_code)]
#![feature(start)] #![feature(start)]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<StructWithDrop> - shim(Some(StructWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop> - shim(Some(StructWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal]
struct StructWithDrop { struct StructWithDrop {
x: i32 x: i32
} }
@ -19,7 +19,7 @@ struct StructNoDrop {
x: i32 x: i32
} }
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<EnumWithDrop> - shim(Some(EnumWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<EnumWithDrop> - shim(Some(EnumWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal]
enum EnumWithDrop { enum EnumWithDrop {
A(i32) A(i32)
} }

View File

@ -5,11 +5,11 @@
#![deny(dead_code)] #![deny(dead_code)]
#![feature(start)] #![feature(start)]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Root> - shim(Some(Root)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<Root> - shim(Some(Root)) @@ transitive_drop_glue-cgu.0[Internal]
struct Root(Intermediate); struct Root(Intermediate);
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Intermediate> - shim(Some(Intermediate)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<Intermediate> - shim(Some(Intermediate)) @@ transitive_drop_glue-cgu.0[Internal]
struct Intermediate(Leaf); struct Intermediate(Leaf);
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Leaf> - shim(Some(Leaf)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<Leaf> - shim(Some(Leaf)) @@ transitive_drop_glue-cgu.0[Internal]
struct Leaf; struct Leaf;
impl Drop for Leaf { impl Drop for Leaf {
@ -30,15 +30,15 @@ impl<T> Drop for LeafGen<T> {
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
let _ = Root(Intermediate(Leaf)); let _ = Root(Intermediate(Leaf));
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<RootGen<u32>> - shim(Some(RootGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<RootGen<u32>> - shim(Some(RootGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<IntermediateGen<u32>> - shim(Some(IntermediateGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<IntermediateGen<u32>> - shim(Some(IntermediateGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<LeafGen<u32>> - shim(Some(LeafGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<LeafGen<u32>> - shim(Some(LeafGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn <LeafGen<u32> as std::ops::Drop>::drop //~ MONO_ITEM fn <LeafGen<u32> as std::ops::Drop>::drop
let _ = RootGen(IntermediateGen(LeafGen(0u32))); let _ = RootGen(IntermediateGen(LeafGen(0u32)));
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<RootGen<i16>> - shim(Some(RootGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<RootGen<i16>> - shim(Some(RootGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<IntermediateGen<i16>> - shim(Some(IntermediateGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<IntermediateGen<i16>> - shim(Some(IntermediateGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<LeafGen<i16>> - shim(Some(LeafGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<LeafGen<i16>> - shim(Some(LeafGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn <LeafGen<i16> as std::ops::Drop>::drop //~ MONO_ITEM fn <LeafGen<i16> as std::ops::Drop>::drop
let _ = RootGen(IntermediateGen(LeafGen(0i16))); let _ = RootGen(IntermediateGen(LeafGen(0i16)));

View File

@ -5,7 +5,7 @@
#![deny(dead_code)] #![deny(dead_code)]
#![feature(start)] #![feature(start)]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Dropped> - shim(Some(Dropped)) @@ tuple_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<Dropped> - shim(Some(Dropped)) @@ tuple_drop_glue-cgu.0[Internal]
struct Dropped; struct Dropped;
impl Drop for Dropped { impl Drop for Dropped {
@ -16,11 +16,11 @@ impl Drop for Dropped {
//~ MONO_ITEM fn start //~ MONO_ITEM fn start
#[start] #[start]
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<(u32, Dropped)> - shim(Some((u32, Dropped))) @@ tuple_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<(u32, Dropped)> - shim(Some((u32, Dropped))) @@ tuple_drop_glue-cgu.0[Internal]
let x = (0u32, Dropped); let x = (0u32, Dropped);
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<(i16, (Dropped, bool))> - shim(Some((i16, (Dropped, bool)))) @@ tuple_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<(i16, (Dropped, bool))> - shim(Some((i16, (Dropped, bool)))) @@ tuple_drop_glue-cgu.0[Internal]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<(Dropped, bool)> - shim(Some((Dropped, bool))) @@ tuple_drop_glue-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<(Dropped, bool)> - shim(Some((Dropped, bool))) @@ tuple_drop_glue-cgu.0[Internal]
let x = (0i16, (Dropped, true)); let x = (0i16, (Dropped, true));
0 0

View File

@ -48,13 +48,13 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Wrapper<U>> for Wrapper<T>
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
// simple case // simple case
let bool_sized = &true; let bool_sized = &true;
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<bool> - shim(None) @@ unsizing-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<bool> - shim(None) @@ unsizing-cgu.0[Internal]
//~ MONO_ITEM fn <bool as Trait>::foo //~ MONO_ITEM fn <bool as Trait>::foo
let _bool_unsized = bool_sized as &Trait; let _bool_unsized = bool_sized as &Trait;
let char_sized = &'a'; let char_sized = &'a';
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<char> - shim(None) @@ unsizing-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<char> - shim(None) @@ unsizing-cgu.0[Internal]
//~ MONO_ITEM fn <char as Trait>::foo //~ MONO_ITEM fn <char as Trait>::foo
let _char_unsized = char_sized as &Trait; let _char_unsized = char_sized as &Trait;
@ -64,13 +64,13 @@ fn start(_: isize, _: *const *const u8) -> isize {
_b: 2, _b: 2,
_c: 3.0f64 _c: 3.0f64
}; };
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<f64> - shim(None) @@ unsizing-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<f64> - shim(None) @@ unsizing-cgu.0[Internal]
//~ MONO_ITEM fn <f64 as Trait>::foo //~ MONO_ITEM fn <f64 as Trait>::foo
let _struct_unsized = struct_sized as &Struct<Trait>; let _struct_unsized = struct_sized as &Struct<Trait>;
// custom coercion // custom coercion
let wrapper_sized = Wrapper(&0u32); let wrapper_sized = Wrapper(&0u32);
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<u32> - shim(None) @@ unsizing-cgu.0[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<u32> - shim(None) @@ unsizing-cgu.0[Internal]
//~ MONO_ITEM fn <u32 as Trait>::foo //~ MONO_ITEM fn <u32 as Trait>::foo
let _wrapper_sized = wrapper_sized as Wrapper<Trait>; let _wrapper_sized = wrapper_sized as Wrapper<Trait>;

View File

@ -12,13 +12,13 @@
// aux-build:cgu_extern_drop_glue.rs // aux-build:cgu_extern_drop_glue.rs
extern crate cgu_extern_drop_glue; extern crate cgu_extern_drop_glue;
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<cgu_extern_drop_glue::Struct> - shim(Some(cgu_extern_drop_glue::Struct)) @@ extern_drop_glue-fallback.cgu[External] //~ MONO_ITEM fn std::ptr::drop_in_place::<cgu_extern_drop_glue::Struct> - shim(Some(cgu_extern_drop_glue::Struct)) @@ extern_drop_glue-fallback.cgu[External]
struct LocalStruct(cgu_extern_drop_glue::Struct); struct LocalStruct(cgu_extern_drop_glue::Struct);
//~ MONO_ITEM fn user @@ extern_drop_glue[External] //~ MONO_ITEM fn user @@ extern_drop_glue[External]
pub fn user() { pub fn user() {
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<LocalStruct> - shim(Some(LocalStruct)) @@ extern_drop_glue-fallback.cgu[External] //~ MONO_ITEM fn std::ptr::drop_in_place::<LocalStruct> - shim(Some(LocalStruct)) @@ extern_drop_glue-fallback.cgu[External]
let _ = LocalStruct(cgu_extern_drop_glue::Struct(0)); let _ = LocalStruct(cgu_extern_drop_glue::Struct(0));
} }
@ -29,7 +29,7 @@ pub mod mod1 {
//~ MONO_ITEM fn mod1::user @@ extern_drop_glue-mod1[External] //~ MONO_ITEM fn mod1::user @@ extern_drop_glue-mod1[External]
pub fn user() { pub fn user() {
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<mod1::LocalStruct> - shim(Some(mod1::LocalStruct)) @@ extern_drop_glue-fallback.cgu[External] //~ MONO_ITEM fn std::ptr::drop_in_place::<mod1::LocalStruct> - shim(Some(mod1::LocalStruct)) @@ extern_drop_glue-fallback.cgu[External]
let _ = LocalStruct(cgu_extern_drop_glue::Struct(0)); let _ = LocalStruct(cgu_extern_drop_glue::Struct(0));
} }
} }

View File

@ -8,7 +8,7 @@
#![allow(dead_code)] #![allow(dead_code)]
#![crate_type = "rlib"] #![crate_type = "rlib"]
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Struct> - shim(Some(Struct)) @@ local_drop_glue-fallback.cgu[External] //~ MONO_ITEM fn std::ptr::drop_in_place::<Struct> - shim(Some(Struct)) @@ local_drop_glue-fallback.cgu[External]
struct Struct { struct Struct {
_a: u32, _a: u32,
} }
@ -18,7 +18,7 @@ impl Drop for Struct {
fn drop(&mut self) {} fn drop(&mut self) {}
} }
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<Outer> - shim(Some(Outer)) @@ local_drop_glue-fallback.cgu[External] //~ MONO_ITEM fn std::ptr::drop_in_place::<Outer> - shim(Some(Outer)) @@ local_drop_glue-fallback.cgu[External]
struct Outer { struct Outer {
_a: Struct, _a: Struct,
} }
@ -31,10 +31,10 @@ pub fn user() {
pub mod mod1 { pub mod mod1 {
use super::Struct; use super::Struct;
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<mod1::Struct2> - shim(Some(mod1::Struct2)) @@ local_drop_glue-fallback.cgu[External] //~ MONO_ITEM fn std::ptr::drop_in_place::<mod1::Struct2> - shim(Some(mod1::Struct2)) @@ local_drop_glue-fallback.cgu[External]
struct Struct2 { struct Struct2 {
_a: Struct, _a: Struct,
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<(u32, Struct)> - shim(Some((u32, Struct))) @@ local_drop_glue-fallback.cgu[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<(u32, Struct)> - shim(Some((u32, Struct))) @@ local_drop_glue-fallback.cgu[Internal]
_b: (u32, Struct), _b: (u32, Struct),
} }

View File

@ -66,7 +66,7 @@ mod mod1 {
//~ MONO_ITEM fn start //~ MONO_ITEM fn start
#[start] #[start]
fn start(_: isize, _: *const *const u8) -> isize { fn start(_: isize, _: *const *const u8) -> isize {
//~ MONO_ITEM fn std::intrinsics::drop_in_place::<u32> - shim(None) @@ vtable_through_const[Internal] //~ MONO_ITEM fn std::ptr::drop_in_place::<u32> - shim(None) @@ vtable_through_const[Internal]
// Since Trait1::do_something() is instantiated via its default implementation, // Since Trait1::do_something() is instantiated via its default implementation,
// it is considered a generic and is instantiated here only because it is // it is considered a generic and is instantiated here only because it is

View File

@ -21,7 +21,7 @@ pub fn droppy() {
// regular function exit. We used to have problems with quadratic growths of drop calls in such // regular function exit. We used to have problems with quadratic growths of drop calls in such
// functions. // functions.
// FIXME(eddyb) the `void @` forces a match on the instruction, instead of the // FIXME(eddyb) the `void @` forces a match on the instruction, instead of the
// comment, that's `; call core::intrinsics::drop_in_place::<drop::SomeUniqueName>` // comment, that's `; call core::ptr::drop_in_place::<drop::SomeUniqueName>`
// for the `v0` mangling, should switch to matching on that once `legacy` is gone. // for the `v0` mangling, should switch to matching on that once `legacy` is gone.
// CHECK-NOT: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK-NOT: call void @{{.*}}drop_in_place{{.*}}SomeUniqueName
// CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName // CHECK: invoke void @{{.*}}drop_in_place{{.*}}SomeUniqueName

View File

@ -11,7 +11,7 @@
scope 1 { scope 1 {
} }
scope 2 { scope 2 {
+ scope 3 (inlined drop_in_place::<Option<B>> - shim(Some(Option<B>))) { // at $DIR/inline-shims.rs:12:14: 12:40 + scope 3 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { // at $DIR/inline-shims.rs:12:14: 12:40
+ let mut _6: isize; // in scope 3 at $DIR/inline-shims.rs:12:14: 12:40 + let mut _6: isize; // in scope 3 at $DIR/inline-shims.rs:12:14: 12:40
+ let mut _7: isize; // in scope 3 at $DIR/inline-shims.rs:12:14: 12:40 + let mut _7: isize; // in scope 3 at $DIR/inline-shims.rs:12:14: 12:40
+ } + }
@ -21,10 +21,10 @@
StorageLive(_3); // scope 0 at $DIR/inline-shims.rs:11:5: 11:42 StorageLive(_3); // scope 0 at $DIR/inline-shims.rs:11:5: 11:42
StorageLive(_4); // scope 1 at $DIR/inline-shims.rs:11:38: 11:39 StorageLive(_4); // scope 1 at $DIR/inline-shims.rs:11:38: 11:39
_4 = _1; // scope 1 at $DIR/inline-shims.rs:11:38: 11:39 _4 = _1; // scope 1 at $DIR/inline-shims.rs:11:38: 11:39
_3 = drop_in_place::<Vec<A>>(move _4) -> bb1; // scope 1 at $DIR/inline-shims.rs:11:14: 11:40 _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> bb1; // scope 1 at $DIR/inline-shims.rs:11:14: 11:40
// mir::Constant // mir::Constant
// + span: $DIR/inline-shims.rs:11:14: 11:37 // + span: $DIR/inline-shims.rs:11:14: 11:37
// + literal: Const { ty: unsafe fn(*mut std::vec::Vec<A>) {std::intrinsics::drop_in_place::<std::vec::Vec<A>>}, val: Value(Scalar(<ZST>)) } // + literal: Const { ty: unsafe fn(*mut std::vec::Vec<A>) {std::ptr::drop_in_place::<std::vec::Vec<A>>}, val: Value(Scalar(<ZST>)) }
} }
bb1: { bb1: {
@ -32,10 +32,10 @@
StorageDead(_3); // scope 0 at $DIR/inline-shims.rs:11:41: 11:42 StorageDead(_3); // scope 0 at $DIR/inline-shims.rs:11:41: 11:42
StorageLive(_5); // scope 2 at $DIR/inline-shims.rs:12:38: 12:39 StorageLive(_5); // scope 2 at $DIR/inline-shims.rs:12:38: 12:39
_5 = _2; // scope 2 at $DIR/inline-shims.rs:12:38: 12:39 _5 = _2; // scope 2 at $DIR/inline-shims.rs:12:38: 12:39
- _0 = drop_in_place::<Option<B>>(move _5) -> bb2; // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 - _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> bb2; // scope 2 at $DIR/inline-shims.rs:12:14: 12:40
- // mir::Constant - // mir::Constant
- // + span: $DIR/inline-shims.rs:12:14: 12:37 - // + span: $DIR/inline-shims.rs:12:14: 12:37
- // + literal: Const { ty: unsafe fn(*mut std::option::Option<B>) {std::intrinsics::drop_in_place::<std::option::Option<B>>}, val: Value(Scalar(<ZST>)) } - // + literal: Const { ty: unsafe fn(*mut std::option::Option<B>) {std::ptr::drop_in_place::<std::option::Option<B>>}, val: Value(Scalar(<ZST>)) }
+ StorageLive(_6); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 + StorageLive(_6); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40
+ StorageLive(_7); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40 + StorageLive(_7); // scope 2 at $DIR/inline-shims.rs:12:14: 12:40
+ _6 = discriminant((*_5)); // scope 3 at $DIR/inline-shims.rs:12:14: 12:40 + _6 = discriminant((*_5)); // scope 3 at $DIR/inline-shims.rs:12:14: 12:40

View File

@ -1,6 +1,6 @@
// MIR for `drop_in_place` after SimplifyCfg-make_shim // MIR for `std::ptr::drop_in_place` after SimplifyCfg-make_shim
fn drop_in_place(_1: *mut Test) -> () { fn std::ptr::drop_in_place(_1: *mut Test) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: &mut Test; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View File

@ -1,6 +1,6 @@
// MIR for `drop_in_place` before AddMovesForPackedDrops // MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn drop_in_place(_1: *mut [String]) -> () { fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View File

@ -1,6 +1,6 @@
// MIR for `drop_in_place` before AddMovesForPackedDrops // MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn drop_in_place(_1: *mut [String]) -> () { fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View File

@ -1,6 +1,6 @@
// MIR for `drop_in_place` before AddMovesForPackedDrops // MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn drop_in_place(_1: *mut Vec<i32>) -> () { fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View File

@ -1,6 +1,6 @@
// MIR for `drop_in_place` before AddMovesForPackedDrops // MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn drop_in_place(_1: *mut Vec<i32>) -> () { fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View File

@ -5,7 +5,7 @@ LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | | |
| calling non-const function `<Vec<i32> as Drop>::drop` | calling non-const function `<Vec<i32> as Drop>::drop`
| inside `drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL | inside `std::ptr::drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
| |
::: $DIR/drop.rs:18:1 ::: $DIR/drop.rs:18:1
| |

View File

@ -1,10 +1,10 @@
error: reached the recursion limit while instantiating `drop_in_place::<S<fn(fn(fn(fn(fn...)))))))))))))))))))))))))))))>))` error: reached the recursion limit while instantiating `std::ptr::drop_in_place::<S<fn(f...)))))))))))))))))))))))))))))>))`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
| |
LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: `drop_in_place` defined here note: `std::ptr::drop_in_place` defined here
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
| |
LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {

View File

@ -27,7 +27,7 @@ use rustc_span::source_map::{Span, Spanned};
use rustc_span::sym; use rustc_span::sym;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;
use std::collections::Bound; use std::ops::Bound;
declare_clippy_lint! { declare_clippy_lint! {
/// **What it does:** Checks for matches with a single arm where an `if let` /// **What it does:** Checks for matches with a single arm where an `if let`