@@ -9,7 +9,7 @@ use rustc_hir::HirIdMap;
99use rustc_infer:: infer;
1010use rustc_infer:: infer:: { InferCtxt , InferOk , TyCtxtInferExt } ;
1111use rustc_middle:: ty:: fold:: TypeFoldable ;
12- use rustc_middle:: ty:: { self , OpaqueTypeKey , ToPredicate , Ty , TyCtxt } ;
12+ use rustc_middle:: ty:: { self , OpaqueTypeKey , Ty , TyCtxt } ;
1313use rustc_span:: { self , Span } ;
1414use rustc_trait_selection:: infer:: InferCtxtExt as _;
1515use rustc_trait_selection:: opaque_types:: OpaqueTypeDecl ;
@@ -144,24 +144,8 @@ impl Inherited<'a, 'tcx> {
144144 }
145145 }
146146
147- #[ instrument( level = "debug" , skip( self ) ) ]
148- fn transform_predicate ( & self , p : & mut ty:: Predicate < ' tcx > ) {
149- // Don't transform non-const bounds into const bounds,
150- // but transform const bounds to non-const when we are
151- // not in a const context.
152- if let hir:: Constness :: NotConst = self . constness {
153- let kind = p. kind ( ) ;
154- if let ty:: PredicateKind :: Trait ( pred) = kind. as_ref ( ) . skip_binder ( ) {
155- let mut pred = * pred;
156- pred. constness = hir:: Constness :: NotConst ;
157- * p = kind. rebind ( ty:: PredicateKind :: Trait ( pred) ) . to_predicate ( self . tcx ) ;
158- }
159- }
160- }
161-
162- pub ( super ) fn register_predicate ( & self , mut obligation : traits:: PredicateObligation < ' tcx > ) {
147+ pub ( super ) fn register_predicate ( & self , obligation : traits:: PredicateObligation < ' tcx > ) {
163148 debug ! ( "register_predicate({:?})" , obligation) ;
164- self . transform_predicate ( & mut obligation. predicate ) ;
165149 if obligation. has_escaping_bound_vars ( ) {
166150 span_bug ! ( obligation. cause. span, "escaping bound vars in predicate {:?}" , obligation) ;
167151 }
0 commit comments