diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-12-18 13:43:46 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-12-18 20:02:12 +0530 |
| commit | 9e953df6f05765679db074b8895ed2178d75eb26 (patch) | |
| tree | e71174db4adcf4adf1709afb41ff3fc125d5c35b /src/libsyntax/ext | |
| parent | 158a1bdd7dac47356a0cc44dd52308c7145f4afe (diff) | |
| parent | 6c87b191580be9ecd5a99a34ef97375af0b9d659 (diff) | |
| download | rust-9e953df6f05765679db074b8895ed2178d75eb26.tar.gz rust-9e953df6f05765679db074b8895ed2178d75eb26.zip | |
Rollup merge of #30420 - petrochenkov:owned2, r=nrc
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults. r? @nrc
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index cdc9cb02453..46a39b98058 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -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)))) |
