bail out early when substituting mir constants that don't need substituting
This commit is contained in:
parent
4e8edfb5c2
commit
d139968d19
1 changed files with 3 additions and 0 deletions
|
@ -506,6 +506,9 @@ impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn fold_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> mir::ConstantKind<'tcx> {
|
||||
if !c.needs_subst() {
|
||||
return c;
|
||||
}
|
||||
c.super_fold_with(self)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue