Rollup merge of #61291 - spastorino:avoid-unneeded-bug-call, r=estebank
Avoid unneeded bug!() call r? @oli-obk
This commit is contained in:
commit
73530ff80b
1 changed files with 12 additions and 14 deletions
|
@ -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) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue