rust/tests/mir-opt/inline
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
..
asm_unwind.main.Inline.panic-abort.diff
asm_unwind.main.Inline.panic-unwind.diff
asm_unwind.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
caller_with_trivial_bound.foo.Inline.panic-unwind.diff
caller_with_trivial_bound.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
cycle.f.Inline.panic-abort.diff
cycle.f.Inline.panic-unwind.diff
cycle.g.Inline.panic-abort.diff Use a better set of targets for blessing mir-opt tests 2024-02-06 23:36:05 -05:00
cycle.g.Inline.panic-unwind.diff Use a better set of targets for blessing mir-opt tests 2024-02-06 23:36:05 -05:00
cycle.main.Inline.panic-abort.diff
cycle.main.Inline.panic-unwind.diff
cycle.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
dont_ice_on_generic_rust_call.call.Inline.panic-abort.diff
dont_ice_on_generic_rust_call.call.Inline.panic-unwind.diff
dont_ice_on_generic_rust_call.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
dyn_trait.get_query.Inline.panic-abort.diff
dyn_trait.get_query.Inline.panic-unwind.diff
dyn_trait.mk_cycle.Inline.panic-abort.diff
dyn_trait.mk_cycle.Inline.panic-unwind.diff
dyn_trait.rs
dyn_trait.try_execute_query.Inline.panic-abort.diff
dyn_trait.try_execute_query.Inline.panic-unwind.diff
exponential_runtime.main.Inline.panic-abort.diff
exponential_runtime.main.Inline.panic-unwind.diff
exponential_runtime.rs
indirect_destination.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_any_operand.bar.Inline.after.mir
inline_any_operand.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_async.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_box_fn.call.Inline.panic-abort.diff
inline_box_fn.call.Inline.panic-unwind.diff
inline_box_fn.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_closure_borrows_arg.foo.Inline.after.mir
inline_closure_borrows_arg.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_closure_captures.foo.Inline.after.mir
inline_closure_captures.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_closure.foo.Inline.after.mir
inline_closure.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_compatibility.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_coroutine.main.Inline.panic-abort.diff Rename pointer field on Pin 2024-01-16 14:58:42 -05:00
inline_coroutine.main.Inline.panic-unwind.diff Rename pointer field on Pin 2024-01-16 14:58:42 -05:00
inline_coroutine.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_cycle_generic.main.Inline.panic-abort.diff Use a better set of targets for blessing mir-opt tests 2024-02-06 23:36:05 -05:00
inline_cycle_generic.main.Inline.panic-unwind.diff Use a better set of targets for blessing mir-opt tests 2024-02-06 23:36:05 -05:00
inline_cycle_generic.rs
inline_cycle.one.Inline.panic-abort.diff
inline_cycle.one.Inline.panic-unwind.diff
inline_cycle.rs
inline_cycle.two.Inline.panic-abort.diff
inline_cycle.two.Inline.panic-unwind.diff
inline_diverging.f.Inline.panic-abort.diff
inline_diverging.f.Inline.panic-unwind.diff
inline_diverging.g.Inline.panic-abort.diff
inline_diverging.g.Inline.panic-unwind.diff
inline_diverging.h.Inline.panic-abort.diff Sandwich MIR optimizations between DSE. 2024-01-11 09:58:19 +00:00
inline_diverging.h.Inline.panic-unwind.diff Sandwich MIR optimizations between DSE. 2024-01-11 09:58:19 +00:00
inline_diverging.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_instruction_set.default.Inline.diff Update to bitflags 2 in the compiler 2023-12-30 18:17:28 +01:00
inline_instruction_set.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_instruction_set.t32.Inline.diff
inline_options.main.Inline.after.panic-abort.mir
inline_options.main.Inline.after.panic-unwind.mir
inline_options.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_retag.bar.Inline.after.mir MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
inline_retag.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_shims.clone.Inline.panic-abort.diff
inline_shims.clone.Inline.panic-unwind.diff
inline_shims.drop.Inline.panic-abort.diff
inline_shims.drop.Inline.panic-unwind.diff
inline_shims.rs
inline_specialization.main.Inline.panic-abort.diff
inline_specialization.main.Inline.panic-unwind.diff
inline_specialization.rs
inline_trait_method_2.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_trait_method_2.test2.Inline.after.panic-abort.mir
inline_trait_method_2.test2.Inline.after.panic-unwind.mir
inline_trait_method.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inline_trait_method.test.Inline.after.panic-abort.mir
inline_trait_method.test.Inline.after.panic-unwind.mir
issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
issue_58867_inline_as_ref_as_mut.rs
issue_76997_inline_scopes_parenting.main.Inline.after.mir
issue_76997_inline_scopes_parenting.rs
issue_78442.bar.Inline.panic-abort.diff
issue_78442.bar.Inline.panic-unwind.diff
issue_78442.bar.RevealAll.panic-abort.diff
issue_78442.bar.RevealAll.panic-unwind.diff
issue_78442.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue_106141.outer.Inline.panic-abort.diff MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
issue_106141.outer.Inline.panic-unwind.diff MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
issue_106141.rs
polymorphic_recursion.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
rustc_no_mir_inline.caller.Inline.panic-abort.diff Add #[rustc_no_mir_inline] for standard library UB checks 2024-02-24 21:19:41 +01:00
rustc_no_mir_inline.caller.Inline.panic-unwind.diff Add #[rustc_no_mir_inline] for standard library UB checks 2024-02-24 21:19:41 +01:00
rustc_no_mir_inline.caller.PreCodegen.after.panic-abort.mir Add #[rustc_no_mir_inline] for standard library UB checks 2024-02-24 21:19:41 +01:00
rustc_no_mir_inline.caller.PreCodegen.after.panic-unwind.mir Add #[rustc_no_mir_inline] for standard library UB checks 2024-02-24 21:19:41 +01:00
rustc_no_mir_inline.rs Add #[rustc_no_mir_inline] for standard library UB checks 2024-02-24 21:19:41 +01:00
unchecked_shifts.rs Enable more mir-opt tests in debug builds 2024-03-22 20:14:39 -04:00
unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-abort.diff
unchecked_shifts.unchecked_shl_unsigned_bigger.Inline.panic-unwind.diff
unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-abort.mir
unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-unwind.mir
unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff
unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff
unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir
unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir
unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff
unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff
unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir
unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir
unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-abort.diff
unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-unwind.diff
unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-abort.mir
unchecked_shifts.unchecked_shr_signed_smaller.PreCodegen.after.panic-unwind.mir
unit_test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
unsized_argument.caller.Inline.diff
unsized_argument.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
unwrap_unchecked.rs Enable more mir-opt tests in debug builds 2024-03-22 20:14:39 -04:00
unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00