Don't accidentally promote union access in MIR
This commit is contained in:
parent
c0aedc0b6a
commit
07e2dd7d96
@ -515,7 +515,7 @@ fn visit_place(&mut self,
|
||||
if let Some(def) = base_ty.ty_adt_def() {
|
||||
if def.is_union() {
|
||||
match this.mode {
|
||||
Mode::Fn => {},
|
||||
Mode::Fn => this.not_const(),
|
||||
Mode::ConstFn => {
|
||||
if !this.tcx.sess.features_untracked().const_fn_union {
|
||||
emit_feature_err(
|
||||
|
@ -1,11 +0,0 @@
|
||||
error: internal compiler error: unexpected region for local data ReStatic
|
||||
--> $DIR/union_promotion.rs:19:29
|
||||
|
|
||||
LL | let x: &'static bool = &unsafe { //~ borrowed value does not live long enough
|
||||
| _____________________________^
|
||||
LL | | Foo { a: &1 }.b == Foo { a: &2 }.b
|
||||
LL | | };
|
||||
| |_____^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user