use ParamEnv from ty rather than importing

This commit is contained in:
Niko Matsakis
2017-05-15 17:58:58 -04:00
parent 226358e2fb
commit 697146bf40
4 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -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<F, R>(&'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,
@@ -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);
+2 -2
View File
@@ -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();
}
+4 -4
View File
@@ -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 {