From 00861d100dabcb6698963663b5a59f51f1b58e79 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 15 Mar 2020 05:26:32 +0900 Subject: [PATCH] Rustup to rust-lang/rust#69076 --- clippy_lints/src/len_zero.rs | 2 +- clippy_lints/src/lib.rs | 2 ++ clippy_lints/src/needless_pass_by_value.rs | 4 ++-- clippy_lints/src/utils/mod.rs | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/len_zero.rs b/clippy_lints/src/len_zero.rs index 48881e1c2..00cfb3b71 100644 --- a/clippy_lints/src/len_zero.rs +++ b/clippy_lints/src/len_zero.rs @@ -134,7 +134,7 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item<'_>, trait_i // fill the set with current and super traits fn fill_trait_set(traitt: DefId, set: &mut FxHashSet, cx: &LateContext<'_, '_>) { if set.insert(traitt) { - for supertrait in rustc_infer::traits::supertrait_def_ids(cx.tcx, traitt) { + for supertrait in rustc_trait_selection::traits::supertrait_def_ids(cx.tcx, traitt) { fill_trait_set(supertrait, set, cx); } } diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 1eac69678..791307ba4 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -51,6 +51,8 @@ extern crate rustc_span; #[allow(unused_extern_crates)] extern crate rustc_target; #[allow(unused_extern_crates)] +extern crate rustc_trait_selection; +#[allow(unused_extern_crates)] extern crate rustc_typeck; use rustc::session::Session; diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index 013433417..d2d2b48c9 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -12,12 +12,12 @@ use rustc_errors::{Applicability, DiagnosticBuilder}; use rustc_hir::intravisit::FnKind; use rustc_hir::{BindingAnnotation, Body, FnDecl, GenericArg, HirId, ItemKind, Node, PatKind, QPath, TyKind}; use rustc_infer::infer::TyCtxtInferExt; -use rustc_infer::traits; -use rustc_infer::traits::misc::can_type_implement_copy; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::{Span, Symbol}; use rustc_target::spec::abi::Abi; +use rustc_trait_selection::traits; +use rustc_trait_selection::traits::misc::can_type_implement_copy; use rustc_typeck::expr_use_visitor as euv; use std::borrow::Cow; diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 9f7cf4007..e32164c8b 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -47,12 +47,14 @@ use rustc_hir::{ MatchSource, Param, Pat, PatKind, Path, PathSegment, QPath, TraitItem, TraitItemKind, TraitRef, TyKind, Unsafety, }; use rustc_infer::infer::TyCtxtInferExt; -use rustc_infer::traits::predicate_for_trait_def; use rustc_lint::{LateContext, Level, Lint, LintContext}; use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_span::source_map::original_sp; use rustc_span::symbol::{self, kw, Symbol}; use rustc_span::{BytePos, Pos, Span, DUMMY_SP}; +use rustc_trait_selection::traits::predicate_for_trait_def; +use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; +use rustc_trait_selection::traits::query::normalize::AtExt; use smallvec::SmallVec; use crate::consts::{constant, Constant}; @@ -1387,7 +1389,7 @@ pub fn is_trait_impl_item(cx: &LateContext<'_, '_>, hir_id: HirId) -> bool { /// } /// ``` pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool { - use rustc_infer::traits; + use rustc_trait_selection::traits; let predicates = cx .tcx .predicates_of(did)