cleanup WithOptConstParam queries
This commit is contained in:
parent
a835b483fe
commit
536674fb69
5 changed files with 38 additions and 30 deletions
|
@ -482,11 +482,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
match instance {
|
||||
ty::InstanceDef::Item(def) => {
|
||||
if self.tcx.is_mir_available(def.did) {
|
||||
if let Some((did, param_did)) = def.as_const_arg() {
|
||||
Ok(self.tcx.optimized_mir_of_const_arg((did, param_did)))
|
||||
} else {
|
||||
Ok(self.tcx.optimized_mir(def.did))
|
||||
}
|
||||
Ok(self.tcx.optimized_mir_of_opt_const_arg(def))
|
||||
} else {
|
||||
throw_unsup!(NoMirFor(def.did))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue