summary refs log tree commit diff
path: root/src/libsyntax/ext/build.rs
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-07-08 14:26:02 +1200
committerNick Cameron <ncameron@mozilla.com>2014-07-08 22:44:31 +1200
commita0cfda53c4b7367f6494e3d746b35cea644ee50d (patch)
treea9a65cb86769ae39e01562cda9eda0dfdb860245 /src/libsyntax/ext/build.rs
parent6959931498820b2b784168164b53a79dceafc4da (diff)
downloadrust-a0cfda53c4b7367f6494e3d746b35cea644ee50d.tar.gz
rust-a0cfda53c4b7367f6494e3d746b35cea644ee50d.zip
Change DST syntax: type -> Sized?
closes #13367

[breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g.,

```
trait Tr for Sized? {}

fn foo<Sized? X: Share>(x: X) {}
```
Diffstat (limited to 'src/libsyntax/ext/build.rs')
-rw-r--r--src/libsyntax/ext/build.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index 46bc4ec11ce..4d79ff3257a 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -66,8 +66,8 @@ pub trait AstBuilder {
     fn typaram(&self,
                span: Span,
                id: ast::Ident,
-               sized: ast::Sized,
                bounds: OwnedSlice<ast::TyParamBound>,
+               unbound: Option<ast::TyParamBound>,
                default: Option<P<ast::Ty>>) -> ast::TyParam;
 
     fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
@@ -396,14 +396,14 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn typaram(&self,
                span: Span,
                id: ast::Ident,
-               sized: ast::Sized,
                bounds: OwnedSlice<ast::TyParamBound>,
+               unbound: Option<ast::TyParamBound>,
                default: Option<P<ast::Ty>>) -> ast::TyParam {
         ast::TyParam {
             ident: id,
             id: ast::DUMMY_NODE_ID,
-            sized: sized,
             bounds: bounds,
+            unbound: unbound,
             default: default,
             span: span
         }
@@ -423,7 +423,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
 
     fn strip_bounds(&self, generics: &Generics) -> Generics {
         let new_params = generics.ty_params.map(|ty_param| {
-            ast::TyParam { bounds: OwnedSlice::empty(), ..*ty_param }
+            ast::TyParam { bounds: OwnedSlice::empty(), unbound: None, ..*ty_param }
         });
         Generics {
             ty_params: new_params,