@@ -1351,23 +1351,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1351
1351
}
1352
1352
}
1353
1353
1354
- pub fn resolve_const_var (
1355
- & self ,
1356
- ct : & ' tcx ty:: Const < ' tcx >
1357
- ) -> & ' tcx ty:: Const < ' tcx > {
1358
- if let ty:: Const { val : ConstValue :: Infer ( InferConst :: Var ( v) ) , .. } = ct {
1359
- self . const_unification_table
1360
- . borrow_mut ( )
1361
- . probe_value ( * v)
1362
- . val
1363
- . known ( )
1364
- . map ( |c| self . resolve_const_var ( c) )
1365
- . unwrap_or ( ct)
1366
- } else {
1367
- ct
1368
- }
1369
- }
1370
-
1371
1354
pub fn fully_resolve < T : TypeFoldable < ' tcx > > ( & self , value : & T ) -> FixupResult < ' tcx , T > {
1372
1355
/*!
1373
1356
* Attempts to resolve all type/region/const variables in
@@ -1586,7 +1569,7 @@ impl<'a, 'tcx> ShallowResolver<'a, 'tcx> {
1586
1569
// it can be resolved to an int/float variable, which
1587
1570
// can then be recursively resolved, hence the
1588
1571
// recursion. Note though that we prevent type
1589
- // variables from unifyxing to other type variables
1572
+ // variables from unifying to other type variables
1590
1573
// directly (though they may be embedded
1591
1574
// structurally), and we prevent cycles in any case,
1592
1575
// so this recursion should always be of very limited
@@ -1626,17 +1609,15 @@ impl<'a, 'tcx> TypeFolder<'tcx> for ShallowResolver<'a, 'tcx> {
1626
1609
}
1627
1610
1628
1611
fn fold_const ( & mut self , ct : & ' tcx ty:: Const < ' tcx > ) -> & ' tcx ty:: Const < ' tcx > {
1629
- match ct {
1630
- ty:: Const { val : ConstValue :: Infer ( InferConst :: Var ( vid) ) , .. } => {
1612
+ if let ty:: Const { val : ConstValue :: Infer ( InferConst :: Var ( vid) ) , .. } = ct {
1631
1613
self . infcx . const_unification_table
1632
1614
. borrow_mut ( )
1633
1615
. probe_value ( * vid)
1634
1616
. val
1635
1617
. known ( )
1636
- . map ( |c| self . fold_const ( c) )
1637
1618
. unwrap_or ( ct)
1638
- }
1639
- _ => ct ,
1619
+ } else {
1620
+ ct
1640
1621
}
1641
1622
}
1642
1623
}
0 commit comments