diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-04 19:58:31 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-04 19:59:47 -0700 |
| commit | 8fc60af441a1375ee73a0efe4524b54ff039e69a (patch) | |
| tree | df2e886ac825f6f95b35a72f2767f20f2ea72741 /src/libsyntax | |
| parent | f5dfd9b3ce5dd6fbe567ba07e89c70a4db2c4cd4 (diff) | |
| download | rust-8fc60af441a1375ee73a0efe4524b54ff039e69a.tar.gz rust-8fc60af441a1375ee73a0efe4524b54ff039e69a.zip | |
Remove by-copy mode from std, mostly
One instance remains in net_tcp due to a foreign fn. Lots of instances remain in serialization.rs, but IIRC that is being removed. I had to do unholy things to task-perf-word-count-generic to get it to compile after demoding pipes. I may well have messed up its performance, but it passes.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/pipec.rs | 14 |
2 files changed, 6 insertions, 16 deletions
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index bfe0f4dd0e6..4da9992b0dd 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -48,7 +48,6 @@ trait ext_ctxt_ast_builder { fn ty_param(id: ast::ident, +bounds: ~[ast::ty_param_bound]) -> ast::ty_param; fn arg(name: ident, ty: @ast::ty) -> ast::arg; - fn arg_mode(name: ident, ty: @ast::ty, mode: ast::rmode) -> ast::arg; fn expr_block(e: @ast::expr) -> ast::blk; fn fn_decl(+inputs: ~[ast::arg], output: @ast::ty) -> ast::fn_decl; fn item(name: ident, span: span, +node: ast::item_) -> @ast::item; @@ -177,13 +176,6 @@ impl ext_ctxt: ext_ctxt_ast_builder { id: self.next_id()} } - fn arg_mode(name: ident, ty: @ast::ty, mode: ast::rmode) -> ast::arg { - {mode: ast::expl(mode), - ty: ty, - ident: name, - id: self.next_id()} - } - fn block(+stmts: ~[@ast::stmt], e: @ast::expr) -> ast::blk { let blk = {view_items: ~[], stmts: stmts, diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 9c10d228a23..874ea01e9b0 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -47,16 +47,15 @@ impl message: gen_send { let arg_names = tys.mapi(|i, _ty| cx.ident_of(~"x_"+i.to_str())); let args_ast = (arg_names, tys).map( - |n, t| cx.arg_mode(*n, *t, ast::by_copy) + |n, t| cx.arg(*n, *t) ); let pipe_ty = cx.ty_path_ast_builder( path(~[this.data_name()], span) .add_tys(cx.ty_vars(this.ty_params))); let args_ast = vec::append( - ~[cx.arg_mode(cx.ident_of(~"pipe"), - pipe_ty, - ast::by_copy)], + ~[cx.arg(cx.ident_of(~"pipe"), + pipe_ty)], args_ast); let mut body = ~"{\n"; @@ -129,15 +128,14 @@ impl message: gen_send { let arg_names = tys.mapi(|i, _ty| (~"x_" + i.to_str())); let args_ast = (arg_names, tys).map( - |n, t| cx.arg_mode(cx.ident_of(*n), *t, ast::by_copy) + |n, t| cx.arg(cx.ident_of(*n), *t) ); let args_ast = vec::append( - ~[cx.arg_mode(cx.ident_of(~"pipe"), + ~[cx.arg(cx.ident_of(~"pipe"), cx.ty_path_ast_builder( path(~[this.data_name()], span) - .add_tys(cx.ty_vars(this.ty_params))), - ast::by_copy)], + .add_tys(cx.ty_vars(this.ty_params))))], args_ast); let message_args = if arg_names.len() == 0 { |
