From 1973f277a3e79861df2f5bff88aedaf127d833c8 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Wed, 16 Feb 2022 15:01:19 +1100 Subject: [PATCH] Cleanup uses --- compiler/rustc_typeck/src/check/method/suggest.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_typeck/src/check/method/suggest.rs b/compiler/rustc_typeck/src/check/method/suggest.rs index 7f9f1a3270185..fc9e14b0000c0 100644 --- a/compiler/rustc_typeck/src/check/method/suggest.rs +++ b/compiler/rustc_typeck/src/check/method/suggest.rs @@ -9,8 +9,10 @@ use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::lang_items::LangItem; use rustc_hir::{ExprKind, Node, QPath}; use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; +use rustc_middle::traits::util::supertraits; use rustc_middle::ty::fast_reject::{simplify_type, SimplifyParams}; use rustc_middle::ty::print::with_crate_prefix; +use rustc_middle::ty::ToPolyTraitRef; use rustc_middle::ty::{self, DefIdTree, ToPredicate, Ty, TyCtxt, TypeFoldable}; use rustc_span::lev_distance; use rustc_span::symbol::{kw, sym, Ident}; @@ -1212,12 +1214,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if can_derive { let self_name = trait_pred.self_ty().to_string(); let self_span = self.tcx.def_span(adt.did); - use crate::rustc_middle::ty::ToPolyTraitRef; if let Some(poly_trait_ref) = pred.to_opt_poly_trait_pred() { - for super_trait in rustc_middle::traits::util::supertraits( - self.tcx, - poly_trait_ref.to_poly_trait_ref(), - ) { + for super_trait in supertraits(self.tcx, poly_trait_ref.to_poly_trait_ref()) + { if let Some(parent_diagnostic_name) = self.tcx.get_diagnostic_name(super_trait.def_id()) {