Skip to content

Commit 646f16d

Browse files
committed
core: Make intrinsics::init unsafe
as per rust-lang#3920
1 parent f547a67 commit 646f16d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libcore/unstable/intrinsics.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ pub extern "rust-intrinsic" {
4242

4343
pub fn get_tydesc<T>() -> *();
4444

45-
pub fn init<T>() -> T;
45+
/// init is unsafe because it returns a zeroed-out datum,
46+
/// which is unsafe unless T is POD. We don't have a POD
47+
/// kind yet. (See #4074)
48+
pub unsafe fn init<T>() -> T;
4649

4750
#[cfg(not(stage0))]
4851
pub unsafe fn uninit<T>() -> T;

0 commit comments

Comments
 (0)