@@ -4,7 +4,6 @@ use crate::ty::{
44 TypeVisitableExt ,
55} ;
66use rustc_errors:: ErrorGuaranteed ;
7- use rustc_hir:: def_id:: DefId ;
87
98#[ derive( Hash , Debug , Clone , Copy , Ord , PartialOrd , PartialEq , Eq ) ]
109#[ derive( TyDecodable , TyEncodable , HashStable , TypeVisitable , TypeFoldable ) ]
@@ -35,12 +34,6 @@ TrivialTypeTraversalAndLiftImpls! {
3534pub type BoundAbstractConst < ' tcx > = Result < Option < EarlyBinder < ty:: Const < ' tcx > > > , ErrorGuaranteed > ;
3635
3736impl < ' 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-
4437 pub fn expand_abstract_consts < T : TypeFoldable < TyCtxt < ' tcx > > > ( self , ac : T ) -> T {
4538 struct Expander < ' tcx > {
4639 tcx : TyCtxt < ' tcx > ,
@@ -59,7 +52,7 @@ impl<'tcx> TyCtxt<'tcx> {
5952 }
6053 fn fold_const ( & mut self , c : Const < ' tcx > ) -> Const < ' tcx > {
6154 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 ) {
6356 Err ( e) => self . tcx . const_error_with_guaranteed ( c. ty ( ) , e) ,
6457 Ok ( Some ( bac) ) => {
6558 let substs = self . tcx . erase_regions ( uv. substs ) ;
0 commit comments