We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c5fa777 commit 6beb4baCopy full SHA for 6beb4ba
src/libcollections/vec.rs
@@ -1322,9 +1322,11 @@ impl<T> Drop for Vec<T> {
1322
// OK because exactly when this stops being a valid assumption, we
1323
// don't need unsafe_no_drop_flag shenanigans anymore.
1324
if self.buf.unsafe_no_drop_flag_needs_drop() {
1325
- if unsafe { needs_drop::<T>() } {
1326
- for x in self.iter_mut() {
1327
- unsafe { drop_in_place(x); }
+ unsafe {
+ if needs_drop::<T>() {
+ for x in self.iter_mut() {
1328
+ drop_in_place(x);
1329
+ }
1330
}
1331
1332
0 commit comments