diff options
| author | bors <bors@rust-lang.org> | 2024-03-23 21:11:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-23 21:11:00 +0000 |
| commit | 47265adb1ac174a457f2c1e186ea66f391b3b7f9 (patch) | |
| tree | 6cbdd9c1662853c3aaf6c916ee9ea66e801af95a /compiler/rustc_codegen_gcc/example/std_example.rs | |
| parent | 21a6f0ce87f4b3c46c43ed3fc9d387e72192e7ca (diff) | |
| parent | 5919b26d33aac5da7e78468c4412814869b0b12f (diff) | |
| download | rust-47265adb1ac174a457f2c1e186ea66f391b3b7f9.tar.gz rust-47265adb1ac174a457f2c1e186ea66f391b3b7f9.zip | |
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`
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions
