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
array_index.main.DataflowConstProp.32bit.panic-unwind.diff
array_index.main.DataflowConstProp.64bit.panic-abort.diff
array_index.main.DataflowConstProp.64bit.panic-unwind.diff
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
cast.main.DataflowConstProp.diff
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
enum.mutate_discriminant.DataflowConstProp.64bit.diff
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
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
inherit_overflow.main.DataflowConstProp.panic-unwind.diff
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
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
large_array_index.main.DataflowConstProp.32bit.panic-unwind.diff
large_array_index.main.DataflowConstProp.64bit.panic-abort.diff
large_array_index.main.DataflowConstProp.64bit.panic-unwind.diff
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
offset_of.concrete.DataflowConstProp.panic-abort.diff
offset_of.concrete.DataflowConstProp.panic-unwind.diff
offset_of.generic.DataflowConstProp.panic-abort.diff
offset_of.generic.DataflowConstProp.panic-unwind.diff
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
ref_without_sb.main.DataflowConstProp.panic-unwind.diff
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
repeat.main.DataflowConstProp.32bit.panic-unwind.diff
repeat.main.DataflowConstProp.64bit.panic-abort.diff
repeat.main.DataflowConstProp.64bit.panic-unwind.diff
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
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
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
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
sibling_ptr.main.DataflowConstProp.panic-unwind.diff
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
terminator.main.DataflowConstProp.panic-unwind.diff
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
transmute.from_char.DataflowConstProp.64bit.diff
transmute.invalid_bool.DataflowConstProp.32bit.diff
transmute.invalid_bool.DataflowConstProp.64bit.diff
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
transmute.less_as_i8.DataflowConstProp.64bit.diff
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
transmute.undef_union_as_integer.DataflowConstProp.64bit.diff
transmute.unreachable_box.DataflowConstProp.32bit.diff
transmute.unreachable_box.DataflowConstProp.64bit.diff
transmute.unreachable_direct.DataflowConstProp.32bit.diff
transmute.unreachable_direct.DataflowConstProp.64bit.diff
transmute.unreachable_mut.DataflowConstProp.32bit.diff
transmute.unreachable_mut.DataflowConstProp.64bit.diff
transmute.unreachable_ref.DataflowConstProp.32bit.diff
transmute.unreachable_ref.DataflowConstProp.64bit.diff
transmute.valid_char.DataflowConstProp.32bit.diff
transmute.valid_char.DataflowConstProp.64bit.diff
tuple.main.DataflowConstProp.32bit.diff
tuple.main.DataflowConstProp.64bit.diff
tuple.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00