Closed
Description
The following code uses a redundant unsafe
block inside a closure.
This is a warning on stable but there is no warning on nightly.
To reproduce (playground):
fn main() {
let mut v = Vec::<i32>::with_capacity(24);
unsafe {
let f = |v: &mut Vec<_>| {
unsafe {
v.set_len(24);
}
};
v.set_len(0);
f(&mut v);
}
}