Skip to content

Commit 444f54e

Browse files
committed
fix: TriviallyDrop::guard should be safe
Signed-off-by: Yaroslav Bolyukin <[email protected]>
1 parent aa4e896 commit 444f54e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gc/src/trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub trait Finalize {
2020
/// Ensures type has no custom Drop implementation, without implementing it itself
2121
/// In case of Drop implementation present, obscure compilation error will be raised
2222
pub unsafe trait TriviallyDrop {
23-
unsafe fn guard(self);
23+
fn guard(self);
2424
}
2525

2626
#[cfg(feature = "nightly")]

gc_derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn derive_trace(mut s: Structure<'_>) -> proc_macro2::TokenStream {
8484
let trivially_drop_impl = s.unsafe_bound_impl(
8585
quote!(::gc::TriviallyDrop),
8686
quote!(
87-
unsafe fn guard(self) {
87+
fn guard(self) {
8888
match self {
8989
#trivially_drop_body
9090
}

0 commit comments

Comments
 (0)