diff options
| author | bors <bors@rust-lang.org> | 2020-12-30 09:51:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-30 09:51:42 +0000 |
| commit | d107a87d34c1fc3521aaab7a2576ffbaf59cb2cb (patch) | |
| tree | a4ea1c022cc428edb66f77ac2661f5eb2e3aa227 /library/core | |
| parent | b9c403be11bef38638b38012be80444ad3f09dde (diff) | |
| parent | 3812909919bd8a2a65b825acbb27f9f7748f626d (diff) | |
| download | rust-d107a87d34c1fc3521aaab7a2576ffbaf59cb2cb.tar.gz rust-d107a87d34c1fc3521aaab7a2576ffbaf59cb2cb.zip | |
Auto merge of #80503 - JohnTitor:rollup-b26vglu, r=JohnTitor
Rollup of 13 pull requests Successful merges: - #79812 (Lint on redundant trailing semicolon after item) - #80348 (remove redundant clones (clippy::redundant_clone)) - #80358 (Edit rustc_span documentation) - #80457 (Add missing commas to `rustc_ast_pretty::pp` docs) - #80461 (Add llvm-libunwind change to bootstrap CHANGELOG) - #80464 (Use Option::map_or instead of open coding it) - #80465 (Fix typo in ffi-pure.md) - #80467 (More uses of the matches! macro) - #80469 (Fix small typo in time comment) - #80472 (Use sans-serif font for the "all items" page links) - #80477 (Make forget intrinsic safe) - #80482 (don't clone copy types) - #80487 (don't redundantly repeat field names) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/mem/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index e84014c68a6..87956787242 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -151,9 +151,14 @@ pub const fn forget<T>(t: T) { #[inline] #[unstable(feature = "forget_unsized", issue = "none")] pub fn forget_unsized<T: ?Sized>(t: T) { + #[cfg(bootstrap)] // SAFETY: the forget intrinsic could be safe, but there's no point in making it safe since // we'll be implementing this function soon via `ManuallyDrop` - unsafe { intrinsics::forget(t) } + unsafe { + intrinsics::forget(t) + } + #[cfg(not(bootstrap))] + intrinsics::forget(t) } /// Returns the size of a type in bytes. |
