rust/compiler/rustc_const_eval
Matthias Krüger 426922be40
Rollup merge of #97960 - RalfJung:offset-from, r=oli-obk
interpret: unify offset_from check with offset check

`offset` does the check with a single `check_ptr_access` call while `offset_from` used two calls. Make them both just one one call.

I originally intended to actually factor this into a common function, but I am no longer sure if that makes a lot of sense... the two functions start with pretty different precondition (e.g. `offset` *knows* that the 2nd pointer has the same provenance).

I also reworded the UB messages a little. Saying it "cannot" do something is not how we usually phrase UB (as far as I know). Instead it's not *allowed* to do that.

r? ``````@oli-obk``````
2022-06-13 21:35:55 +02:00
..
src Rollup merge of #97960 - RalfJung:offset-from, r=oli-obk 2022-06-13 21:35:55 +02:00
Cargo.toml Initial fixes on top of type interner commit 2022-05-28 11:38:22 -07:00