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
104104
105105 let mut result = Array :: maybe_uninit ( self . dim ( ) ) ;
106106
107- // panic-critical begin: we must not panic
108107 unsafe {
109108 // logically move ownership of all elements from self into result
110109 // the result realizes this ownership at .assume_init() further down
@@ -118,15 +117,16 @@ where
118117 moved_elements += 1 ;
119118 } ) ;
120119 }
120+ debug_assert_eq ! ( result. len( ) , moved_elements) ;
121+ // panic-critical begin: we must not panic
121122 // forget moved array elements but not its vec
122123 // old_storage drops empty
123124 let mut old_storage = self . into_raw_vec ( ) ;
124125 old_storage. set_len ( 0 ) ;
125126
126- debug_assert_eq ! ( result. len( ) , moved_elements) ;
127127 result. assume_init ( )
128+ // panic-critical end
128129 }
129- // panic-critical end
130130 }
131131}
132132
You can’t perform that action at this time.
0 commit comments