@@ -171,7 +171,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
171
171
_ => { }
172
172
}
173
173
// And we need to get the provenance.
174
- Ok ( M :: adjust_alloc_base_pointer ( self , ptr) )
174
+ M :: adjust_alloc_base_pointer ( self , ptr)
175
175
}
176
176
177
177
pub fn create_fn_alloc_ptr (
@@ -200,8 +200,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
200
200
kind : MemoryKind < M :: MemoryKind > ,
201
201
) -> InterpResult < ' tcx , Pointer < M :: Provenance > > {
202
202
let alloc = Allocation :: uninit ( size, align, M :: PANIC_ON_ALLOC_FAIL ) ?;
203
- // We can `unwrap` since `alloc` contains no pointers.
204
- Ok ( self . allocate_raw_ptr ( alloc, kind) . unwrap ( ) )
203
+ self . allocate_raw_ptr ( alloc, kind)
205
204
}
206
205
207
206
pub fn allocate_bytes_ptr (
@@ -210,10 +209,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
210
209
align : Align ,
211
210
kind : MemoryKind < M :: MemoryKind > ,
212
211
mutability : Mutability ,
213
- ) -> Pointer < M :: Provenance > {
212
+ ) -> InterpResult < ' tcx , Pointer < M :: Provenance > > {
214
213
let alloc = Allocation :: from_bytes ( bytes, align, mutability) ;
215
- // We can `unwrap` since `alloc` contains no pointers.
216
- self . allocate_raw_ptr ( alloc, kind) . unwrap ( )
214
+ self . allocate_raw_ptr ( alloc, kind)
217
215
}
218
216
219
217
/// This can fail only of `alloc` contains provenance.
@@ -230,7 +228,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
230
228
) ;
231
229
let alloc = M :: adjust_allocation ( self , id, Cow :: Owned ( alloc) , Some ( kind) ) ?;
232
230
self . memory . alloc_map . insert ( id, ( kind, alloc. into_owned ( ) ) ) ;
233
- Ok ( M :: adjust_alloc_base_pointer ( self , Pointer :: from ( id) ) )
231
+ M :: adjust_alloc_base_pointer ( self , Pointer :: from ( id) )
234
232
}
235
233
236
234
pub fn reallocate_ptr (
0 commit comments