Skip to content

Commit

Permalink
Auto merge of #122629 - RalfJung:assert-unsafe-precondition, r=saethlin
Browse files Browse the repository at this point in the history
refactor check_{lang,library}_ub: use a single intrinsic

This enacts the plan I laid out [here](rust-lang/rust#122282 (comment)): use a single intrinsic, called `ub_checks` (in aniticpation of rust-lang/compiler-team#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 rust-lang/rust#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`
  • Loading branch information
bors committed Mar 23, 2024
2 parents e1f3962 + f5dcce4 commit 3e7eedf
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 3e7eedf

Please sign in to comment.