diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-01-28 10:46:43 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-01-29 10:42:58 -0800 |
| commit | 6ce74460e6a5c8045a7b43b86a656f28354f4b0c (patch) | |
| tree | a09e6a6b8ba8566e6dc9f223d6cbbfbbdcde19e2 /src/libsyntax/ext/pipes/ast_builder.rs | |
| parent | eb4d39e1fef918242a5dba2a09d7b9faa437b911 (diff) | |
| download | rust-6ce74460e6a5c8045a7b43b86a656f28354f4b0c.tar.gz rust-6ce74460e6a5c8045a7b43b86a656f28354f4b0c.zip | |
librustc: Disallow trait bounds in types, enumerations, and structure definitions. r=tjc
Diffstat (limited to 'src/libsyntax/ext/pipes/ast_builder.rs')
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 8a5b8a127d0..0433aab51fc 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -110,6 +110,7 @@ pub trait ext_ctxt_ast_builder { fn ty_option(ty: @ast::Ty) -> @ast::Ty; fn ty_infer() -> @ast::Ty; fn ty_nil_ast_builder() -> @ast::Ty; + fn strip_bounds(bounds: &[ast::ty_param]) -> ~[ast::ty_param]; } impl ext_ctxt: ext_ctxt_ast_builder { @@ -370,6 +371,12 @@ impl ext_ctxt: ext_ctxt_ast_builder { } } + fn strip_bounds(bounds: &[ast::ty_param]) -> ~[ast::ty_param] { + do bounds.map |ty_param| { + ast::ty_param { bounds: @~[], ..copy *ty_param } + } + } + fn item_ty_poly(name: ident, span: span, ty: @ast::Ty, |
