Skip to content

Commit 9a6e3b9

Browse files
committed
Add doc to core::intrinsics pointing out conservativeness of needs_drop.
1 parent 4e334d6 commit 9a6e3b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libcore/intrinsics.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ extern "rust-intrinsic" {
241241
/// will trigger a compiler error.
242242
pub fn return_address() -> *const u8;
243243

244-
/// Returns `true` if a type requires drop glue.
244+
/// Returns `true` if the actual type given as `T` requires drop
245+
/// glue; returns `false` if the actual type provided for `T`
246+
/// implements `Copy`.
247+
///
248+
/// If the actual type neither requires drop glue nor implements
249+
/// `Copy`, then may return `true` or `false`.
245250
pub fn needs_drop<T>() -> bool;
246251

247252
/// Returns `true` if a type is managed (will be allocated on the local heap)

0 commit comments

Comments
 (0)