librustc: Disallow trait bounds in types, enumerations, and structure definitions. r=tjc

This commit is contained in:
Patrick Walton
2013-01-28 10:46:43 -08:00
parent eb4d39e1fe
commit 6ce74460e6
44 changed files with 424 additions and 107 deletions

View File

@@ -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,