From bee6a5ac1274201e7da2081a5aff6b3b1f407185 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Mon, 6 Jan 2020 23:31:06 +0100 Subject: [PATCH] Other crates. --- Cargo.lock | 1 + src/librustc_interface/Cargo.toml | 1 + src/librustc_interface/passes.rs | 2 +- src/librustc_lint/builtin.rs | 2 +- src/librustc_passes/stability.rs | 2 +- src/librustc_ty/common_traits.rs | 3 ++- src/librustc_ty/instance.rs | 2 +- src/librustc_ty/ty.rs | 2 +- src/librustdoc/clean/auto_trait.rs | 2 +- src/librustdoc/clean/blanket_impl.rs | 4 ++-- src/librustdoc/clean/mod.rs | 2 +- src/librustdoc/lib.rs | 1 + 12 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8b4eca99ee..7ff9d419c5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3818,6 +3818,7 @@ dependencies = [ "rustc_expand", "rustc_hir", "rustc_incremental", + "rustc_infer", "rustc_lint", "rustc_metadata", "rustc_mir", diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml index de7a9f4f5af..b3ac5b0fc54 100644 --- a/src/librustc_interface/Cargo.toml +++ b/src/librustc_interface/Cargo.toml @@ -31,6 +31,7 @@ rustc_codegen_ssa = { path = "../librustc_codegen_ssa" } rustc_codegen_utils = { path = "../librustc_codegen_utils" } rustc_codegen_llvm = { path = "../librustc_codegen_llvm", optional = true } rustc_hir = { path = "../librustc_hir" } +rustc_infer = { path = "../librustc_infer" } rustc_metadata = { path = "../librustc_metadata" } rustc_mir = { path = "../librustc_mir" } rustc_mir_build = { path = "../librustc_mir_build" } diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 6224c4654d6..0b4a337051f 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -13,7 +13,6 @@ use rustc::session::config::{self, CrateType, Input, OutputFilenames, OutputType use rustc::session::config::{PpMode, PpSourceMode}; use rustc::session::search_paths::PathKind; use rustc::session::Session; -use rustc::traits; use rustc::ty::steal::Steal; use rustc::ty::{self, GlobalCtxt, ResolverOutputs, TyCtxt}; use rustc::util::common::ErrorReported; @@ -26,6 +25,7 @@ use rustc_errors::PResult; use rustc_expand::base::ExtCtxt; use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_hir::Crate; +use rustc_infer::traits; use rustc_lint::LintStore; use rustc_mir as mir; use rustc_mir_build as mir_build; diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 93fca43d67c..6039fef33e6 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -24,7 +24,6 @@ use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext}; use rustc::hir::map::Map; use rustc::lint::LintDiagnosticBuilder; -use rustc::traits::misc::can_type_implement_copy; use rustc::ty::{self, layout::VariantIdx, Ty, TyCtxt}; use rustc_ast_pretty::pprust::{self, expr_to_string}; use rustc_data_structures::fx::FxHashSet; @@ -36,6 +35,7 @@ use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::DefId; use rustc_hir::{GenericParamKind, PatKind}; use rustc_hir::{HirIdSet, Node}; +use rustc_infer::traits::misc::can_type_implement_copy; use rustc_session::lint::FutureIncompatibleInfo; use rustc_span::edition::Edition; use rustc_span::source_map::Spanned; diff --git a/src/librustc_passes/stability.rs b/src/librustc_passes/stability.rs index 4e2085d07a3..99f005c29e8 100644 --- a/src/librustc_passes/stability.rs +++ b/src/librustc_passes/stability.rs @@ -7,7 +7,6 @@ use rustc::middle::privacy::AccessLevels; use rustc::middle::stability::{DeprecationEntry, Index}; use rustc::session::parse::feature_err; use rustc::session::Session; -use rustc::traits::misc::can_type_implement_copy; use rustc::ty::query::Providers; use rustc::ty::TyCtxt; use rustc_attr::{self as attr, Stability}; @@ -18,6 +17,7 @@ use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc_hir::{Generics, HirId, Item, StructField, Variant}; +use rustc_infer::traits::misc::can_type_implement_copy; use rustc_span::symbol::{sym, Symbol}; use rustc_span::Span; use syntax::ast::Attribute; diff --git a/src/librustc_ty/common_traits.rs b/src/librustc_ty/common_traits.rs index 9fe8a19311f..e0ce6ad23a6 100644 --- a/src/librustc_ty/common_traits.rs +++ b/src/librustc_ty/common_traits.rs @@ -1,8 +1,9 @@ //! Queries for checking whether a type implements one of a few common traits. use rustc::middle::lang_items; -use rustc::traits; use rustc::ty::{self, Ty, TyCtxt}; +use rustc_infer::infer::TyCtxtInferExt; +use rustc_infer::traits; use rustc_span::DUMMY_SP; fn is_copy_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool { diff --git a/src/librustc_ty/instance.rs b/src/librustc_ty/instance.rs index 66f189a5d97..484b774add4 100644 --- a/src/librustc_ty/instance.rs +++ b/src/librustc_ty/instance.rs @@ -1,7 +1,7 @@ -use rustc::traits; use rustc::ty::subst::SubstsRef; use rustc::ty::{self, Instance, TyCtxt, TypeFoldable}; use rustc_hir::def_id::DefId; +use rustc_infer::traits; use rustc_target::spec::abi::Abi; use log::debug; diff --git a/src/librustc_ty/ty.rs b/src/librustc_ty/ty.rs index ddb7c8bc791..f9b2ee3cb8e 100644 --- a/src/librustc_ty/ty.rs +++ b/src/librustc_ty/ty.rs @@ -1,11 +1,11 @@ use rustc::hir::map as hir_map; use rustc::session::CrateDisambiguator; -use rustc::traits::{self}; use rustc::ty::subst::Subst; use rustc::ty::{self, ToPredicate, Ty, TyCtxt, WithConstness}; use rustc_data_structures::svh::Svh; use rustc_hir as hir; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; +use rustc_infer::traits; use rustc_span::symbol::Symbol; use rustc_span::Span; diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index 8edd0591c85..289923b45e6 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -1,7 +1,7 @@ -use rustc::traits::auto_trait::{self, AutoTraitResult}; use rustc::ty::{self, Region, RegionVid, TypeFoldable}; use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; +use rustc_infer::traits::auto_trait::{self, AutoTraitResult}; use std::fmt::Debug; diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index 288446b6219..f7968bf7722 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -1,9 +1,9 @@ -use rustc::infer::InferOk; -use rustc::traits; use rustc::ty::subst::Subst; use rustc::ty::{ToPredicate, WithConstness}; use rustc_hir as hir; use rustc_hir::def_id::LOCAL_CRATE; +use rustc_infer::infer::{InferOk, TyCtxtInferExt}; +use rustc_infer::traits; use rustc_span::DUMMY_SP; use super::*; diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 87edc88611f..ee432647084 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -9,7 +9,6 @@ mod simplify; pub mod types; pub mod utils; -use rustc::infer::region_constraints::{Constraint, RegionConstraintData}; use rustc::middle::lang_items; use rustc::middle::resolve_lifetime as rl; use rustc::middle::stability; @@ -22,6 +21,7 @@ use rustc_hir as hir; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX}; use rustc_index::vec::{Idx, IndexVec}; +use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData}; use rustc_mir::const_eval::is_min_const_fn; use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{kw, sym}; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 4e0a2d94274..eab88b7165d 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -26,6 +26,7 @@ extern crate rustc_expand; extern crate rustc_feature; extern crate rustc_hir; extern crate rustc_index; +extern crate rustc_infer; extern crate rustc_interface; extern crate rustc_lexer; extern crate rustc_lint;