Fix clippy warning about no-op `mem::forget` call.
Clippy warning:
```
warning: calls to `std::mem::forget` with a value that implements `Copy`. Forgetting a copy leaves the original intact
--> third_party/crubit/support/ctor.rs:836:17
|
836 | ::core::mem::forget(drop_guard);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1322 | emplace! { let _my_struct = ctor!(MyStruct {});}
| ------------------ in this macro invocation
|
note: argument has type `()`
--> third_party/crubit/support/ctor.rs:836:37
|
836 | ::core::mem::forget(drop_guard);
| ^^^^^^^^^^
...
1322 | emplace! { let _my_struct = ctor!(MyStruct {});}
| ------------------ in this macro invocation
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_copy
= note: this warning originates in the macro `ctor` (in Nightly builds, run with -Z macro-backtrace for more info)
https://rust-lang.github.io/rust-clippy/master/index.html#forget_copy
```
The `drop_guard` is used in a macro to accumulate non-`Copy` things, but it was initialized, before this CL, to `()`. Initializing it to a non-`Copy` type silences the warning.
PiperOrigin-RevId: 513904055
diff --git a/support/ctor.rs b/support/ctor.rs
index 4c17e31..f79e014 100644
--- a/support/ctor.rs
+++ b/support/ctor.rs
@@ -792,7 +792,8 @@
$crate::FnCtor::new(|x: $crate::macro_internal::Pin<&mut $crate::macro_internal::MaybeUninit<Type>>| {
// Unused if Type is fieldless.
#[allow(unused_imports)] use ::std::ptr::addr_of_mut;
- let drop_guard = ();
+ struct DropGuard;
+ let drop_guard = DropGuard;
let x_mut = unsafe{$crate::macro_internal::Pin::into_inner_unchecked(x)}.as_mut_ptr();
let _ = &x_mut; // silence unused_variables warning if Type is fieldless.