From 697146bf406deaa790915da346b6188220e562be Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 15 May 2017 17:58:58 -0400 Subject: [PATCH] use `ParamEnv` from `ty` rather than importing --- src/librustc/infer/mod.rs | 4 ++-- src/librustc_borrowck/borrowck/mir/gather_moves.rs | 10 +++++----- src/librustc_passes/consts.rs | 4 ++-- src/librustc_trans/context.rs | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 090ad4c2661..88606f977ba 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -28,7 +28,7 @@ use mir::tcx::LvalueTy; use ty::subst::{Kind, Subst, Substs}; use ty::{TyVid, IntVid, FloatVid}; -use ty::{self, ParamEnv, Ty, TyCtxt}; +use ty::{self, Ty, TyCtxt}; use ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric}; use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use ty::relate::{Relate, RelateResult, TypeRelation}; @@ -526,7 +526,7 @@ pub fn enter(&'tcx mut self, f: F) -> R let tables = tables.map(InferTables::Interned).unwrap_or_else(|| { fresh_tables.as_ref().map_or(InferTables::Missing, InferTables::InProgress) }); - let param_env = param_env.take().unwrap_or_else(|| ParamEnv::empty()); + let param_env = param_env.take().unwrap_or_else(|| ty::ParamEnv::empty()); global_tcx.enter_local(arena, |tcx| f(InferCtxt { tcx: tcx, tables: tables, diff --git a/src/librustc_borrowck/borrowck/mir/gather_moves.rs b/src/librustc_borrowck/borrowck/mir/gather_moves.rs index cf56a705839..931cdf4f686 100644 --- a/src/librustc_borrowck/borrowck/mir/gather_moves.rs +++ b/src/librustc_borrowck/borrowck/mir/gather_moves.rs @@ -9,7 +9,7 @@ // except according to those terms. -use rustc::ty::{self, TyCtxt, ParamEnv}; +use rustc::ty::{self, TyCtxt}; use rustc::mir::*; use rustc::util::nodemap::FxHashMap; use rustc_data_structures::indexed_vec::{IndexVec}; @@ -191,7 +191,7 @@ pub struct MovePathLookup<'tcx> { struct MoveDataBuilder<'a, 'tcx: 'a> { mir: &'a Mir<'tcx>, tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env: ParamEnv<'tcx>, + param_env: ty::ParamEnv<'tcx>, data: MoveData<'tcx>, } @@ -203,7 +203,7 @@ pub enum MovePathError { impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> { fn new(mir: &'a Mir<'tcx>, tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env: ParamEnv<'tcx>) + param_env: ty::ParamEnv<'tcx>) -> Self { let mut move_paths = IndexVec::new(); let mut path_map = IndexVec::new(); @@ -370,7 +370,7 @@ pub fn find(&self, lval: &Lvalue<'tcx>) -> LookupResult { impl<'a, 'tcx> MoveData<'tcx> { pub fn gather_moves(mir: &Mir<'tcx>, tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env: ParamEnv<'tcx>) + param_env: ty::ParamEnv<'tcx>) -> Self { gather_moves(mir, tcx, param_env) } @@ -378,7 +378,7 @@ pub fn gather_moves(mir: &Mir<'tcx>, fn gather_moves<'a, 'tcx>(mir: &Mir<'tcx>, tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env: ParamEnv<'tcx>) + param_env: ty::ParamEnv<'tcx>) -> MoveData<'tcx> { let mut builder = MoveDataBuilder::new(mir, tcx, param_env); diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index 8b58e71a0d6..6f966be857a 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -38,7 +38,7 @@ use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization::Categorization; use rustc::mir::transform::MirSource; -use rustc::ty::{self, ParamEnv, Ty, TyCtxt}; +use rustc::ty::{self, Ty, TyCtxt}; use rustc::traits::Reveal; use rustc::util::common::ErrorReported; use rustc::util::nodemap::NodeSet; @@ -466,7 +466,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { in_fn: false, promotable: false, mut_rvalue_borrows: NodeSet(), - param_env: ParamEnv::empty(), + param_env: ty::ParamEnv::empty(), }.as_deep_visitor()); tcx.sess.abort_if_errors(); } diff --git a/src/librustc_trans/context.rs b/src/librustc_trans/context.rs index 5a1b8d96cbc..0dece586c93 100644 --- a/src/librustc_trans/context.rs +++ b/src/librustc_trans/context.rs @@ -24,7 +24,7 @@ use type_::Type; use rustc_data_structures::base_n; use rustc::ty::subst::Substs; -use rustc::ty::{self, ParamEnv, Ty, TyCtxt}; +use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::layout::{LayoutTyper, TyLayout}; use session::config::NoDebugInfo; use session::Session; @@ -321,15 +321,15 @@ pub fn new(tcx: TyCtxt<'b, 'tcx, 'tcx>, } pub fn type_needs_drop(&self, ty: Ty<'tcx>) -> bool { - ty.needs_drop(self.tcx, ParamEnv::empty()) + ty.needs_drop(self.tcx, ty::ParamEnv::empty()) } pub fn type_is_sized(&self, ty: Ty<'tcx>) -> bool { - ty.is_sized(self.tcx, ParamEnv::empty(), DUMMY_SP) + ty.is_sized(self.tcx, ty::ParamEnv::empty(), DUMMY_SP) } pub fn type_is_freeze(&self, ty: Ty<'tcx>) -> bool { - ty.is_freeze(self.tcx, ParamEnv::empty(), DUMMY_SP) + ty.is_freeze(self.tcx, ty::ParamEnv::empty(), DUMMY_SP) } pub fn exported_symbols<'a>(&'a self) -> &'a NodeSet { -- 2.44.0