rust/tests/mir-opt/dataflow-const-prop
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
..
array_index.main.DataflowConstProp.32bit.panic-abort.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
array_index.main.DataflowConstProp.32bit.panic-unwind.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
array_index.main.DataflowConstProp.64bit.panic-abort.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
array_index.main.DataflowConstProp.64bit.panic-unwind.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
array_index.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
boolean_identities.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
boolean_identities.test.DataflowConstProp.diff Implement algebraic simplifications. 2023-09-06 15:57:50 +00:00
cast.main.DataflowConstProp.diff Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
cast.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
checked.main.DataflowConstProp.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
checked.main.DataflowConstProp.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
checked.rs MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.GVN.32bit.panic-abort.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.GVN.32bit.panic-unwind.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.GVN.64bit.panic-abort.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.main.GVN.64bit.panic-unwind.diff refactor check_{lang,library}_ub: use a single intrinsic, put policy into library 2024-03-23 18:45:05 +01:00
default_boxed_slice.rs Enable more mir-opt tests in debug builds 2024-03-22 20:14:39 -04:00
enum.constant.DataflowConstProp.32bit.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
enum.constant.DataflowConstProp.64bit.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
enum.multiple.DataflowConstProp.32bit.diff Start blocks eagerly 2024-02-12 17:37:05 +01:00
enum.multiple.DataflowConstProp.64bit.diff Start blocks eagerly 2024-02-12 17:37:05 +01:00
enum.mutate_discriminant.DataflowConstProp.32bit.diff Duplicate output for test. 2023-09-11 16:29:42 +00:00
enum.mutate_discriminant.DataflowConstProp.64bit.diff Duplicate output for test. 2023-09-11 16:29:42 +00:00
enum.rs MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
enum.simple.DataflowConstProp.32bit.diff Start blocks eagerly 2024-02-12 17:37:05 +01:00
enum.simple.DataflowConstProp.64bit.diff Start blocks eagerly 2024-02-12 17:37:05 +01:00
enum.statics.DataflowConstProp.32bit.diff Start blocks eagerly 2024-02-12 17:37:05 +01:00
enum.statics.DataflowConstProp.64bit.diff Start blocks eagerly 2024-02-12 17:37:05 +01:00
if.main.DataflowConstProp.diff lower ExprKind::Use, LogicalOp::Or and UnOp::Not 2023-08-30 17:24:10 +08:00
if.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
inherit_overflow.main.DataflowConstProp.panic-abort.diff add track_caller for arith ops 2023-11-24 00:54:06 +08:00
inherit_overflow.main.DataflowConstProp.panic-unwind.diff add track_caller for arith ops 2023-11-24 00:54:06 +08:00
inherit_overflow.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue_81605.f.DataflowConstProp.diff Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
issue_81605.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
large_array_index.main.DataflowConstProp.32bit.panic-abort.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
large_array_index.main.DataflowConstProp.64bit.panic-abort.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
large_array_index.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
mult_by_zero.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
mult_by_zero.test.DataflowConstProp.diff Implement algebraic simplifications. 2023-09-06 15:57:50 +00:00
offset_of.concrete.DataflowConstProp.panic-abort.diff Update MIR tests for offset_of 2023-10-31 23:26:02 +00:00
offset_of.concrete.DataflowConstProp.panic-unwind.diff Update MIR tests for offset_of 2023-10-31 23:26:02 +00:00
offset_of.generic.DataflowConstProp.panic-abort.diff Update MIR tests for offset_of 2023-10-31 23:26:02 +00:00
offset_of.generic.DataflowConstProp.panic-unwind.diff Update MIR tests for offset_of 2023-10-31 23:26:02 +00:00
offset_of.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
ref_without_sb.main.DataflowConstProp.panic-abort.diff Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
ref_without_sb.main.DataflowConstProp.panic-unwind.diff Bless tests 2023-06-23 18:36:25 +01:00
ref_without_sb.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
repeat.main.DataflowConstProp.32bit.panic-abort.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
repeat.main.DataflowConstProp.32bit.panic-unwind.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
repeat.main.DataflowConstProp.64bit.panic-abort.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
repeat.main.DataflowConstProp.64bit.panic-unwind.diff Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
repeat.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
repr_transparent.main.DataflowConstProp.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
repr_transparent.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
self_assign_add.main.DataflowConstProp.diff Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
self_assign_add.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
self_assign.main.DataflowConstProp.diff Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
self_assign.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
sibling_ptr.main.DataflowConstProp.panic-abort.diff Update std::simd usage and test outputs 2023-11-26 09:02:25 -05:00
sibling_ptr.main.DataflowConstProp.panic-unwind.diff Update std::simd usage and test outputs 2023-11-26 09:02:25 -05:00
sibling_ptr.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
slice_len.main.DataflowConstProp.32bit.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
slice_len.main.DataflowConstProp.32bit.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
slice_len.main.DataflowConstProp.64bit.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
slice_len.main.DataflowConstProp.64bit.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
slice_len.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
struct.main.DataflowConstProp.32bit.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
struct.main.DataflowConstProp.64bit.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
struct.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
terminator.main.DataflowConstProp.panic-abort.diff Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
terminator.main.DataflowConstProp.panic-unwind.diff Bless tests 2023-06-23 18:36:25 +01:00
terminator.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
transmute.from_char.DataflowConstProp.32bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.from_char.DataflowConstProp.64bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.invalid_bool.DataflowConstProp.32bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.invalid_bool.DataflowConstProp.64bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.invalid_char.DataflowConstProp.32bit.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
transmute.invalid_char.DataflowConstProp.64bit.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
transmute.less_as_i8.DataflowConstProp.32bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.less_as_i8.DataflowConstProp.64bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
transmute.undef_union_as_integer.DataflowConstProp.32bit.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
transmute.undef_union_as_integer.DataflowConstProp.64bit.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
transmute.unreachable_box.DataflowConstProp.32bit.diff Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
transmute.unreachable_box.DataflowConstProp.64bit.diff Use PlaceMention for match scrutinees. 2023-10-24 15:30:17 +00:00
transmute.unreachable_direct.DataflowConstProp.32bit.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
transmute.unreachable_direct.DataflowConstProp.64bit.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
transmute.unreachable_mut.DataflowConstProp.32bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.unreachable_mut.DataflowConstProp.64bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.unreachable_ref.DataflowConstProp.32bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.unreachable_ref.DataflowConstProp.64bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.valid_char.DataflowConstProp.32bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
transmute.valid_char.DataflowConstProp.64bit.diff Support a few more rvalues. 2023-09-06 15:52:06 +00:00
tuple.main.DataflowConstProp.32bit.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
tuple.main.DataflowConstProp.64bit.diff Use a ConstValue instead. 2023-10-21 16:26:05 +00:00
tuple.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00