// not a hotspot.
ProjectionCache { def_ids: Vec<D> },
- ParameterEnvironment(D),
+ ParamEnv(D),
DescribeDef(D),
DefSpan(D),
Stability(D),
let def_ids: Option<Vec<E>> = def_ids.iter().map(op).collect();
def_ids.map(|d| ProjectionCache { def_ids: d })
}
- ParameterEnvironment(ref d) => op(d).map(ParameterEnvironment),
+ ParamEnv(ref d) => op(d).map(ParamEnv),
DescribeDef(ref d) => op(d).map(DescribeDef),
DefSpan(ref d) => op(d).map(DefSpan),
Stability(ref d) => op(d).map(Stability),
use mir::tcx::LvalueTy;
use ty::subst::{Kind, Subst, Substs};
use ty::{TyVid, IntVid, FloatVid};
-use ty::{self, ParameterEnvironment, Ty, TyCtxt};
+use ty::{self, ParamEnv, Ty, TyCtxt};
use ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric};
use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor};
use ty::relate::{Relate, RelateResult, TypeRelation};
// For region variables.
region_vars: RegionVarBindings<'a, 'gcx, 'tcx>,
- pub parameter_environment: ty::ParameterEnvironment<'gcx>,
+ pub parameter_environment: ty::ParamEnv<'gcx>,
/// Caches the results of trait selection. This cache is used
/// for things that have to do with the parameters in scope.
fn to_parts(self, tcx: TyCtxt<'a, 'tcx, 'tcx>)
-> (Option<&'a ty::TypeckTables<'tcx>>,
Option<ty::TypeckTables<'tcx>>,
- Option<ty::ParameterEnvironment<'tcx>>);
+ Option<ty::ParamEnv<'tcx>>);
}
impl<'a, 'tcx> InferEnv<'a, 'tcx> for () {
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
-> (Option<&'a ty::TypeckTables<'tcx>>,
Option<ty::TypeckTables<'tcx>>,
- Option<ty::ParameterEnvironment<'tcx>>) {
+ Option<ty::ParamEnv<'tcx>>) {
(None, None, None)
}
}
-impl<'a, 'tcx> InferEnv<'a, 'tcx> for ty::ParameterEnvironment<'tcx> {
+impl<'a, 'tcx> InferEnv<'a, 'tcx> for ty::ParamEnv<'tcx> {
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
-> (Option<&'a ty::TypeckTables<'tcx>>,
Option<ty::TypeckTables<'tcx>>,
- Option<ty::ParameterEnvironment<'tcx>>) {
+ Option<ty::ParamEnv<'tcx>>) {
(None, None, Some(self))
}
}
-impl<'a, 'tcx> InferEnv<'a, 'tcx> for (&'a ty::TypeckTables<'tcx>, ty::ParameterEnvironment<'tcx>) {
+impl<'a, 'tcx> InferEnv<'a, 'tcx> for (&'a ty::TypeckTables<'tcx>, ty::ParamEnv<'tcx>) {
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
-> (Option<&'a ty::TypeckTables<'tcx>>,
Option<ty::TypeckTables<'tcx>>,
- Option<ty::ParameterEnvironment<'tcx>>) {
+ Option<ty::ParamEnv<'tcx>>) {
(Some(self.0), None, Some(self.1))
}
}
-impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::TypeckTables<'tcx>, ty::ParameterEnvironment<'tcx>) {
+impl<'a, 'tcx> InferEnv<'a, 'tcx> for (ty::TypeckTables<'tcx>, ty::ParamEnv<'tcx>) {
fn to_parts(self, _: TyCtxt<'a, 'tcx, 'tcx>)
-> (Option<&'a ty::TypeckTables<'tcx>>,
Option<ty::TypeckTables<'tcx>>,
- Option<ty::ParameterEnvironment<'tcx>>) {
+ Option<ty::ParamEnv<'tcx>>) {
(None, Some(self.0), Some(self.1))
}
}
fn to_parts(self, tcx: TyCtxt<'a, 'tcx, 'tcx>)
-> (Option<&'a ty::TypeckTables<'tcx>>,
Option<ty::TypeckTables<'tcx>>,
- Option<ty::ParameterEnvironment<'tcx>>) {
+ Option<ty::ParamEnv<'tcx>>) {
let def_id = tcx.hir.body_owner_def_id(self);
(Some(tcx.typeck_tables_of(def_id)),
None,
arena: DroplessArena,
fresh_tables: Option<RefCell<ty::TypeckTables<'tcx>>>,
tables: Option<&'a ty::TypeckTables<'gcx>>,
- param_env: Option<ty::ParameterEnvironment<'gcx>>,
+ param_env: Option<ty::ParamEnv<'gcx>>,
projection_mode: Reveal,
}
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(|| ParameterEnvironment::empty());
+ let param_env = param_env.take().unwrap_or_else(|| ParamEnv::empty());
global_tcx.enter_local(arena, |tcx| f(InferCtxt {
tcx: tcx,
tables: tables,
}
pub fn normalize_associated_type_in_env<T>(
- self, value: &T, env: ty::ParameterEnvironment<'tcx>
+ self, value: &T, env: ty::ParamEnv<'tcx>
) -> T
where T: TransNormalize<'tcx>
{
self.tables.borrow().upvar_capture_map.get(&upvar_id).cloned()
}
- pub fn param_env(&self) -> ty::ParameterEnvironment<'gcx> {
+ pub fn param_env(&self) -> ty::ParamEnv<'gcx> {
self.parameter_environment
}
One subtle interaction is that the results of trait lookup will vary
depending on what where clauses are in scope. Therefore, we actually
have *two* caches, a local and a global cache. The local cache is
-attached to the `ParameterEnvironment` and the global cache attached
+attached to ParamEnv` and the global cache attached
to the `tcx`. We use the local cache whenever the result might depend
on the where clauses that are in scope. The determination of which
cache to use is done by the method `pick_candidate_cache` in
/// Normalizes the parameter environment, reporting errors if they occur.
pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
region_context: DefId,
- unnormalized_env: ty::ParameterEnvironment<'tcx>,
+ unnormalized_env: ty::ParamEnv<'tcx>,
cause: ObligationCause<'tcx>)
- -> ty::ParameterEnvironment<'tcx>
+ -> ty::ParamEnv<'tcx>
{
// I'm not wild about reporting errors here; I'd prefer to
// have the errors get reported at a defined place (e.g.,
debug!("normalize_param_env_or_error: elaborated-predicates={:?}",
predicates);
- let elaborated_env = ty::ParameterEnvironment::new(tcx.intern_predicates(&predicates));
+ let elaborated_env = ty::ParamEnv::new(tcx.intern_predicates(&predicates));
tcx.infer_ctxt(elaborated_env, Reveal::UserFacing).enter(|infcx| {
let predicates = match fully_normalize(
// You would really want to pass infcx.parameter_environment.caller_bounds here,
// but that is an interned slice, and fully_normalize takes &T and returns T, so
// without further refactoring, a slice can't be used. Luckily, we still have the
- // predicate vector from which we created the ParameterEnvironment in infcx, so we
+ // predicate vector from which we created the ParamEnv in infcx, so we
// can pass that instead. It's roundabout and a bit brittle, but this code path
// ought to be refactored anyway, and until then it saves us from having to copy.
&predicates,
debug!("normalize_param_env_or_error: resolved predicates={:?}",
predicates);
- ty::ParameterEnvironment::new(tcx.intern_predicates(&predicates))
+ ty::ParamEnv::new(tcx.intern_predicates(&predicates))
})
}
self.infcx.tcx
}
- pub fn param_env(&self) -> ty::ParameterEnvironment<'gcx> {
+ pub fn param_env(&self) -> ty::ParamEnv<'gcx> {
self.infcx.param_env()
}
}
}
-impl<'tcx, T: Clone + Hash + Eq + Debug> Key for ty::ParameterEnvironmentAnd<'tcx, T> {
+impl<'tcx, T: Clone + Hash + Eq + Debug> Key for ty::ParamEnvAnd<'tcx, T> {
fn map_crate(&self) -> CrateNum {
LOCAL_CRATE
}
}
impl<'tcx> QueryDescription for queries::is_copy_raw<'tcx> {
- fn describe(_tcx: TyCtxt, env: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> String {
+ fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
format!("computing whether `{}` is `Copy`", env.value)
}
}
impl<'tcx> QueryDescription for queries::is_sized_raw<'tcx> {
- fn describe(_tcx: TyCtxt, env: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> String {
+ fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
format!("computing whether `{}` is `Sized`", env.value)
}
}
impl<'tcx> QueryDescription for queries::is_freeze_raw<'tcx> {
- fn describe(_tcx: TyCtxt, env: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> String {
+ fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
format!("computing whether `{}` is freeze", env.value)
}
}
impl<'tcx> QueryDescription for queries::needs_drop_raw<'tcx> {
- fn describe(_tcx: TyCtxt, env: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> String {
+ fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
format!("computing whether `{}` needs drop", env.value)
}
}
[] specialization_graph_of: SpecializationGraph(DefId) -> Rc<specialization_graph::Graph>,
[] is_object_safe: ObjectSafety(DefId) -> bool,
- [] parameter_environment: ParameterEnvironment(DefId) -> ty::ParameterEnvironment<'tcx>,
+ [] parameter_environment: ParamEnv(DefId) -> ty::ParamEnv<'tcx>,
// Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
// `ty.is_copy()`, etc, since that will prune the environment where possible.
- [] is_copy_raw: is_copy_dep_node(ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> bool,
- [] is_sized_raw: is_sized_dep_node(ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> bool,
- [] is_freeze_raw: is_freeze_dep_node(ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> bool,
- [] needs_drop_raw: needs_drop_dep_node(ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> bool,
+ [] is_copy_raw: is_copy_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
+ [] is_sized_raw: is_sized_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
+ [] is_freeze_raw: is_freeze_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
+ [] needs_drop_raw: needs_drop_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool,
}
fn coherent_trait_dep_node((_, def_id): (CrateNum, DefId)) -> DepNode<DefId> {
DepNode::TraitImpls(def_id)
}
-fn is_copy_dep_node<'tcx>(_: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
+fn is_copy_dep_node<'tcx>(_: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
let krate_def_id = DefId::local(CRATE_DEF_INDEX);
DepNode::IsCopy(krate_def_id)
}
-fn is_sized_dep_node<'tcx>(_: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
+fn is_sized_dep_node<'tcx>(_: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
let krate_def_id = DefId::local(CRATE_DEF_INDEX);
DepNode::IsSized(krate_def_id)
}
-fn is_freeze_dep_node<'tcx>(_: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
+fn is_freeze_dep_node<'tcx>(_: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
let krate_def_id = DefId::local(CRATE_DEF_INDEX);
DepNode::IsSized(krate_def_id)
}
-fn needs_drop_dep_node<'tcx>(_: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
+fn needs_drop_dep_node<'tcx>(_: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> DepNode<DefId> {
let krate_def_id = DefId::local(CRATE_DEF_INDEX);
DepNode::NeedsDrop(krate_def_id)
}
}
}
-/// When type checking, we use the `ParameterEnvironment` to track
+/// When type checking, we use the `ParamEnv` to track
/// details about the set of where-clauses that are in scope at this
/// particular point.
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
-pub struct ParameterEnvironment<'tcx> {
+pub struct ParamEnv<'tcx> {
/// Obligations that the caller must satisfy. This is basically
/// the set of bounds on the in-scope type parameters, translated
/// into Obligations, and elaborated and normalized.
pub caller_bounds: &'tcx Slice<ty::Predicate<'tcx>>,
}
-impl<'tcx> ParameterEnvironment<'tcx> {
+impl<'tcx> ParamEnv<'tcx> {
/// Creates a suitable environment in which to perform trait
/// queries on the given value. This will either be `self` *or*
/// the empty environment, depending on whether `value` references
/// effectively, when type-checking the body of said
/// function. This preserves existing behavior in any
/// case. --nmatsakis
- pub fn and<T: TypeFoldable<'tcx>>(self, value: T) -> ParameterEnvironmentAnd<'tcx, T> {
+ pub fn and<T: TypeFoldable<'tcx>>(self, value: T) -> ParamEnvAnd<'tcx, T> {
assert!(!value.needs_infer());
if value.has_param_types() || value.has_self_ty() {
- ParameterEnvironmentAnd {
+ ParamEnvAnd {
param_env: self,
value: value,
}
} else {
- ParameterEnvironmentAnd {
- param_env: ParameterEnvironment::empty(),
+ ParamEnvAnd {
+ param_env: ParamEnv::empty(),
value: value,
}
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
-pub struct ParameterEnvironmentAnd<'tcx, T> {
- pub param_env: ParameterEnvironment<'tcx>,
+pub struct ParamEnvAnd<'tcx, T> {
+ pub param_env: ParamEnv<'tcx>,
pub value: T,
}
-impl<'tcx, T> ParameterEnvironmentAnd<'tcx, T> {
- pub fn into_parts(self) -> (ParameterEnvironment<'tcx>, T) {
+impl<'tcx, T> ParamEnvAnd<'tcx, T> {
+ pub fn into_parts(self) -> (ParamEnv<'tcx>, T) {
(self.param_env, self.value)
}
}
})
}
-/// See `ParameterEnvironment` struct def'n for details.
+/// See `ParamEnv` struct def'n for details.
fn parameter_environment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId)
- -> ParameterEnvironment<'tcx> {
+ -> ParamEnv<'tcx> {
// Compute the bounds on Self and the type parameters.
let bounds = tcx.predicates_of(def_id).instantiate_identity(tcx);
// are any errors at that point, so after type checking you can be
// sure that this will succeed without errors anyway.
- let unnormalized_env = ty::ParameterEnvironment::new(tcx.intern_predicates(&predicates));
+ let unnormalized_env = ty::ParamEnv::new(tcx.intern_predicates(&predicates));
let body_id = tcx.hir.as_local_node_id(def_id).map_or(DUMMY_NODE_ID, |id| {
tcx.hir.maybe_body_owned_by(id).map_or(id, |body| body.node_id)
use ich::{StableHashingContext, NodeIdHashingMode};
use traits::{self, Reveal};
use ty::{self, Ty, TyCtxt, TypeFoldable};
-use ty::ParameterEnvironment;
+use ty::ParamEnv;
use ty::fold::TypeVisitor;
use ty::layout::{Layout, LayoutError};
use ty::subst::{Subst, Kind};
SelfRecursive(Vec<Span>),
}
-impl<'tcx> ParameterEnvironment<'tcx> {
+impl<'tcx> ParamEnv<'tcx> {
/// Construct a trait environment suitable for contexts where
/// there are no where clauses in scope.
pub fn empty() -> Self {
/// Construct a trait environment with the given set of predicates.
pub fn new(caller_bounds: &'tcx ty::Slice<ty::Predicate<'tcx>>) -> Self {
- ty::ParameterEnvironment { caller_bounds }
+ ty::ParamEnv { caller_bounds }
}
pub fn can_type_implement_copy<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>,
impl<'a, 'tcx> ty::TyS<'tcx> {
pub fn moves_by_default(&'tcx self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>,
+ param_env: ParamEnv<'tcx>,
span: Span)
-> bool {
!tcx.at(span).is_copy_raw(param_env.and(self))
pub fn is_sized(&'tcx self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>,
+ param_env: ParamEnv<'tcx>,
span: Span)-> bool
{
tcx.at(span).is_sized_raw(param_env.and(self))
pub fn is_freeze(&'tcx self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>,
+ param_env: ParamEnv<'tcx>,
span: Span)-> bool
{
tcx.at(span).is_freeze_raw(param_env.and(self))
#[inline]
pub fn needs_drop(&'tcx self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>)
+ param_env: ty::ParamEnv<'tcx>)
-> bool {
tcx.needs_drop_raw(param_env.and(self))
}
}
fn is_copy_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- query: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>)
+ query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
-> bool
{
let (param_env, ty) = query.into_parts();
}
fn is_sized_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- query: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>)
+ query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
-> bool
{
let (param_env, ty) = query.into_parts();
}
fn is_freeze_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- query: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>)
+ query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
-> bool
{
let (param_env, ty) = query.into_parts();
}
fn needs_drop_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- query: ty::ParameterEnvironmentAnd<'tcx, Ty<'tcx>>)
+ query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
-> bool
{
let (param_env, ty) = query.into_parts();
ty::TyAdt(def, _) if def.has_dtor(tcx) => true,
// Can refer to a type which may drop.
- // FIXME(eddyb) check this against a ParameterEnvironment.
+ // FIXME(eddyb) check this against a ParamEnv.
ty::TyDynamic(..) | ty::TyProjection(..) | ty::TyParam(_) |
ty::TyAnon(..) | ty::TyInfer(_) | ty::TyError => true,
dfcx_loans: &'a LoanDataFlow<'a, 'tcx>,
move_data: &'a move_data::FlowedMoveData<'a, 'tcx>,
all_loans: &'a [Loan<'tcx>],
- param_env: &'a ty::ParameterEnvironment<'tcx>,
+ param_env: &'a ty::ParamEnv<'tcx>,
}
impl<'a, 'tcx> euv::Delegate<'tcx> for CheckLoanCtxt<'a, 'tcx> {
self.ctxt.tcx
}
- fn param_env(&self) -> ty::ParameterEnvironment<'tcx> {
+ fn param_env(&self) -> ty::ParamEnv<'tcx> {
self.ctxt.param_env()
}
impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
fn move_data(&self) -> &'b MoveData<'tcx> { &self.env.move_data }
- fn param_env(&self) -> ty::ParameterEnvironment<'tcx> {
+ fn param_env(&self) -> ty::ParamEnv<'tcx> {
self.env.param_env
}
// except according to those terms.
-use rustc::ty::{self, TyCtxt, ParameterEnvironment};
+use rustc::ty::{self, TyCtxt, ParamEnv};
use rustc::mir::*;
use rustc::util::nodemap::FxHashMap;
use rustc_data_structures::indexed_vec::{IndexVec};
struct MoveDataBuilder<'a, 'tcx: 'a> {
mir: &'a Mir<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>,
+ param_env: ParamEnv<'tcx>,
data: MoveData<'tcx>,
}
impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
fn new(mir: &'a Mir<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>)
+ param_env: ParamEnv<'tcx>)
-> Self {
let mut move_paths = IndexVec::new();
let mut path_map = IndexVec::new();
impl<'a, 'tcx> MoveData<'tcx> {
pub fn gather_moves(mir: &Mir<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>)
+ param_env: ParamEnv<'tcx>)
-> Self {
gather_moves(mir, tcx, param_env)
}
fn gather_moves<'a, 'tcx>(mir: &Mir<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ParameterEnvironment<'tcx>)
+ param_env: ParamEnv<'tcx>)
-> MoveData<'tcx> {
let mut builder = MoveDataBuilder::new(mir, tcx, param_env);
pub struct MoveDataParamEnv<'tcx> {
move_data: MoveData<'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
}
pub fn borrowck_mir(bcx: &mut BorrowckCtxt,
lp: &LoanPath<'tcx>,
the_move: &move_data::Move,
moved_lp: &LoanPath<'tcx>,
- _param_env: &ty::ParameterEnvironment<'tcx>) {
+ _param_env: &ty::ParamEnv<'tcx>) {
let (verb, verb_participle) = match use_kind {
MovedInUse => ("use", "used"),
MovedInCapture => ("capture", "captured"),
struct MatchVisitor<'a, 'tcx: 'a> {
tcx: TyCtxt<'a, 'tcx, 'tcx>,
tables: &'a ty::TypeckTables<'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
region_maps: &'a RegionMaps,
}
if def.has_dtor(cx.tcx) {
return;
}
- let param_env = ty::ParameterEnvironment::empty();
+ let param_env = ty::ParamEnv::empty();
if !ty.moves_by_default(cx.tcx, param_env, item.span) {
return;
}
mir: &'a Mir<'tcx>,
patch: MirPatch<'tcx>,
tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
}
impl<'a, 'tcx> fmt::Debug for DropShimElaborator<'a, 'tcx> {
fn patch(&mut self) -> &mut MirPatch<'tcx> { &mut self.patch }
fn mir(&self) -> &'a Mir<'tcx> { self.mir }
fn tcx(&self) -> ty::TyCtxt<'a, 'tcx, 'tcx> { self.tcx }
- fn param_env(&self) -> ty::ParameterEnvironment<'tcx> { self.param_env }
+ fn param_env(&self) -> ty::ParamEnv<'tcx> { self.param_env }
fn drop_style(&self, _path: Self::Path, mode: DropFlagMode) -> DropStyle {
if let DropFlagMode::Shallow = mode {
}
}
-fn type_size_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, param_env: ty::ParameterEnvironment<'tcx>,
+fn type_size_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, param_env: ty::ParamEnv<'tcx>,
ty: Ty<'tcx>) -> Option<u64> {
tcx.infer_ctxt(param_env, traits::Reveal::All).enter(|infcx| {
ty.layout(&infcx).ok().map(|layout| {
/// Remove flags which are impossible for the given type.
fn restrict(&mut self, ty: Ty<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>) {
+ param_env: ty::ParamEnv<'tcx>) {
if ty.is_freeze(tcx, param_env, DUMMY_SP) {
*self = *self - Qualif::MUTABLE_INTERIOR;
}
mir: &'a Mir<'tcx>,
rpo: ReversePostorder<'a, 'tcx>,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
temp_qualif: IndexVec<Local, Option<Qualif>>,
return_qualif: Option<Qualif>,
qualif: Qualif,
impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ty::ParameterEnvironment<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
def_id: DefId,
mir: &'a Mir<'tcx>,
mode: Mode)
fn patch(&mut self) -> &mut MirPatch<'tcx>;
fn mir(&self) -> &'a Mir<'tcx>;
fn tcx(&self) -> ty::TyCtxt<'a, 'tcx, 'tcx>;
- fn param_env(&self) -> ty::ParameterEnvironment<'tcx>;
+ fn param_env(&self) -> ty::ParamEnv<'tcx>;
fn drop_style(&self, path: Self::Path, mode: DropFlagMode) -> DropStyle;
fn get_drop_flag(&mut self, path: Self::Path) -> Option<Operand<'tcx>>;
use rustc::middle::mem_categorization as mc;
use rustc::middle::mem_categorization::Categorization;
use rustc::mir::transform::MirSource;
-use rustc::ty::{self, ParameterEnvironment, Ty, TyCtxt};
+use rustc::ty::{self, ParamEnv, Ty, TyCtxt};
use rustc::traits::Reveal;
use rustc::util::common::ErrorReported;
use rustc::util::nodemap::NodeSet;
in_fn: bool,
promotable: bool,
mut_rvalue_borrows: NodeSet,
- param_env: ty::ParameterEnvironment<'tcx>,
+ param_env: ty::ParamEnv<'tcx>,
tables: &'a ty::TypeckTables<'tcx>,
}
in_fn: false,
promotable: false,
mut_rvalue_borrows: NodeSet(),
- param_env: ParameterEnvironment::empty(),
+ param_env: ParamEnv::empty(),
}.as_deep_visitor());
tcx.sess.abort_if_errors();
}
use type_::Type;
use rustc_data_structures::base_n;
use rustc::ty::subst::Substs;
-use rustc::ty::{self, ParameterEnvironment, Ty, TyCtxt};
+use rustc::ty::{self, ParamEnv, Ty, TyCtxt};
use rustc::ty::layout::{LayoutTyper, TyLayout};
use session::config::NoDebugInfo;
use session::Session;
}
pub fn type_needs_drop(&self, ty: Ty<'tcx>) -> bool {
- ty.needs_drop(self.tcx, ParameterEnvironment::empty())
+ ty.needs_drop(self.tcx, ParamEnv::empty())
}
pub fn type_is_sized(&self, ty: Ty<'tcx>) -> bool {
- ty.is_sized(self.tcx, ParameterEnvironment::empty(), DUMMY_SP)
+ ty.is_sized(self.tcx, ParamEnv::empty(), DUMMY_SP)
}
pub fn type_is_freeze(&self, ty: Ty<'tcx>) -> bool {
- ty.is_freeze(self.tcx, ParameterEnvironment::empty(), DUMMY_SP)
+ ty.is_freeze(self.tcx, ParamEnv::empty(), DUMMY_SP)
}
pub fn exported_symbols<'a>(&'a self) -> &'a NodeSet {
// The key step here is to update the caller_bounds's predicates to be
// the new hybrid bounds we computed.
let normalize_cause = traits::ObligationCause::misc(impl_m_span, impl_m_node_id);
- let param_env = ty::ParameterEnvironment::new(tcx.intern_predicates(&hybrid_preds.predicates));
+ let param_env = ty::ParamEnv::new(tcx.intern_predicates(&hybrid_preds.predicates));
let param_env = traits::normalize_param_env_or_error(tcx,
impl_m.def_id,
param_env,