Skip to content

Commit 7935931

Browse files
committed
get rid of real_drop_in_place again
1 parent fb4ac14 commit 7935931

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/libcore/ptr/mod.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,12 @@ mod mut_ptr;
169169
/// i.e., you do not usually have to worry about such issues unless you call `drop_in_place`
170170
/// manually.
171171
#[stable(feature = "drop_in_place", since = "1.8.0")]
172-
#[inline(always)]
173-
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
174-
real_drop_in_place(&mut *to_drop)
175-
}
176-
177-
// The real `drop_in_place` -- the one that gets called implicitly when variables go
178-
// out of scope -- should have a safe reference and not a raw pointer as argument
179-
// type. When we drop a local variable, we access it with a pointer that behaves
180-
// like a safe reference; transmuting that to a raw pointer does not mean we can
181-
// actually access it with raw pointers.
182172
#[lang = "drop_in_place"]
183173
#[allow(unconditional_recursion)]
184-
unsafe fn real_drop_in_place<T: ?Sized>(to_drop: &mut T) {
174+
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
185175
// Code here does not matter - this is replaced by the
186176
// real drop glue by the compiler.
187-
real_drop_in_place(to_drop)
177+
drop_in_place(to_drop)
188178
}
189179

190180
/// Creates a null raw pointer.

0 commit comments

Comments
 (0)