rust/compiler/rustc_mir/src/transform
bors 36a74944cb Auto merge of #77526 - RalfJung:dont-promote-unions, r=lcnr
stop promoting union field accesses in 'const'

Turns out that promotion of union field accesses is the only difference between "promotion in `const`/`static` bodies" and "explicit promotion". So if we can remove this, we have finally achieved what I thought to already be the case -- that the bodies of `const`/`static` initializers behave the same as explicit promotion contexts.

The reason we do not want to promote union field accesses is that they can introduce UB, i.e., they can go wrong. We want to [minimize the ways promoteds can fail to evaluate](https://github.com/rust-lang/const-eval/issues/53). Also this change makes things more consistent overall, removing a special case that was added without much consideration (as far as I can tell).

Cc `@rust-lang/wg-const-eval`
2020-10-25 02:27:09 +00:00
..
check_consts Fix const core::panic!(non_literal_str). 2020-10-22 18:41:35 +02:00
add_call_guards.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
add_moves_for_packed_drops.rs Replace (Body, DefId) with Body where possible 2020-10-04 16:07:03 -07:00
add_retag.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
check_const_item_mutation.rs Take functions by value 2020-10-10 16:19:53 +02:00
check_packed_ref.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
check_unsafety.rs fix static_ptr_ty for foreign statics, and more comments in check_unsafety 2020-10-19 09:47:18 +02:00
cleanup_post_borrowck.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
const_prop.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
deaggregator.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
dest_prop.rs Replace (Body, DefId) with Body where possible 2020-10-04 16:07:03 -07:00
dump_mir.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
early_otherwise_branch.rs Refactor how SwitchInt stores jump targets 2020-10-10 17:46:11 +02:00
elaborate_drops.rs Replace (Body, DefId) with Body where possible 2020-10-04 16:07:03 -07:00
generator.rs Refactor how SwitchInt stores jump targets 2020-10-10 17:46:11 +02:00
inline.rs Auto merge of #77306 - lcnr:inline-ok, r=eddyb 2020-10-18 16:10:00 +00:00
instcombine.rs Disable "optimization to avoid load of address" in InstCombine 2020-10-21 00:00:00 +00:00
instrument_coverage.rs instrument-coverage: try our best to not ICE 2020-10-16 21:46:41 +03:00
match_branches.rs Introduce a temporary for discriminant value in MatchBranchSimplification 2020-10-21 00:00:00 +00:00
mod.rs Remove the old copy propagation pass 2020-10-17 02:25:31 +02:00
multiple_return_terminators.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
no_landing_pads.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
nrvo.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
promote_consts.rs Auto merge of #77526 - RalfJung:dont-promote-unions, r=lcnr 2020-10-25 02:27:09 +00:00
remove_noop_landing_pads.rs Recognize discriminant reads as no-ops in RemoveNoopLandingPads 2020-10-10 00:00:00 +00:00
remove_unneeded_drops.rs Replace (Body, DefId) with Body where possible 2020-10-04 16:07:03 -07:00
required_consts.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_peek.rs Replace (Body, DefId) with Body where possible 2020-10-04 16:07:03 -07:00
simplify.rs Remember the MirSource for each Body 2020-10-04 11:01:38 -07:00
simplify_branches.rs Simplify assert terminator only if condition evaluates to expected value 2020-10-21 00:00:00 +00:00
simplify_comparison_integral.rs Use SmallVec in SwitchTargets 2020-10-11 01:14:12 +02:00
simplify_try.rs Refactor how SwitchInt stores jump targets 2020-10-10 17:46:11 +02:00
uninhabited_enum_branching.rs Refactor how SwitchInt stores jump targets 2020-10-10 17:46:11 +02:00
unreachable_prop.rs Refactor how SwitchInt stores jump targets 2020-10-10 17:46:11 +02:00
validate.rs Validate references to source scopes 2020-10-14 00:00:00 +00:00