Skip to content

Commit 49aee29

Browse files
committed
Remove lower_trait_to_predicates
Unused since [#]113671.
1 parent c546803 commit 49aee29

File tree

1 file changed

+4
-30
lines changed
  • compiler/rustc_hir_analysis/src

1 file changed

+4
-30
lines changed

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,17 @@ pub mod structured_errors;
9999
mod variance;
100100

101101
use rustc_hir as hir;
102+
use rustc_hir::def::DefKind;
102103
use rustc_middle::middle;
103104
use rustc_middle::query::Providers;
104-
use rustc_middle::ty::{self, Ty, TyCtxt};
105+
use rustc_middle::ty::{Ty, TyCtxt};
105106
use rustc_middle::util;
106107
use rustc_session::parse::feature_err;
107-
use rustc_span::{symbol::sym, Span, DUMMY_SP};
108+
use rustc_span::{symbol::sym, Span};
108109
use rustc_target::spec::abi::Abi;
109110
use 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

115114
rustc_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

Comments
 (0)