@@ -99,18 +99,17 @@ pub mod structured_errors;
9999mod variance;
100100
101101use rustc_hir as hir;
102+ use rustc_hir:: def:: DefKind ;
102103use rustc_middle:: middle;
103104use rustc_middle:: query:: Providers ;
104- use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
105+ use rustc_middle:: ty:: { Ty , TyCtxt } ;
105106use rustc_middle:: util;
106107use rustc_session:: parse:: feature_err;
107- use rustc_span:: { symbol:: sym, Span , DUMMY_SP } ;
108+ use rustc_span:: { symbol:: sym, Span } ;
108109use rustc_target:: spec:: abi:: Abi ;
109110use rustc_trait_selection:: traits;
110111
111- use bounds:: Bounds ;
112- use hir_ty_lowering:: { HirTyLowerer , OnlySelfBounds } ;
113- use rustc_hir:: def:: DefKind ;
112+ use hir_ty_lowering:: HirTyLowerer ;
114113
115114rustc_fluent_macro:: fluent_messages! { "../messages.ftl" }
116115
@@ -211,28 +210,3 @@ pub fn lower_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
211210 let item_cx = self :: collect:: ItemCtxt :: new ( tcx, env_def_id. def_id ) ;
212211 item_cx. lowerer ( ) . lower_ty ( hir_ty)
213212}
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