1
Fork 0
rust/compiler/rustc_const_eval/src
bors 2f090c30dd Auto merge of #122629 - RalfJung:assert-unsafe-precondition, r=saethlin
refactor check_{lang,library}_ub: use a single intrinsic

This enacts the plan I laid out [here](https://github.com/rust-lang/rust/pull/122282#issuecomment-1996917998): use a single intrinsic, called `ub_checks` (in aniticpation of https://github.com/rust-lang/compiler-team/issues/725), that just exposes the value of `debug_assertions` (consistently implemented in both codegen and the interpreter). Put the language vs library UB logic into the library.

This makes it easier to do something like https://github.com/rust-lang/rust/pull/122282 in the future: that just slightly alters the semantics of `ub_checks` (making it more approximating when crates built with different flags are mixed), but it no longer affects whether these checks can happen in Miri or compile-time.

The first commit just moves things around; I don't think these macros and functions belong into `intrinsics.rs` as they are not intrinsics.

r? `@saethlin`
2024-03-23 21:11:00 +00:00
..
const_eval tag_for_variant follow-ups 2024-03-23 10:45:42 +01:00
interpret Auto merge of #122629 - RalfJung:assert-unsafe-precondition, r=saethlin 2024-03-23 21:11:00 +00:00
transform refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
util Programmatically convert some of the pat ctors 2024-03-22 11:13:29 -04:00
errors.rs Rename some things around validation error reporting to signal that it is in fact about validation failures 2024-03-14 12:21:35 +00:00
lib.rs Add tag_for_variant query 2024-03-22 17:01:49 +00:00