You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Calling std::mem::forget (or std::mem::drop) on a reference will forget (or drop) the reference itself, which effectively does nothing. The underlying reference value will remain unaffected.
Consider revisiting this function call. Perhaps you meant to call mem::forget (or mem::drop) on the underlying reference value instead.
Bad practice
l```
et x: Vec = Vec::with_capacity(10);
let y: String = String::new();
std::mem::forget(&x);
std::mem::drop(&y);
Recommended¨
let x: Vec = Vec::with_capacity(10);
let y: String = String::new();
std::mem::forget(x);
std::mem::drop(y);
Using drop with a reference at https://github.com/nitro/blob/master/arbitrator/arbutil/src/evm/req.rs#L118-L118
The text was updated successfully, but these errors were encountered:
Description
Calling std::mem::forget (or std::mem::drop) on a reference will forget (or drop) the reference itself, which effectively does nothing. The underlying reference value will remain unaffected.
Consider revisiting this function call. Perhaps you meant to call mem::forget (or mem::drop) on the underlying reference value instead.
Bad practice
l```
et x: Vec = Vec::with_capacity(10);
let y: String = String::new();
std::mem::forget(&x);
std::mem::drop(&y);
let x: Vec = Vec::with_capacity(10);
let y: String = String::new();
std::mem::forget(x);
std::mem::drop(y);
The text was updated successfully, but these errors were encountered: