@@ -9,7 +9,7 @@ use rustc_hir::HirIdMap;
9
9
use rustc_infer:: infer;
10
10
use rustc_infer:: infer:: { InferCtxt , InferOk , TyCtxtInferExt } ;
11
11
use rustc_middle:: ty:: fold:: TypeFoldable ;
12
- use rustc_middle:: ty:: { self , OpaqueTypeKey , ToPredicate , Ty , TyCtxt } ;
12
+ use rustc_middle:: ty:: { self , OpaqueTypeKey , Ty , TyCtxt } ;
13
13
use rustc_span:: { self , Span } ;
14
14
use rustc_trait_selection:: infer:: InferCtxtExt as _;
15
15
use rustc_trait_selection:: opaque_types:: OpaqueTypeDecl ;
@@ -144,24 +144,8 @@ impl Inherited<'a, 'tcx> {
144
144
}
145
145
}
146
146
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 > ) {
163
148
debug ! ( "register_predicate({:?})" , obligation) ;
164
- self . transform_predicate ( & mut obligation. predicate ) ;
165
149
if obligation. has_escaping_bound_vars ( ) {
166
150
span_bug ! ( obligation. cause. span, "escaping bound vars in predicate {:?}" , obligation) ;
167
151
}
0 commit comments