• D
    Rollup merge of #95785 - RalfJung:interpret-size-mismatch, r=oli-obk · dfb4194e
    Dylan DPC 提交于
    interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internal
    
    We did this a while ago already for `to_i32()` and friends, but missed this one. That became quite annoying when I was debugging an ICE caused by `read_pointer` in a Miri shim where the code was passing an argument at the wrong type.
    
    Having `scalar_to_ptr` be fallible is consistent with all the other `Scalar::to_*` methods being fallible. I added `unwrap` only in code outside the interpreter, which is no worse off than before now in terms of panics.
    
    r? ````@oli-obk````
    dfb4194e
allocation.rs 44.1 KB