Deprecate name OwnedSlice and don't use it

This commit is contained in:
Vadim Petrochenkov 2015-12-16 21:44:33 +03:00
parent 09d4a436a7
commit 0d298f9904
22 changed files with 96 additions and 114 deletions

View file

@ -14,7 +14,6 @@ use ast;
use attr;
use codemap::{Span, respan, Spanned, DUMMY_SP, Pos};
use ext::base::ExtCtxt;
use owned_slice::OwnedSlice;
use parse::token::special_idents;
use parse::token::InternedString;
use parse::token;
@ -56,7 +55,7 @@ pub trait AstBuilder {
fn ty(&self, span: Span, ty: ast::Ty_) -> P<ast::Ty>;
fn ty_path(&self, ast::Path) -> P<ast::Ty>;
fn ty_sum(&self, ast::Path, OwnedSlice<ast::TyParamBound>) -> P<ast::Ty>;
fn ty_sum(&self, ast::Path, ast::TyParamBounds) -> P<ast::Ty>;
fn ty_ident(&self, span: Span, idents: ast::Ident) -> P<ast::Ty>;
fn ty_rptr(&self, span: Span,
@ -70,13 +69,13 @@ pub trait AstBuilder {
fn ty_option(&self, ty: P<ast::Ty>) -> P<ast::Ty>;
fn ty_infer(&self, sp: Span) -> P<ast::Ty>;
fn ty_vars(&self, ty_params: &OwnedSlice<ast::TyParam>) -> Vec<P<ast::Ty>> ;
fn ty_vars_global(&self, ty_params: &OwnedSlice<ast::TyParam>) -> Vec<P<ast::Ty>> ;
fn ty_vars(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> ;
fn ty_vars_global(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> ;
fn typaram(&self,
span: Span,
id: ast::Ident,
bounds: OwnedSlice<ast::TyParamBound>,
bounds: ast::TyParamBounds,
default: Option<P<ast::Ty>>) -> ast::TyParam;
fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
@ -331,8 +330,8 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
identifier: last_identifier,
parameters: ast::AngleBracketedParameters(ast::AngleBracketedParameterData {
lifetimes: lifetimes,
types: OwnedSlice::from_vec(types),
bindings: OwnedSlice::from_vec(bindings),
types: P::from_vec(types),
bindings: P::from_vec(bindings),
})
});
ast::Path {
@ -369,8 +368,8 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
identifier: ident,
parameters: ast::AngleBracketedParameters(ast::AngleBracketedParameterData {
lifetimes: lifetimes,
types: OwnedSlice::from_vec(types),
bindings: OwnedSlice::from_vec(bindings),
types: P::from_vec(types),
bindings: P::from_vec(bindings),
})
});
@ -399,7 +398,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
self.ty(path.span, ast::TyPath(None, path))
}
fn ty_sum(&self, path: ast::Path, bounds: OwnedSlice<ast::TyParamBound>) -> P<ast::Ty> {
fn ty_sum(&self, path: ast::Path, bounds: ast::TyParamBounds) -> P<ast::Ty> {
self.ty(path.span,
ast::TyObjectSum(self.ty_path(path),
bounds))
@ -448,7 +447,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
fn typaram(&self,
span: Span,
id: ast::Ident,
bounds: OwnedSlice<ast::TyParamBound>,
bounds: ast::TyParamBounds,
default: Option<P<ast::Ty>>) -> ast::TyParam {
ast::TyParam {
ident: id,
@ -462,11 +461,11 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
// these are strange, and probably shouldn't be used outside of
// pipes. Specifically, the global version possible generates
// incorrect code.
fn ty_vars(&self, ty_params: &OwnedSlice<ast::TyParam>) -> Vec<P<ast::Ty>> {
fn ty_vars(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> {
ty_params.iter().map(|p| self.ty_ident(DUMMY_SP, p.ident)).collect()
}
fn ty_vars_global(&self, ty_params: &OwnedSlice<ast::TyParam>) -> Vec<P<ast::Ty>> {
fn ty_vars_global(&self, ty_params: &P<[ast::TyParam]>) -> Vec<P<ast::Ty>> {
ty_params
.iter()
.map(|p| self.ty_path(self.path_global(DUMMY_SP, vec!(p.ident))))