cleanup WithOptConstParam queries
This commit is contained in:
parent
a835b483fe
commit
536674fb69
5 changed files with 38 additions and 30 deletions
|
@ -2953,13 +2953,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
/// Returns the possibly-auto-generated MIR of a `(DefId, Subst)` pair.
|
||||
pub fn instance_mir(self, instance: ty::InstanceDef<'tcx>) -> &'tcx Body<'tcx> {
|
||||
match instance {
|
||||
ty::InstanceDef::Item(def) => {
|
||||
if let Some((did, param_did)) = def.as_const_arg() {
|
||||
self.optimized_mir_of_const_arg((did, param_did))
|
||||
} else {
|
||||
self.optimized_mir(def.did)
|
||||
}
|
||||
}
|
||||
ty::InstanceDef::Item(def) => self.optimized_mir_of_opt_const_arg(def),
|
||||
ty::InstanceDef::VtableShim(..)
|
||||
| ty::InstanceDef::ReifyShim(..)
|
||||
| ty::InstanceDef::Intrinsic(..)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue