rust/tests/mir-opt/instsimplify
Nilstrieb b6657a8ad4 Never consider raw pointer casts to be trival
HIR typeck tries to figure out which casts are trivial by doing them as
coercions and seeing whether this works. Since HIR typeck is oblivious
of lifetimes, this doesn't work for pointer casts that only change the
lifetime of the pointee, which are, as borrowck will tell you, not
trivial.

This change makes it so that raw pointer casts are never considered
trivial.

This also incidentally fixes the "trivial cast" lint false positive on
the same code. Unfortunately, "trivial cast" lints are now never emitted
on raw pointer casts, even if they truly are trivial. This could be
fixed by also doing the lint in borrowck for raw pointers specifically.
2023-10-25 23:15:18 +02:00
..
bool_compare.eq_false.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.eq_true.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.false_eq.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.false_ne.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.ne_false.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.ne_true.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.rs FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.true_eq.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
bool_compare.true_ne.InstSimplify.diff FileCheck bool_compare. 2023-10-19 15:51:53 +00:00
casts.redundant.InstSimplify.diff Never consider raw pointer casts to be trival 2023-10-25 23:15:18 +02:00
casts.roundtrip.InstSimplify.diff Never consider raw pointer casts to be trival 2023-10-25 23:15:18 +02:00
casts.rs Never consider raw pointer casts to be trival 2023-10-25 23:15:18 +02:00
combine_array_len.norm2.InstSimplify.panic-abort.diff FileCheck combine_array_len. 2023-10-19 15:51:53 +00:00
combine_array_len.norm2.InstSimplify.panic-unwind.diff FileCheck combine_array_len. 2023-10-19 15:51:53 +00:00
combine_array_len.rs FileCheck combine_array_len. 2023-10-19 15:51:53 +00:00
combine_clone_of_primitives.rs FileCheck combine_clone_of_primitives. 2023-10-19 15:51:54 +00:00
combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff FileCheck combine_clone_of_primitives. 2023-10-19 15:51:54 +00:00
combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff FileCheck combine_clone_of_primitives. 2023-10-19 15:51:54 +00:00
combine_transmutes.adt_transmutes.InstSimplify.diff FileCheck combine_transmutes. 2023-10-19 15:51:54 +00:00
combine_transmutes.identity_transmutes.InstSimplify.diff FileCheck combine_transmutes. 2023-10-19 15:51:54 +00:00
combine_transmutes.integer_transmutes.InstSimplify.diff FileCheck combine_transmutes. 2023-10-19 15:51:54 +00:00
combine_transmutes.rs FileCheck combine_transmutes. 2023-10-19 15:51:54 +00:00
duplicate_switch_targets.assert_zero.InstSimplify.diff FileCheck duplicate_switch_targets. 2023-10-19 15:51:54 +00:00
duplicate_switch_targets.rs FileCheck duplicate_switch_targets. 2023-10-19 15:51:54 +00:00
intrinsic_asserts.generic.InstSimplify.diff FileCheck intrinsic_asserts. 2023-10-19 15:51:54 +00:00
intrinsic_asserts.generic_ref.InstSimplify.diff FileCheck intrinsic_asserts. 2023-10-19 15:51:54 +00:00
intrinsic_asserts.panics.InstSimplify.diff FileCheck intrinsic_asserts. 2023-10-19 15:51:54 +00:00
intrinsic_asserts.removable.InstSimplify.diff FileCheck intrinsic_asserts. 2023-10-19 15:51:54 +00:00
intrinsic_asserts.rs FileCheck intrinsic_asserts. 2023-10-19 15:51:54 +00:00