File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,6 @@ where
104
104
105
105
let mut result = Array :: maybe_uninit ( self . dim ( ) ) ;
106
106
107
- // panic-critical begin: we must not panic
108
107
unsafe {
109
108
// logically move ownership of all elements from self into result
110
109
// the result realizes this ownership at .assume_init() further down
@@ -118,15 +117,16 @@ where
118
117
moved_elements += 1 ;
119
118
} ) ;
120
119
}
120
+ debug_assert_eq ! ( result. len( ) , moved_elements) ;
121
+ // panic-critical begin: we must not panic
121
122
// forget moved array elements but not its vec
122
123
// old_storage drops empty
123
124
let mut old_storage = self . into_raw_vec ( ) ;
124
125
old_storage. set_len ( 0 ) ;
125
126
126
- debug_assert_eq ! ( result. len( ) , moved_elements) ;
127
127
result. assume_init ( )
128
+ // panic-critical end
128
129
}
129
- // panic-critical end
130
130
}
131
131
}
132
132
You can’t perform that action at this time.
0 commit comments