@@ -99,18 +99,17 @@ pub mod structured_errors;
99
99
mod variance;
100
100
101
101
use rustc_hir as hir;
102
+ use rustc_hir:: def:: DefKind ;
102
103
use rustc_middle:: middle;
103
104
use rustc_middle:: query:: Providers ;
104
- use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
105
+ use rustc_middle:: ty:: { Ty , TyCtxt } ;
105
106
use rustc_middle:: util;
106
107
use rustc_session:: parse:: feature_err;
107
- use rustc_span:: { symbol:: sym, Span , DUMMY_SP } ;
108
+ use rustc_span:: { symbol:: sym, Span } ;
108
109
use rustc_target:: spec:: abi:: Abi ;
109
110
use rustc_trait_selection:: traits;
110
111
111
- use bounds:: Bounds ;
112
- use hir_ty_lowering:: { HirTyLowerer , OnlySelfBounds } ;
113
- use rustc_hir:: def:: DefKind ;
112
+ use hir_ty_lowering:: HirTyLowerer ;
114
113
115
114
rustc_fluent_macro:: fluent_messages! { "../messages.ftl" }
116
115
@@ -211,28 +210,3 @@ pub fn lower_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
211
210
let item_cx = self :: collect:: ItemCtxt :: new ( tcx, env_def_id. def_id ) ;
212
211
item_cx. lowerer ( ) . lower_ty ( hir_ty)
213
212
}
214
-
215
- pub fn lower_trait_to_predicates < ' tcx > (
216
- tcx : TyCtxt < ' tcx > ,
217
- hir_trait : & hir:: TraitRef < ' tcx > ,
218
- self_ty : Ty < ' tcx > ,
219
- ) -> Bounds < ' tcx > {
220
- // In case there are any projections, etc., find the "environment"
221
- // def-ID that will be used to determine the traits/predicates in
222
- // scope. This is derived from the enclosing item-like thing.
223
- let env_def_id = tcx. hir ( ) . get_parent_item ( hir_trait. hir_ref_id ) ;
224
- let item_cx = self :: collect:: ItemCtxt :: new ( tcx, env_def_id. def_id ) ;
225
- let mut bounds = Bounds :: default ( ) ;
226
- let _ = & item_cx. lowerer ( ) . lower_poly_trait_ref (
227
- hir_trait,
228
- DUMMY_SP ,
229
- ty:: BoundConstness :: NotConst ,
230
- ty:: ImplPolarity :: Positive ,
231
- self_ty,
232
- & mut bounds,
233
- true ,
234
- OnlySelfBounds ( false ) ,
235
- ) ;
236
-
237
- bounds
238
- }
0 commit comments