Deprecate name OwnedSlice and don't use it
This commit is contained in:
parent
09d4a436a7
commit
0d298f9904
22 changed files with 96 additions and 114 deletions
|
|
@ -17,7 +17,6 @@ use syntax::ast::{MetaWord, MetaList, MetaNameValue};
|
|||
use syntax::attr::ThinAttributesExt;
|
||||
use hir;
|
||||
use syntax::codemap::{respan, Span, Spanned};
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::ptr::P;
|
||||
use syntax::parse::token;
|
||||
use syntax::util::move_map::MoveMap;
|
||||
|
|
@ -211,7 +210,7 @@ pub trait Folder : Sized {
|
|||
noop_fold_ty_param(tp, self)
|
||||
}
|
||||
|
||||
fn fold_ty_params(&mut self, tps: OwnedSlice<TyParam>) -> OwnedSlice<TyParam> {
|
||||
fn fold_ty_params(&mut self, tps: P<[TyParam]>) -> P<[TyParam]> {
|
||||
noop_fold_ty_params(tps, self)
|
||||
}
|
||||
|
||||
|
|
@ -220,12 +219,12 @@ pub trait Folder : Sized {
|
|||
}
|
||||
|
||||
fn fold_opt_bounds(&mut self,
|
||||
b: Option<OwnedSlice<TyParamBound>>)
|
||||
-> Option<OwnedSlice<TyParamBound>> {
|
||||
b: Option<TyParamBounds>)
|
||||
-> Option<TyParamBounds> {
|
||||
noop_fold_opt_bounds(b, self)
|
||||
}
|
||||
|
||||
fn fold_bounds(&mut self, b: OwnedSlice<TyParamBound>) -> OwnedSlice<TyParamBound> {
|
||||
fn fold_bounds(&mut self, b: TyParamBounds) -> TyParamBounds {
|
||||
noop_fold_bounds(b, self)
|
||||
}
|
||||
|
||||
|
|
@ -576,9 +575,9 @@ pub fn noop_fold_ty_param<T: Folder>(tp: TyParam, fld: &mut T) -> TyParam {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn noop_fold_ty_params<T: Folder>(tps: OwnedSlice<TyParam>,
|
||||
pub fn noop_fold_ty_params<T: Folder>(tps: P<[TyParam]>,
|
||||
fld: &mut T)
|
||||
-> OwnedSlice<TyParam> {
|
||||
-> P<[TyParam]> {
|
||||
tps.move_map(|tp| fld.fold_ty_param(tp))
|
||||
}
|
||||
|
||||
|
|
@ -726,9 +725,9 @@ pub fn noop_fold_mt<T: Folder>(MutTy { ty, mutbl }: MutTy, folder: &mut T) -> Mu
|
|||
}
|
||||
}
|
||||
|
||||
pub fn noop_fold_opt_bounds<T: Folder>(b: Option<OwnedSlice<TyParamBound>>,
|
||||
pub fn noop_fold_opt_bounds<T: Folder>(b: Option<TyParamBounds>,
|
||||
folder: &mut T)
|
||||
-> Option<OwnedSlice<TyParamBound>> {
|
||||
-> Option<TyParamBounds> {
|
||||
b.map(|bounds| folder.fold_bounds(bounds))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ use syntax::abi::Abi;
|
|||
use syntax::ast::{Name, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect};
|
||||
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, CrateConfig};
|
||||
use syntax::attr::ThinAttributes;
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::parse::token::InternedString;
|
||||
use syntax::ptr::P;
|
||||
|
||||
|
|
@ -193,8 +192,8 @@ impl PathParameters {
|
|||
pub fn none() -> PathParameters {
|
||||
AngleBracketedParameters(AngleBracketedParameterData {
|
||||
lifetimes: Vec::new(),
|
||||
types: OwnedSlice::empty(),
|
||||
bindings: OwnedSlice::empty(),
|
||||
types: P::empty(),
|
||||
bindings: P::empty(),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -267,10 +266,10 @@ pub struct AngleBracketedParameterData {
|
|||
/// The lifetime parameters for this path segment.
|
||||
pub lifetimes: Vec<Lifetime>,
|
||||
/// The type parameters for this path segment, if present.
|
||||
pub types: OwnedSlice<P<Ty>>,
|
||||
pub types: P<[P<Ty>]>,
|
||||
/// Bindings (equality constraints) on associated types, if present.
|
||||
/// E.g., `Foo<A=Bar>`.
|
||||
pub bindings: OwnedSlice<TypeBinding>,
|
||||
pub bindings: P<[TypeBinding]>,
|
||||
}
|
||||
|
||||
impl AngleBracketedParameterData {
|
||||
|
|
@ -310,7 +309,7 @@ pub enum TraitBoundModifier {
|
|||
Maybe,
|
||||
}
|
||||
|
||||
pub type TyParamBounds = OwnedSlice<TyParamBound>;
|
||||
pub type TyParamBounds = P<[TyParamBound]>;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||
pub struct TyParam {
|
||||
|
|
@ -326,7 +325,7 @@ pub struct TyParam {
|
|||
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
|
||||
pub struct Generics {
|
||||
pub lifetimes: Vec<LifetimeDef>,
|
||||
pub ty_params: OwnedSlice<TyParam>,
|
||||
pub ty_params: P<[TyParam]>,
|
||||
pub where_clause: WhereClause,
|
||||
}
|
||||
|
||||
|
|
@ -369,7 +368,7 @@ pub struct WhereBoundPredicate {
|
|||
/// The type being bounded
|
||||
pub bounded_ty: P<Ty>,
|
||||
/// Trait and lifetime bounds (`Clone+Send+'static`)
|
||||
pub bounds: OwnedSlice<TyParamBound>,
|
||||
pub bounds: TyParamBounds,
|
||||
}
|
||||
|
||||
/// A lifetime predicate, e.g. `'a: 'b+'c`
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ use syntax::attr::{ThinAttributes, ThinAttributesExt};
|
|||
use syntax::ext::mtwt;
|
||||
use syntax::ptr::P;
|
||||
use syntax::codemap::{respan, Spanned, Span};
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::parse::token;
|
||||
use syntax::std_inject;
|
||||
use syntax::visit::{self, Visitor};
|
||||
|
|
@ -430,8 +429,8 @@ pub fn lower_ty_param(lctx: &LoweringContext, tp: &TyParam) -> hir::TyParam {
|
|||
}
|
||||
|
||||
pub fn lower_ty_params(lctx: &LoweringContext,
|
||||
tps: &OwnedSlice<TyParam>)
|
||||
-> OwnedSlice<hir::TyParam> {
|
||||
tps: &P<[TyParam]>)
|
||||
-> P<[hir::TyParam]> {
|
||||
tps.iter().map(|tp| lower_ty_param(lctx, tp)).collect()
|
||||
}
|
||||
|
||||
|
|
@ -583,8 +582,8 @@ pub fn lower_mt(lctx: &LoweringContext, mt: &MutTy) -> hir::MutTy {
|
|||
}
|
||||
|
||||
pub fn lower_opt_bounds(lctx: &LoweringContext,
|
||||
b: &Option<OwnedSlice<TyParamBound>>)
|
||||
-> Option<OwnedSlice<hir::TyParamBound>> {
|
||||
b: &Option<TyParamBounds>)
|
||||
-> Option<hir::TyParamBounds> {
|
||||
b.as_ref().map(|ref bounds| lower_bounds(lctx, bounds))
|
||||
}
|
||||
|
||||
|
|
@ -1795,8 +1794,8 @@ fn path_all(sp: Span,
|
|||
identifier: last_identifier,
|
||||
parameters: hir::AngleBracketedParameters(hir::AngleBracketedParameterData {
|
||||
lifetimes: lifetimes,
|
||||
types: OwnedSlice::from_vec(types),
|
||||
bindings: OwnedSlice::from_vec(bindings),
|
||||
types: P::from_vec(types),
|
||||
bindings: P::from_vec(bindings),
|
||||
}),
|
||||
});
|
||||
hir::Path {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ pub use self::AnnNode::*;
|
|||
|
||||
use syntax::abi;
|
||||
use syntax::ast;
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
use syntax::codemap::{self, CodeMap, BytePos, Spanned};
|
||||
use syntax::diagnostic;
|
||||
use syntax::parse::token::{self, BinOpToken};
|
||||
|
|
@ -519,7 +518,7 @@ impl<'a> State<'a> {
|
|||
hir::TyBareFn(ref f) => {
|
||||
let generics = hir::Generics {
|
||||
lifetimes: f.lifetimes.clone(),
|
||||
ty_params: OwnedSlice::empty(),
|
||||
ty_params: P::empty(),
|
||||
where_clause: hir::WhereClause {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
predicates: Vec::new(),
|
||||
|
|
@ -2258,7 +2257,7 @@ impl<'a> State<'a> {
|
|||
}
|
||||
let generics = hir::Generics {
|
||||
lifetimes: Vec::new(),
|
||||
ty_params: OwnedSlice::empty(),
|
||||
ty_params: P::empty(),
|
||||
where_clause: hir::WhereClause {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
predicates: Vec::new(),
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use syntax::ast_util;
|
|||
use syntax::ast::{Name, NodeId, DUMMY_NODE_ID};
|
||||
use syntax::codemap::Span;
|
||||
use syntax::ptr::P;
|
||||
use syntax::owned_slice::OwnedSlice;
|
||||
|
||||
pub fn walk_pat<F>(pat: &Pat, mut it: F) -> bool
|
||||
where F: FnMut(&Pat) -> bool
|
||||
|
|
@ -336,7 +335,7 @@ pub fn is_path(e: P<Expr>) -> bool {
|
|||
pub fn empty_generics() -> Generics {
|
||||
Generics {
|
||||
lifetimes: Vec::new(),
|
||||
ty_params: OwnedSlice::empty(),
|
||||
ty_params: P::empty(),
|
||||
where_clause: WhereClause {
|
||||
id: DUMMY_NODE_ID,
|
||||
predicates: Vec::new(),
|
||||
|
|
@ -354,8 +353,8 @@ pub fn ident_to_path(s: Span, ident: Ident) -> Path {
|
|||
identifier: ident,
|
||||
parameters: hir::AngleBracketedParameters(hir::AngleBracketedParameterData {
|
||||
lifetimes: Vec::new(),
|
||||
types: OwnedSlice::empty(),
|
||||
bindings: OwnedSlice::empty(),
|
||||
types: P::empty(),
|
||||
bindings: P::empty(),
|
||||
}),
|
||||
}),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue