@@ -4,7 +4,6 @@ use crate::ty::{
4
4
TypeVisitableExt ,
5
5
} ;
6
6
use rustc_errors:: ErrorGuaranteed ;
7
- use rustc_hir:: def_id:: DefId ;
8
7
9
8
#[ derive( Hash , Debug , Clone , Copy , Ord , PartialOrd , PartialEq , Eq ) ]
10
9
#[ derive( TyDecodable , TyEncodable , HashStable , TypeVisitable , TypeFoldable ) ]
@@ -35,12 +34,6 @@ TrivialTypeTraversalAndLiftImpls! {
35
34
pub type BoundAbstractConst < ' tcx > = Result < Option < EarlyBinder < ty:: Const < ' tcx > > > , ErrorGuaranteed > ;
36
35
37
36
impl < ' tcx > TyCtxt < ' tcx > {
38
- /// Returns a const without substs applied
39
- pub fn bound_abstract_const ( self , uv : DefId ) -> BoundAbstractConst < ' tcx > {
40
- let ac = self . thir_abstract_const ( uv) ;
41
- Ok ( ac?. map ( |ac| EarlyBinder ( ac) ) )
42
- }
43
-
44
37
pub fn expand_abstract_consts < T : TypeFoldable < TyCtxt < ' tcx > > > ( self , ac : T ) -> T {
45
38
struct Expander < ' tcx > {
46
39
tcx : TyCtxt < ' tcx > ,
@@ -59,7 +52,7 @@ impl<'tcx> TyCtxt<'tcx> {
59
52
}
60
53
fn fold_const ( & mut self , c : Const < ' tcx > ) -> Const < ' tcx > {
61
54
let ct = match c. kind ( ) {
62
- ty:: ConstKind :: Unevaluated ( uv) => match self . tcx . bound_abstract_const ( uv. def ) {
55
+ ty:: ConstKind :: Unevaluated ( uv) => match self . tcx . thir_abstract_const ( uv. def ) {
63
56
Err ( e) => self . tcx . const_error_with_guaranteed ( c. ty ( ) , e) ,
64
57
Ok ( Some ( bac) ) => {
65
58
let substs = self . tcx . erase_regions ( uv. substs ) ;
0 commit comments