1
Fork 0

Rollup merge of #61291 - spastorino:avoid-unneeded-bug-call, r=estebank

Avoid unneeded bug!() call

r? @oli-obk
This commit is contained in:
Mazdak Farrokhzad 2019-05-29 08:16:02 +02:00 committed by GitHub
commit 73530ff80b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -396,22 +396,20 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let cx = self.cx; let cx = self.cx;
let tcx = self.cx.tcx(); let tcx = self.cx.tcx();
if let mir::Place::Base(mir::PlaceBase::Local(index)) = *place { let result = match *place {
match self.locals[index] { mir::Place::Base(mir::PlaceBase::Local(index)) => {
LocalRef::Place(place) => { match self.locals[index] {
return place; LocalRef::Place(place) => {
} return place;
LocalRef::UnsizedPlace(place) => { }
return bx.load_operand(place).deref(cx); LocalRef::UnsizedPlace(place) => {
} return bx.load_operand(place).deref(cx);
LocalRef::Operand(..) => { }
bug!("using operand local {:?} as place", place); LocalRef::Operand(..) => {
bug!("using operand local {:?} as place", place);
}
} }
} }
}
let result = match *place {
mir::Place::Base(mir::PlaceBase::Local(_)) => bug!(), // handled above
mir::Place::Base( mir::Place::Base(
mir::PlaceBase::Static( mir::PlaceBase::Static(
box mir::Static { ty, kind: mir::StaticKind::Promoted(promoted) } box mir::Static { ty, kind: mir::StaticKind::Promoted(promoted) }