mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
b6657a8ad4
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. |
||
---|---|---|
.. | ||
bool_compare.eq_false.InstSimplify.diff | ||
bool_compare.eq_true.InstSimplify.diff | ||
bool_compare.false_eq.InstSimplify.diff | ||
bool_compare.false_ne.InstSimplify.diff | ||
bool_compare.ne_false.InstSimplify.diff | ||
bool_compare.ne_true.InstSimplify.diff | ||
bool_compare.rs | ||
bool_compare.true_eq.InstSimplify.diff | ||
bool_compare.true_ne.InstSimplify.diff | ||
casts.redundant.InstSimplify.diff | ||
casts.roundtrip.InstSimplify.diff | ||
casts.rs | ||
combine_array_len.norm2.InstSimplify.panic-abort.diff | ||
combine_array_len.norm2.InstSimplify.panic-unwind.diff | ||
combine_array_len.rs | ||
combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff | ||
combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff | ||
combine_clone_of_primitives.rs | ||
combine_transmutes.adt_transmutes.InstSimplify.diff | ||
combine_transmutes.identity_transmutes.InstSimplify.diff | ||
combine_transmutes.integer_transmutes.InstSimplify.diff | ||
combine_transmutes.rs | ||
duplicate_switch_targets.assert_zero.InstSimplify.diff | ||
duplicate_switch_targets.rs | ||
intrinsic_asserts.generic_ref.InstSimplify.diff | ||
intrinsic_asserts.generic.InstSimplify.diff | ||
intrinsic_asserts.panics.InstSimplify.diff | ||
intrinsic_asserts.removable.InstSimplify.diff | ||
intrinsic_asserts.rs |