Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rename ty::Slice to ty::List
  • Loading branch information
varkor committed Aug 22, 2018
1 parent 674ef66 commit 87c7e57
Show file tree
Hide file tree
Showing 20 changed files with 140 additions and 139 deletions.
4 changes: 2 additions & 2 deletions src/librustc/ich/impls_ty.rs
Expand Up @@ -25,7 +25,7 @@ use ty;
use mir;

impl<'a, 'gcx, T> HashStable<StableHashingContext<'a>>
for &'gcx ty::Slice<T>
for &'gcx ty::List<T>
where T: HashStable<StableHashingContext<'a>> {
fn hash_stable<W: StableHasherResult>(&self,
hcx: &mut StableHashingContext<'a>,
Expand Down Expand Up @@ -53,7 +53,7 @@ for &'gcx ty::Slice<T>
}
}

impl<'a, 'gcx, T> ToStableHashKey<StableHashingContext<'a>> for &'gcx ty::Slice<T>
impl<'a, 'gcx, T> ToStableHashKey<StableHashingContext<'a>> for &'gcx ty::List<T>
where T: HashStable<StableHashingContext<'a>>
{
type KeyType = Fingerprint;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/canonical/canonicalizer.rs
Expand Up @@ -23,7 +23,7 @@ use infer::InferCtxt;
use std::sync::atomic::Ordering;
use ty::fold::{TypeFoldable, TypeFolder};
use ty::subst::Kind;
use ty::{self, CanonicalVar, Lift, Slice, Ty, TyCtxt, TypeFlags};
use ty::{self, CanonicalVar, Lift, List, Ty, TyCtxt, TypeFlags};

use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::indexed_vec::Idx;
Expand Down Expand Up @@ -327,7 +327,7 @@ impl<'cx, 'gcx, 'tcx> Canonicalizer<'cx, 'gcx, 'tcx> {
if !value.has_type_flags(needs_canonical_flags) {
let out_value = gcx.lift(value).unwrap();
let canon_value = Canonical {
variables: Slice::empty(),
variables: List::empty(),
value: out_value,
};
return canon_value;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/infer/canonical/mod.rs
Expand Up @@ -40,7 +40,7 @@ use std::ops::Index;
use syntax::source_map::Span;
use ty::fold::TypeFoldable;
use ty::subst::Kind;
use ty::{self, CanonicalVar, Lift, Region, Slice, TyCtxt};
use ty::{self, CanonicalVar, Lift, Region, List, TyCtxt};

mod canonicalizer;

Expand All @@ -57,7 +57,7 @@ pub struct Canonical<'gcx, V> {
pub value: V,
}

pub type CanonicalVarInfos<'gcx> = &'gcx Slice<CanonicalVarInfo>;
pub type CanonicalVarInfos<'gcx> = &'gcx List<CanonicalVarInfo>;

impl<'gcx> UseSpecializedDecodable for CanonicalVarInfos<'gcx> {}

Expand Down Expand Up @@ -221,7 +221,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
fn fresh_inference_vars_for_canonical_vars(
&self,
span: Span,
variables: &Slice<CanonicalVarInfo>,
variables: &List<CanonicalVarInfo>,
) -> CanonicalVarValues<'tcx> {
let var_values: IndexVec<CanonicalVar, Kind<'tcx>> = variables
.iter()
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/traits/mod.rs
Expand Up @@ -24,7 +24,7 @@ use infer::outlives::env::OutlivesEnvironment;
use middle::region;
use mir::interpret::ConstEvalErr;
use ty::subst::Substs;
use ty::{self, AdtKind, Slice, Ty, TyCtxt, GenericParamDefKind, ToPredicate};
use ty::{self, AdtKind, List, Ty, TyCtxt, GenericParamDefKind, ToPredicate};
use ty::error::{ExpectedFound, TypeError};
use ty::fold::{TypeFolder, TypeFoldable, TypeVisitor};
use infer::{InferCtxt};
Expand Down Expand Up @@ -325,7 +325,7 @@ pub enum Goal<'tcx> {
CannotProve,
}

pub type Goals<'tcx> = &'tcx Slice<Goal<'tcx>>;
pub type Goals<'tcx> = &'tcx List<Goal<'tcx>>;

impl<'tcx> DomainGoal<'tcx> {
pub fn into_goal(self) -> Goal<'tcx> {
Expand Down Expand Up @@ -357,7 +357,7 @@ pub enum Clause<'tcx> {
}

/// Multiple clauses.
pub type Clauses<'tcx> = &'tcx Slice<Clause<'tcx>>;
pub type Clauses<'tcx> = &'tcx List<Clause<'tcx>>;

/// A "program clause" has the form `D :- G1, ..., Gn`. It is saying
/// that the domain goal `D` is true if `G1...Gn` are provable. This
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/traits/structural_impls.rs
Expand Up @@ -620,7 +620,7 @@ EnumLiftImpl! {
}
}

impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::Slice<traits::Goal<'tcx>> {
impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<traits::Goal<'tcx>> {
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
let v = self.iter()
.map(|t| t.fold_with(folder))
Expand Down Expand Up @@ -658,7 +658,7 @@ EnumTypeFoldableImpl! {
}
}

impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::Slice<traits::Clause<'tcx>> {
impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<traits::Clause<'tcx>> {
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
let v = self.iter()
.map(|t| t.fold_with(folder))
Expand Down
12 changes: 6 additions & 6 deletions src/librustc/ty/codec.rs
Expand Up @@ -212,7 +212,7 @@ pub fn decode_region<'a, 'tcx, D>(decoder: &mut D) -> Result<ty::Region<'tcx>, D

#[inline]
pub fn decode_ty_slice<'a, 'tcx, D>(decoder: &mut D)
-> Result<&'tcx ty::Slice<Ty<'tcx>>, D::Error>
-> Result<&'tcx ty::List<Ty<'tcx>>, D::Error>
where D: TyDecoder<'a, 'tcx>,
'tcx: 'a,
{
Expand All @@ -232,7 +232,7 @@ pub fn decode_adt_def<'a, 'tcx, D>(decoder: &mut D)

#[inline]
pub fn decode_existential_predicate_slice<'a, 'tcx, D>(decoder: &mut D)
-> Result<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>, D::Error>
-> Result<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>, D::Error>
where D: TyDecoder<'a, 'tcx>,
'tcx: 'a,
{
Expand Down Expand Up @@ -366,10 +366,10 @@ macro_rules! implement_ty_decoder {
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx ty::Slice<ty::Ty<'tcx>>>
impl<$($typaram),*> SpecializedDecoder<&'tcx ty::List<ty::Ty<'tcx>>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self)
-> Result<&'tcx ty::Slice<ty::Ty<'tcx>>, Self::Error> {
-> Result<&'tcx ty::List<ty::Ty<'tcx>>, Self::Error> {
decode_ty_slice(self)
}
}
Expand All @@ -381,10 +381,10 @@ macro_rules! implement_ty_decoder {
}
}

impl<$($typaram),*> SpecializedDecoder<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>>
impl<$($typaram),*> SpecializedDecoder<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>>
for $DecoderName<$($typaram),*> {
fn specialized_decode(&mut self)
-> Result<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>, Self::Error> {
-> Result<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>, Self::Error> {
decode_existential_predicate_slice(self)
}
}
Expand Down

0 comments on commit 87c7e57

Please sign in to comment.