1
Fork 0

Remove 'with'

This commit is contained in:
Brian Anderson 2012-09-04 13:29:32 -07:00
parent ef880f2245
commit 200959d7ce
77 changed files with 404 additions and 419 deletions

View file

@ -1595,9 +1595,9 @@ The order of the fields in a record expression is significant, and
determines the type of the resulting value. `{a: u8, b: u8}` and `{b: determines the type of the resulting value. `{a: u8, b: u8}` and `{b:
u8, a: u8}` are two different fields. u8, a: u8}` are two different fields.
A record expression can terminate with the word `with` followed by an A record expression can terminate with the syntax `..` followed by an
expression to denote a functional update. The expression following expression to denote a functional update. The expression following
`with` (the base) must be of a record type that includes at least all the `..` (the base) must be of a record type that includes at least all the
fields mentioned in the record expression. A new record will be fields mentioned in the record expression. A new record will be
created, of the same type as the base expression, with the given created, of the same type as the base expression, with the given
values for the fields that were explicitly specified, and the values values for the fields that were explicitly specified, and the values
@ -1606,7 +1606,7 @@ such a record expression is not significant.
~~~~ ~~~~
let base = {x: 1, y: 2, z: 3}; let base = {x: 1, y: 2, z: 3};
{y: 0, z: 10 with base}; {y: 0, z: 10, .. base};
~~~~ ~~~~
### Field expressions ### Field expressions

View file

@ -362,7 +362,7 @@ fn load_crate(filename: &Path) -> Option<crate> {
let v = visit::mk_simple_visitor(@{ let v = visit::mk_simple_visitor(@{
visit_view_item: |a| goto_view_item(sess, e, a), visit_view_item: |a| goto_view_item(sess, e, a),
visit_item: |a| goto_item(e, a), visit_item: |a| goto_item(e, a),
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
}); });
visit::visit_crate(*c, (), v); visit::visit_crate(*c, (), v);

View file

@ -132,8 +132,8 @@ fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
let tys = @mut ~[]; let tys = @mut ~[];
let v = visit::mk_simple_visitor(@{ let v = visit::mk_simple_visitor(@{
visit_expr: |a| stash_expr_if(safe_to_steal_expr, exprs, a, tm), visit_expr: |a| stash_expr_if(safe_to_steal_expr, exprs, a, tm),
visit_ty: |a| stash_ty_if(safe_to_steal_ty, tys, a, tm) visit_ty: |a| stash_ty_if(safe_to_steal_ty, tys, a, tm),
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
}); });
visit::visit_crate(crate, (), v); visit::visit_crate(crate, (), v);
{exprs: *exprs, tys: *tys} {exprs: *exprs, tys: *tys}
@ -182,8 +182,8 @@ fn replace_expr_in_crate(crate: ast::crate, i: uint,
let afp = @{ let afp = @{
fold_expr: fold::wrap(|a,b| { fold_expr: fold::wrap(|a,b| {
fold_expr_rep(j, i, newexpr.node, a, b, tm) fold_expr_rep(j, i, newexpr.node, a, b, tm)
}) }),
with *fold::default_ast_fold() .. *fold::default_ast_fold()
}; };
let af = fold::make_fold(afp); let af = fold::make_fold(afp);
let crate2: @ast::crate = @af.fold_crate(crate); let crate2: @ast::crate = @af.fold_crate(crate);
@ -205,8 +205,8 @@ fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::ty,
} else { fold::noop_fold_ty(original, fld) } } else { fold::noop_fold_ty(original, fld) }
} }
let afp = @{ let afp = @{
fold_ty: fold::wrap(|a,b| fold_ty_rep(j, i, newty.node, a, b, tm) ) fold_ty: fold::wrap(|a,b| fold_ty_rep(j, i, newty.node, a, b, tm) ),
with *fold::default_ast_fold() .. *fold::default_ast_fold()
}; };
let af = fold::make_fold(afp); let af = fold::make_fold(afp);
let crate2: @ast::crate = @af.fold_crate(crate); let crate2: @ast::crate = @af.fold_crate(crate);
@ -452,8 +452,8 @@ fn has_raw_pointers(c: ast::crate) -> bool {
} }
} }
let v = let v =
visit::mk_simple_visitor(@{visit_ty: |a| visit_ty(has_rp, a) visit::mk_simple_visitor(@{visit_ty: |a| visit_ty(has_rp, a),
with *visit::default_simple_visitor()}); .. *visit::default_simple_visitor()});
visit::visit_crate(c, (), v); visit::visit_crate(c, (), v);
return *has_rp; return *has_rp;
} }

View file

@ -247,7 +247,7 @@ priv impl TaskBuilder {
fail ~"Cannot copy a task_builder"; // Fake move mode on self fail ~"Cannot copy a task_builder"; // Fake move mode on self
} }
self.consumed = true; self.consumed = true;
TaskBuilder({ can_not_copy: None, mut consumed: false, with *self }) TaskBuilder({ can_not_copy: None, mut consumed: false,.. *self })
} }
} }
@ -258,9 +258,9 @@ impl TaskBuilder {
*/ */
fn unlinked() -> TaskBuilder { fn unlinked() -> TaskBuilder {
TaskBuilder({ TaskBuilder({
opts: { linked: false with self.opts }, opts: { linked: false,.. self.opts },
can_not_copy: None, can_not_copy: None,
with *self.consume() .. *self.consume()
}) })
} }
/** /**
@ -270,9 +270,9 @@ impl TaskBuilder {
*/ */
fn supervised() -> TaskBuilder { fn supervised() -> TaskBuilder {
TaskBuilder({ TaskBuilder({
opts: { linked: false, supervised: true with self.opts }, opts: { linked: false, supervised: true,.. self.opts },
can_not_copy: None, can_not_copy: None,
with *self.consume() .. *self.consume()
}) })
} }
/** /**
@ -281,9 +281,9 @@ impl TaskBuilder {
*/ */
fn linked() -> TaskBuilder { fn linked() -> TaskBuilder {
TaskBuilder({ TaskBuilder({
opts: { linked: true, supervised: false with self.opts }, opts: { linked: true, supervised: false,.. self.opts },
can_not_copy: None, can_not_copy: None,
with *self.consume() .. *self.consume()
}) })
} }
@ -326,18 +326,18 @@ impl TaskBuilder {
// Reconfigure self to use a notify channel. // Reconfigure self to use a notify channel.
TaskBuilder({ TaskBuilder({
opts: { notify_chan: Some(ch) with self.opts }, opts: { notify_chan: Some(ch),.. self.opts },
can_not_copy: None, can_not_copy: None,
with *self.consume() .. *self.consume()
}) })
} }
/// Configure a custom scheduler mode for the task. /// Configure a custom scheduler mode for the task.
fn sched_mode(mode: SchedMode) -> TaskBuilder { fn sched_mode(mode: SchedMode) -> TaskBuilder {
TaskBuilder({ TaskBuilder({
opts: { sched: Some({ mode: mode, foreign_stack_size: None}) opts: { sched: Some({ mode: mode, foreign_stack_size: None}),
with self.opts }, .. self.opts },
can_not_copy: None, can_not_copy: None,
with *self.consume() .. *self.consume()
}) })
} }
@ -358,7 +358,7 @@ impl TaskBuilder {
TaskBuilder({ TaskBuilder({
gen_body: |body| { wrapper(prev_gen_body(body)) }, gen_body: |body| { wrapper(prev_gen_body(body)) },
can_not_copy: None, can_not_copy: None,
with *self.consume() .. *self.consume()
}) })
} }
@ -1560,8 +1560,8 @@ fn test_spawn_raw_simple() {
#[ignore(cfg(windows))] #[ignore(cfg(windows))]
fn test_spawn_raw_unsupervise() { fn test_spawn_raw_unsupervise() {
let opts = { let opts = {
linked: false linked: false,
with default_task_opts() .. default_task_opts()
}; };
do spawn_raw(opts) { do spawn_raw(opts) {
fail; fail;
@ -1623,9 +1623,9 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails
// they don't make sense (redundant with task().supervised()). // they don't make sense (redundant with task().supervised()).
let b0 = task(); let b0 = task();
let b1 = TaskBuilder({ let b1 = TaskBuilder({
opts: { linked: true, supervised: true with b0.opts }, opts: { linked: true, supervised: true,.. b0.opts },
can_not_copy: None, can_not_copy: None,
with *b0 .. *b0
}); });
do b1.spawn { fail; } do b1.spawn { fail; }
comm::recv(po); // We should get punted awake comm::recv(po); // We should get punted awake
@ -1636,9 +1636,9 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails
// they don't make sense (redundant with task().supervised()). // they don't make sense (redundant with task().supervised()).
let b0 = task(); let b0 = task();
let b1 = TaskBuilder({ let b1 = TaskBuilder({
opts: { linked: true, supervised: true with b0.opts }, opts: { linked: true, supervised: true,.. b0.opts },
can_not_copy: None, can_not_copy: None,
with *b0 .. *b0
}); });
do b1.spawn { loop { task::yield(); } } do b1.spawn { loop { task::yield(); } }
fail; // *both* mechanisms would be wrong if this didn't kill the child... fail; // *both* mechanisms would be wrong if this didn't kill the child...
@ -1724,8 +1724,8 @@ fn test_spawn_raw_notify() {
let notify_ch = comm::Chan(notify_po); let notify_ch = comm::Chan(notify_po);
let opts = { let opts = {
notify_chan: Some(notify_ch) notify_chan: Some(notify_ch),
with default_task_opts() .. default_task_opts()
}; };
do spawn_raw(opts) { do spawn_raw(opts) {
comm::send(task_ch, get_task()); comm::send(task_ch, get_task());
@ -1735,8 +1735,8 @@ fn test_spawn_raw_notify() {
let opts = { let opts = {
linked: false, linked: false,
notify_chan: Some(notify_ch) notify_chan: Some(notify_ch),
with default_task_opts() .. default_task_opts()
}; };
do spawn_raw(opts) { do spawn_raw(opts) {
comm::send(task_ch, get_task()); comm::send(task_ch, get_task());
@ -2042,7 +2042,7 @@ fn test_unkillable() {
let ch = po.chan(); let ch = po.chan();
// We want to do this after failing // We want to do this after failing
do spawn_raw({ linked: false with default_task_opts() }) { do spawn_raw({ linked: false,.. default_task_opts() }) {
for iter::repeat(10u) { yield() } for iter::repeat(10u) { yield() }
ch.send(()); ch.send(());
} }
@ -2078,7 +2078,7 @@ fn test_unkillable_nested() {
let ch = po.chan(); let ch = po.chan();
// We want to do this after failing // We want to do this after failing
do spawn_raw({ linked: false with default_task_opts() }) { do spawn_raw({ linked: false,.. default_task_opts() }) {
for iter::repeat(10u) { yield() } for iter::repeat(10u) { yield() }
ch.send(()); ch.send(());
} }

View file

@ -96,8 +96,8 @@ fn mk_ast_map_visitor() -> vt {
visit_local: map_local, visit_local: map_local,
visit_arm: map_arm, visit_arm: map_arm,
visit_view_item: map_view_item, visit_view_item: map_view_item,
visit_block: map_block visit_block: map_block,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
} }

View file

@ -96,8 +96,8 @@ fn expand(cx: ext_ctxt,
} }
fn filter_attrs(item: @ast::item) -> @ast::item { fn filter_attrs(item: @ast::item) -> @ast::item {
@{attrs: vec::filter(item.attrs, not_auto_serialize) @{attrs: vec::filter(item.attrs, not_auto_serialize),
with *item} .. *item}
} }
do vec::flat_map(in_items) |in_item| { do vec::flat_map(in_items) |in_item| {
@ -281,8 +281,8 @@ impl ext_ctxt: ext_ctxt_helpers {
fn clone_folder() -> fold::ast_fold { fn clone_folder() -> fold::ast_fold {
fold::make_fold(@{ fold::make_fold(@{
new_id: |_id| self.next_id() new_id: |_id| self.next_id(),
with *fold::default_ast_fold() .. *fold::default_ast_fold()
}) })
} }
@ -311,8 +311,8 @@ impl ext_ctxt: ext_ctxt_helpers {
} }
let fld = fold::make_fold(@{ let fld = fold::make_fold(@{
new_span: |a| repl_sp(a, ast_util::dummy_sp(), span) new_span: |a| repl_sp(a, ast_util::dummy_sp(), span),
with *fold::default_ast_fold() .. *fold::default_ast_fold()
}); });
fld.fold_expr(expr) fld.fold_expr(expr)
@ -799,8 +799,8 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
vec::map(tps, |tp| { vec::map(tps, |tp| {
let cloned = cx.clone_ty_param(tp); let cloned = cx.clone_ty_param(tp);
{bounds: @(vec::append(*cloned.bounds, {bounds: @(vec::append(*cloned.bounds,
~[ast::bound_copy])) ~[ast::bound_copy])),
with cloned} .. cloned}
})); }));
let deser_blk = cx.expr_blk(f(cx, tps_map, #ast[expr]{__d})); let deser_blk = cx.expr_blk(f(cx, tps_map, #ast[expr]{__d}));

View file

@ -160,7 +160,7 @@ fn expand_mod_items(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
} }
}; };
return {items: new_items with module_}; return {items: new_items,.. module_};
} }
@ -259,8 +259,8 @@ fn expand_crate(parse_sess: parse::parse_sess,
@{fold_expr: |a,b,c| expand_expr(exts, cx, a, b, c, afp.fold_expr), @{fold_expr: |a,b,c| expand_expr(exts, cx, a, b, c, afp.fold_expr),
fold_mod: |a,b| expand_mod_items(exts, cx, a, b, afp.fold_mod), fold_mod: |a,b| expand_mod_items(exts, cx, a, b, afp.fold_mod),
fold_item: |a,b| expand_item(exts, cx, a, b, afp.fold_item), fold_item: |a,b| expand_item(exts, cx, a, b, afp.fold_item),
new_span: |a|new_span(cx, a) new_span: |a|new_span(cx, a),
with *afp}; .. *afp};
let f = make_fold(f_pre); let f = make_fold(f_pre);
let cm = parse_expr_from_source_str(~"<core-macros>", let cm = parse_expr_from_source_str(~"<core-macros>",
@core_macros(), @core_macros(),

View file

@ -35,13 +35,13 @@ trait append_types {
impl @ast::path: append_types { impl @ast::path: append_types {
fn add_ty(ty: @ast::ty) -> @ast::path { fn add_ty(ty: @ast::ty) -> @ast::path {
@{types: vec::append_one(self.types, ty) @{types: vec::append_one(self.types, ty),
with *self} .. *self}
} }
fn add_tys(+tys: ~[@ast::ty]) -> @ast::path { fn add_tys(+tys: ~[@ast::ty]) -> @ast::path {
@{types: vec::append(self.types, tys) @{types: vec::append(self.types, tys),
with *self} .. *self}
} }
} }

View file

@ -117,8 +117,8 @@ impl @ast::pat: qq_helper {
fn gather_anti_quotes<N: qq_helper>(lo: uint, node: N) -> aq_ctxt fn gather_anti_quotes<N: qq_helper>(lo: uint, node: N) -> aq_ctxt
{ {
let v = @{visit_expr: |node, &&cx, v| visit_aq(node, ~"from_expr", cx, v), let v = @{visit_expr: |node, &&cx, v| visit_aq(node, ~"from_expr", cx, v),
visit_ty: |node, &&cx, v| visit_aq(node, ~"from_ty", cx, v) visit_ty: |node, &&cx, v| visit_aq(node, ~"from_ty", cx, v),
with *default_visitor()}; .. *default_visitor()};
let cx = @{lo:lo, gather: DVec()}; let cx = @{lo:lo, gather: DVec()};
node.visit(cx, mk_vt(v)); node.visit(cx, mk_vt(v));
// FIXME (#2250): Maybe this is an overkill (merge_sort), it might // FIXME (#2250): Maybe this is an overkill (merge_sort), it might
@ -301,8 +301,8 @@ fn replace<T>(node: T, repls: ~[fragment], ff: fn (ast_fold, T) -> T)
let f_pre = @{fold_expr: |a,b,c|replace_expr(repls, a, b, c, let f_pre = @{fold_expr: |a,b,c|replace_expr(repls, a, b, c,
aft.fold_expr), aft.fold_expr),
fold_ty: |a,b,c|replace_ty(repls, a, b, c, fold_ty: |a,b,c|replace_ty(repls, a, b, c,
aft.fold_ty) aft.fold_ty),
with *aft}; .. *aft};
return ff(make_fold(f_pre), node); return ff(make_fold(f_pre), node);
} }
fn fold_crate(f: ast_fold, &&n: @ast::crate) -> @ast::crate { fn fold_crate(f: ast_fold, &&n: @ast::crate) -> @ast::crate {

View file

@ -196,8 +196,8 @@ fn transcribe(cx: ext_ctxt, b: bindings, body: @expr) -> @expr {
map_exprs: |x,y| map_exprs: |x,y|
transcribe_exprs(cx, b, idx_path, x, y) transcribe_exprs(cx, b, idx_path, x, y)
, ,
new_id: |x|new_id(x, cx) new_id: |x|new_id(x, cx),
with *afp}; .. *afp};
let f = make_fold(f_pre); let f = make_fold(f_pre);
let result = f.fold_expr(body); let result = f.fold_expr(body);
return result; return result;
@ -246,8 +246,8 @@ fn free_vars(b: bindings, e: @expr, it: fn(ident)) {
// using fold is a hack: we want visit, but it doesn't hit idents ) : // using fold is a hack: we want visit, but it doesn't hit idents ) :
// solve this with macros // solve this with macros
let f_pre = let f_pre =
@{fold_ident: |x,y|mark_ident(x, y, b, idents) @{fold_ident: |x,y|mark_ident(x, y, b, idents),
with *default_ast_fold()}; .. *default_ast_fold()};
let f = make_fold(f_pre); let f = make_fold(f_pre);
f.fold_expr(e); // ignore result f.fold_expr(e); // ignore result
for idents.each_key |x| { it(x); }; for idents.each_key |x| { it(x); };

View file

@ -278,10 +278,10 @@ fn fold_struct_def(struct_def: @ast::struct_def, fld: ast_fold)
node: { node: {
body: fld.fold_block(constructor.node.body), body: fld.fold_block(constructor.node.body),
dec: fold_fn_decl(constructor.node.dec, fld), dec: fold_fn_decl(constructor.node.dec, fld),
id: fld.new_id(constructor.node.id) id: fld.new_id(constructor.node.id),
with constructor.node .. constructor.node
} },
with constructor .. constructor
}); });
} }
} }
@ -289,8 +289,8 @@ fn fold_struct_def(struct_def: @ast::struct_def, fld: ast_fold)
let dtor_body = fld.fold_block(dtor.node.body); let dtor_body = fld.fold_block(dtor.node.body);
let dtor_id = fld.new_id(dtor.node.id); let dtor_id = fld.new_id(dtor.node.id);
{node: {body: dtor_body, {node: {body: dtor_body,
id: dtor_id with dtor.node} id: dtor_id,.. dtor.node},
with dtor}}; .. dtor}};
return @{ return @{
traits: vec::map(struct_def.traits, |p| fold_trait_ref(p, fld)), traits: vec::map(struct_def.traits, |p| fold_trait_ref(p, fld)),
fields: vec::map(struct_def.fields, |f| fold_struct_field(f, fld)), fields: vec::map(struct_def.fields, |f| fold_struct_field(f, fld)),
@ -467,14 +467,14 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
expr_fn(proto, fold_fn_decl(decl, fld), expr_fn(proto, fold_fn_decl(decl, fld),
fld.fold_block(body), fld.fold_block(body),
@((*captures).map(|cap_item| { @((*captures).map(|cap_item| {
@({id: fld.new_id((*cap_item).id) @({id: fld.new_id((*cap_item).id),
with *cap_item})}))) .. *cap_item})})))
} }
expr_fn_block(decl, body, captures) => { expr_fn_block(decl, body, captures) => {
expr_fn_block(fold_fn_decl(decl, fld), fld.fold_block(body), expr_fn_block(fold_fn_decl(decl, fld), fld.fold_block(body),
@((*captures).map(|cap_item| { @((*captures).map(|cap_item| {
@({id: fld.new_id((*cap_item).id) @({id: fld.new_id((*cap_item).id),
with *cap_item})}))) .. *cap_item})})))
} }
expr_block(blk) => expr_block(fld.fold_block(blk)), expr_block(blk) => expr_block(fld.fold_block(blk)),
expr_move(el, er) => { expr_move(el, er) => {
@ -575,8 +575,8 @@ fn noop_fold_variant(v: variant_, fld: ast_fold) -> variant_ {
let dtor_body = fld.fold_block(dtor.node.body); let dtor_body = fld.fold_block(dtor.node.body);
let dtor_id = fld.new_id(dtor.node.id); let dtor_id = fld.new_id(dtor.node.id);
{node: {body: dtor_body, {node: {body: dtor_body,
id: dtor_id with dtor.node} id: dtor_id,.. dtor.node},
with dtor}}; .. dtor}};
kind = struct_variant_kind(@{ kind = struct_variant_kind(@{
traits: ~[], traits: ~[],
fields: vec::map(struct_def.fields, fields: vec::map(struct_def.fields,

View file

@ -776,7 +776,7 @@ struct parser {
return @{span: mk_sp(lo, tps.span.hi), return @{span: mk_sp(lo, tps.span.hi),
rp: rp, rp: rp,
types: tps.node with *path}; types: tps.node,.. *path};
} }
fn parse_mutability() -> mutability { fn parse_mutability() -> mutability {
@ -1000,11 +1000,9 @@ struct parser {
self.bump(); self.bump();
let mut fields = ~[]; let mut fields = ~[];
vec::push(fields, self.parse_field(token::COLON)); vec::push(fields, self.parse_field(token::COLON));
while self.token != token::RBRACE && while self.token != token::RBRACE {
!self.is_keyword(~"with") {
self.expect(token::COMMA); self.expect(token::COMMA);
if self.token == token::RBRACE || if self.token == token::RBRACE ||
self.is_keyword(~"with") ||
self.token == token::DOTDOT { self.token == token::DOTDOT {
// Accept an optional trailing comma. // Accept an optional trailing comma.
break; break;
@ -1013,7 +1011,7 @@ struct parser {
} }
let base; let base;
if self.eat_keyword(~"with") || self.eat(token::DOTDOT) { if self.eat(token::DOTDOT) {
base = Some(self.parse_expr()); base = Some(self.parse_expr());
} else { } else {
base = None; base = None;
@ -1572,8 +1570,8 @@ struct parser {
let last_arg = self.mk_expr(block.span.lo, block.span.hi, let last_arg = self.mk_expr(block.span.lo, block.span.hi,
ctor(block)); ctor(block));
let args = vec::append(args, ~[last_arg]); let args = vec::append(args, ~[last_arg]);
@{node: expr_call(f, args, true) @{node: expr_call(f, args, true),
with *e} .. *e}
} }
expr_path(*) | expr_field(*) | expr_call(*) => { expr_path(*) | expr_field(*) | expr_call(*) => {
let block = self.parse_lambda_block_expr(); let block = self.parse_lambda_block_expr();
@ -1661,18 +1659,6 @@ struct parser {
base = Some(self.parse_expr()); break; base = Some(self.parse_expr()); break;
} }
// XXX: Remove "with" after all code is converted over and there's
// a snapshot.
// optional comma before "with"
if self.token == token::COMMA
&& self.token_is_keyword(~"with",
self.look_ahead(1u)) {
self.bump();
}
if self.eat_keyword(~"with") {
base = Some(self.parse_expr()); break;
}
self.expect(token::COMMA); self.expect(token::COMMA);
if self.token == token::RBRACE { if self.token == token::RBRACE {
// record ends by an optional trailing comma // record ends by an optional trailing comma
@ -2230,7 +2216,7 @@ struct parser {
token::SEMI => { token::SEMI => {
self.bump(); self.bump();
push(stmts, push(stmts,
@{node: stmt_semi(e, stmt_id) with *stmt}); @{node: stmt_semi(e, stmt_id),.. *stmt});
} }
token::RBRACE => { token::RBRACE => {
expr = Some(e); expr = Some(e);
@ -2741,8 +2727,8 @@ struct parser {
let lo = self.last_span.lo; let lo = self.last_span.lo;
let (decl_, _) = self.parse_fn_decl(|p| p.parse_arg()); let (decl_, _) = self.parse_fn_decl(|p| p.parse_arg());
let decl = {output: @{id: self.get_id(), let decl = {output: @{id: self.get_id(),
node: result_ty, span: decl_.output.span} node: result_ty, span: decl_.output.span},
with decl_}; .. decl_};
let body = self.parse_block(); let body = self.parse_block();
ctor_decl(decl, attrs, body, mk_sp(lo, self.last_span.hi)) ctor_decl(decl, attrs, body, mk_sp(lo, self.last_span.hi))
} }

View file

@ -388,8 +388,7 @@ fn contextual_keyword_table() -> hashmap<~str, ()> {
~"move", ~"move",
~"priv", ~"pub", ~"priv", ~"pub",
~"self", ~"send", ~"static", ~"self", ~"send", ~"static",
~"use", ~"use"
~"with"
]; ];
for keys.each |word| { for keys.each |word| {
words.insert(word, ()); words.insert(word, ());

View file

@ -26,8 +26,8 @@ fn strip_items(crate: @ast::crate, in_cfg: in_cfg_pred)
let precursor = let precursor =
@{fold_mod: |a,b| fold_mod(ctxt, a, b), @{fold_mod: |a,b| fold_mod(ctxt, a, b),
fold_block: fold::wrap(|a,b| fold_block(ctxt, a, b) ), fold_block: fold::wrap(|a,b| fold_block(ctxt, a, b) ),
fold_foreign_mod: |a,b| fold_foreign_mod(ctxt, a, b) fold_foreign_mod: |a,b| fold_foreign_mod(ctxt, a, b),
with *fold::default_ast_fold()}; .. *fold::default_ast_fold()};
let fold = fold::make_fold(precursor); let fold = fold::make_fold(precursor);
let res = @fold.fold_crate(*crate); let res = @fold.fold_crate(*crate);

View file

@ -44,6 +44,6 @@ fn inject_libcore_ref(sess: session,
let vis = vec::append(~[vi1, vi2], crate.node.module.view_items); let vis = vec::append(~[vi1, vi2], crate.node.module.view_items);
return @{node: {module: { view_items: vis with crate.node.module } return @{node: {module: { view_items: vis,.. crate.node.module },
with crate.node} with *crate } .. crate.node},.. *crate }
} }

View file

@ -24,6 +24,6 @@ fn inject_intrinsic(sess: session,
let items = vec::append(~[item], crate.node.module.items); let items = vec::append(~[item], crate.node.module.items);
return @{node: {module: { items: items with crate.node.module } return @{node: {module: { items: items ,.. crate.node.module }
with crate.node} with *crate } ,.. crate.node} ,.. *crate }
} }

View file

@ -47,7 +47,7 @@ fn generate_test_harness(sess: session::session,
let precursor = let precursor =
@{fold_crate: fold::wrap(|a,b| fold_crate(cx, a, b) ), @{fold_crate: fold::wrap(|a,b| fold_crate(cx, a, b) ),
fold_item: |a,b| fold_item(cx, a, b), fold_item: |a,b| fold_item(cx, a, b),
fold_mod: |a,b| fold_mod(cx, a, b) with *fold::default_ast_fold()}; fold_mod: |a,b| fold_mod(cx, a, b),.. *fold::default_ast_fold()};
let fold = fold::make_fold(precursor); let fold = fold::make_fold(precursor);
let res = @fold.fold_crate(*crate); let res = @fold.fold_crate(*crate);
@ -92,7 +92,7 @@ fn fold_crate(cx: test_ctxt, c: ast::crate_, fld: fold::ast_fold) ->
// Add a special __test module to the crate that will contain code // Add a special __test module to the crate that will contain code
// generated for the test harness // generated for the test harness
return {module: add_test_module(cx, folded.module) with folded}; return {module: add_test_module(cx, folded.module),.. folded};
} }
@ -166,7 +166,7 @@ fn should_fail(i: @ast::item) -> bool {
fn add_test_module(cx: test_ctxt, m: ast::_mod) -> ast::_mod { fn add_test_module(cx: test_ctxt, m: ast::_mod) -> ast::_mod {
let testmod = mk_test_module(cx); let testmod = mk_test_module(cx);
return {items: vec::append_one(m.items, testmod) with m}; return {items: vec::append_one(m.items, testmod),.. m};
} }
/* /*

View file

@ -31,7 +31,7 @@ fn read_crates(diag: span_handler, crate: ast::crate,
visit::mk_simple_visitor(@{visit_view_item: visit::mk_simple_visitor(@{visit_view_item:
|a| visit_view_item(e, a), |a| visit_view_item(e, a),
visit_item: |a| visit_item(e, a) visit_item: |a| visit_item(e, a)
with *visit::default_simple_visitor()}); ,.. *visit::default_simple_visitor()});
visit::visit_crate(crate, (), v); visit::visit_crate(crate, (), v);
dump_crates(e.crate_cache); dump_crates(e.crate_cache);
warn_if_multiple_versions(e, diag, e.crate_cache.get()); warn_if_multiple_versions(e, diag, e.crate_cache.get());

View file

@ -858,7 +858,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::Writer,
_ => fail ~"bad foreign item" _ => fail ~"bad foreign item"
} }
} }
with *visit::default_visitor() ,.. *visit::default_visitor()
})); }));
ebml_w.end_tag(); ebml_w.end_tag();
return *index; return *index;

View file

@ -294,7 +294,7 @@ fn parse_ty(st: @pstate, conv: conv_did) -> ty::t {
match st.tcx.rcache.find({cnum: st.crate, pos: pos, len: len}) { match st.tcx.rcache.find({cnum: st.crate, pos: pos, len: len}) {
Some(tt) => return tt, Some(tt) => return tt,
None => { None => {
let ps = @{pos: pos with *st}; let ps = @{pos: pos ,.. *st};
let tt = parse_ty(ps, conv); let tt = parse_ty(ps, conv);
st.tcx.rcache.insert({cnum: st.crate, pos: pos, len: len}, tt); st.tcx.rcache.insert({cnum: st.crate, pos: pos, len: len}, tt);
return tt; return tt;

View file

@ -247,13 +247,13 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
ast::stmt_decl(@{node: ast::decl_item(_), span: _}, _) => false ast::stmt_decl(@{node: ast::decl_item(_), span: _}, _) => false
} }
}; };
let blk_sans_items = { stmts: stmts_sans_items with blk }; let blk_sans_items = { stmts: stmts_sans_items,.. blk };
fold::noop_fold_block(blk_sans_items, fld) fold::noop_fold_block(blk_sans_items, fld)
} }
let fld = fold::make_fold(@{ let fld = fold::make_fold(@{
fold_block: fold::wrap(drop_nested_items) fold_block: fold::wrap(drop_nested_items),
with *fold::default_ast_fold() .. *fold::default_ast_fold()
}); });
match ii { match ii {
@ -269,15 +269,15 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
ast::ii_ctor(ctor, nm, tps, parent_id) => { ast::ii_ctor(ctor, nm, tps, parent_id) => {
let ctor_body = fld.fold_block(ctor.node.body); let ctor_body = fld.fold_block(ctor.node.body);
let ctor_decl = fold::fold_fn_decl(ctor.node.dec, fld); let ctor_decl = fold::fold_fn_decl(ctor.node.dec, fld);
ast::ii_ctor({node: {body: ctor_body, dec: ctor_decl ast::ii_ctor({node: {body: ctor_body, dec: ctor_decl,
with ctor.node} .. ctor.node},
with ctor}, nm, tps, parent_id) .. ctor}, nm, tps, parent_id)
} }
ast::ii_dtor(dtor, nm, tps, parent_id) => { ast::ii_dtor(dtor, nm, tps, parent_id) => {
let dtor_body = fld.fold_block(dtor.node.body); let dtor_body = fld.fold_block(dtor.node.body);
ast::ii_dtor({node: {body: dtor_body ast::ii_dtor({node: {body: dtor_body,
with dtor.node} .. dtor.node},
with dtor}, nm, tps, parent_id) .. dtor}, nm, tps, parent_id)
} }
} }
} }
@ -292,8 +292,8 @@ fn renumber_ast(xcx: extended_decode_ctxt, ii: ast::inlined_item)
-> ast::inlined_item { -> ast::inlined_item {
let fld = fold::make_fold(@{ let fld = fold::make_fold(@{
new_id: |a| xcx.tr_id(a), new_id: |a| xcx.tr_id(a),
new_span: |a| xcx.tr_span(a) new_span: |a| xcx.tr_span(a),
with *fold::default_ast_fold() .. *fold::default_ast_fold()
}); });
match ii { match ii {
@ -314,9 +314,9 @@ fn renumber_ast(xcx: extended_decode_ctxt, ii: ast::inlined_item)
let ctor_id = fld.new_id(ctor.node.id); let ctor_id = fld.new_id(ctor.node.id);
let new_parent = xcx.tr_def_id(parent_id); let new_parent = xcx.tr_def_id(parent_id);
ast::ii_ctor({node: {body: ctor_body, attrs: ctor_attrs, ast::ii_ctor({node: {body: ctor_body, attrs: ctor_attrs,
dec: ctor_decl, id: ctor_id dec: ctor_decl, id: ctor_id,
with ctor.node} .. ctor.node},
with ctor}, nm, new_params, new_parent) .. ctor}, nm, new_params, new_parent)
} }
ast::ii_dtor(dtor, nm, tps, parent_id) => { ast::ii_dtor(dtor, nm, tps, parent_id) => {
let dtor_body = fld.fold_block(dtor.node.body); let dtor_body = fld.fold_block(dtor.node.body);
@ -326,8 +326,8 @@ fn renumber_ast(xcx: extended_decode_ctxt, ii: ast::inlined_item)
let new_parent = xcx.tr_def_id(parent_id); let new_parent = xcx.tr_def_id(parent_id);
let new_self = fld.new_id(dtor.node.self_id); let new_self = fld.new_id(dtor.node.self_id);
ast::ii_dtor({node: {id: dtor_id, attrs: dtor_attrs, ast::ii_dtor({node: {id: dtor_id, attrs: dtor_attrs,
self_id: new_self, body: dtor_body} self_id: new_self, body: dtor_body},
with dtor}, .. dtor},
nm, new_params, new_parent) nm, new_params, new_parent)
} }
} }
@ -432,7 +432,7 @@ impl method_origin: tr {
typeck::method_static(did.tr(xcx)) typeck::method_static(did.tr(xcx))
} }
typeck::method_param(mp) => { typeck::method_param(mp) => {
typeck::method_param({trait_id:mp.trait_id.tr(xcx) with mp}) typeck::method_param({trait_id:mp.trait_id.tr(xcx),.. mp})
} }
typeck::method_trait(did, m) => { typeck::method_trait(did, m) => {
typeck::method_trait(did.tr(xcx), m) typeck::method_trait(did.tr(xcx), m)

View file

@ -443,7 +443,7 @@ impl borrowck_ctxt {
} }
fn cat_discr(cmt: cmt, alt_id: ast::node_id) -> cmt { fn cat_discr(cmt: cmt, alt_id: ast::node_id) -> cmt {
return @{cat:cat_discr(cmt, alt_id) with *cmt}; return @{cat:cat_discr(cmt, alt_id),.. *cmt};
} }
fn cat_pattern(cmt: cmt, pat: @ast::pat, op: fn(cmt, @ast::pat)) { fn cat_pattern(cmt: cmt, pat: @ast::pat, op: fn(cmt, @ast::pat)) {

View file

@ -67,8 +67,8 @@ fn check_loans(bccx: borrowck_ctxt,
let vt = visit::mk_vt(@{visit_expr: check_loans_in_expr, let vt = visit::mk_vt(@{visit_expr: check_loans_in_expr,
visit_local: check_loans_in_local, visit_local: check_loans_in_local,
visit_block: check_loans_in_block, visit_block: check_loans_in_block,
visit_fn: check_loans_in_fn visit_fn: check_loans_in_fn,
with *visit::default_visitor()}); .. *visit::default_visitor()});
visit::visit_crate(*crate, clcx, vt); visit::visit_crate(*crate, clcx, vt);
} }

View file

@ -53,7 +53,7 @@ fn gather_loans(bccx: borrowck_ctxt, crate: @ast::crate) -> req_maps {
mut root_ub: 0}); mut root_ub: 0});
let v = visit::mk_vt(@{visit_expr: req_loans_in_expr, let v = visit::mk_vt(@{visit_expr: req_loans_in_expr,
visit_fn: req_loans_in_fn, visit_fn: req_loans_in_fn,
with *visit::default_visitor()}); .. *visit::default_visitor()});
visit::visit_crate(*crate, glcx, v); visit::visit_crate(*crate, glcx, v);
return glcx.req_maps; return glcx.req_maps;
} }

View file

@ -158,7 +158,7 @@ priv impl &preserve_ctxt {
debug!("base.mutbl = %?", self.bccx.mut_to_str(base.mutbl)); debug!("base.mutbl = %?", self.bccx.mut_to_str(base.mutbl));
if base.mutbl == m_imm { if base.mutbl == m_imm {
let non_rooting_ctxt = let non_rooting_ctxt =
preserve_ctxt({root_managed_data: false with **self}); preserve_ctxt({root_managed_data: false,.. **self});
match (&non_rooting_ctxt).preserve(base) { match (&non_rooting_ctxt).preserve(base) {
Ok(pc_ok) => { Ok(pc_ok) => {
Ok(pc_ok) Ok(pc_ok)
@ -232,8 +232,8 @@ priv impl &preserve_ctxt {
// in the *arm* vs the *alt*. // in the *arm* vs the *alt*.
let alt_rooting_ctxt = let alt_rooting_ctxt =
preserve_ctxt({scope_region: ty::re_scope(alt_id) preserve_ctxt({scope_region: ty::re_scope(alt_id),
with **self}); .. **self});
(&alt_rooting_ctxt).preserve(base) (&alt_rooting_ctxt).preserve(base)
} }
} }

View file

@ -15,8 +15,8 @@ use std::map::hashmap;
fn check_crate(tcx: ty::ctxt, crate: @crate) { fn check_crate(tcx: ty::ctxt, crate: @crate) {
visit::visit_crate(*crate, (), visit::mk_vt(@{ visit::visit_crate(*crate, (), visit::mk_vt(@{
visit_expr: |a,b,c| check_expr(tcx, a, b, c), visit_expr: |a,b,c| check_expr(tcx, a, b, c),
visit_local: |a,b,c| check_local(tcx, a, b, c) visit_local: |a,b,c| check_local(tcx, a, b, c),
with *visit::default_visitor::<()>() .. *visit::default_visitor::<()>()
})); }));
tcx.sess.abort_if_errors(); tcx.sess.abort_if_errors();
} }

View file

@ -11,8 +11,8 @@ fn check_crate(sess: session, crate: @crate, ast_map: ast_map::map,
visit_item: |a,b,c| check_item(sess, ast_map, def_map, a, b, c), visit_item: |a,b,c| check_item(sess, ast_map, def_map, a, b, c),
visit_pat: check_pat, visit_pat: check_pat,
visit_expr: |a,b,c| visit_expr: |a,b,c|
check_expr(sess, def_map, method_map, tcx, a, b, c) check_expr(sess, def_map, method_map, tcx, a, b, c),
with *visit::default_visitor() .. *visit::default_visitor()
})); }));
sess.abort_if_errors(); sess.abort_if_errors();
} }
@ -163,8 +163,8 @@ fn check_item_recursion(sess: session, ast_map: ast_map::map,
let visitor = visit::mk_vt(@{ let visitor = visit::mk_vt(@{
visit_item: visit_item, visit_item: visit_item,
visit_expr: visit_expr visit_expr: visit_expr,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
visitor.visit_item(it, env, visitor); visitor.visit_item(it, env, visitor);

View file

@ -13,10 +13,10 @@ fn check_crate(tcx: ty::ctxt, crate: @crate) {
match e.node { match e.node {
expr_while(e, b) => { expr_while(e, b) => {
v.visit_expr(e, cx, v); v.visit_expr(e, cx, v);
v.visit_block(b, {in_loop: true with cx}, v); v.visit_block(b, {in_loop: true,.. cx}, v);
} }
expr_loop(b, _) => { expr_loop(b, _) => {
v.visit_block(b, {in_loop: true with cx}, v); v.visit_block(b, {in_loop: true,.. cx}, v);
} }
expr_fn(_, _, _, _) => { expr_fn(_, _, _, _) => {
visit::visit_expr(e, {in_loop: false, can_ret: true}, v); visit::visit_expr(e, {in_loop: false, can_ret: true}, v);
@ -47,7 +47,7 @@ fn check_crate(tcx: ty::ctxt, crate: @crate) {
} }
_ => visit::visit_expr(e, cx, v) _ => visit::visit_expr(e, cx, v)
} }
} },
with *visit::default_visitor() .. *visit::default_visitor()
})); }));
} }

View file

@ -171,8 +171,8 @@ fn process_crate(crate: @ast::crate,
def_map: resolve::DefMap, def_map: resolve::DefMap,
tcx: ty::ctxt) { tcx: ty::ctxt) {
let v = visit::mk_simple_visitor(@{ let v = visit::mk_simple_visitor(@{
visit_expr_post: |e| { classify(e, def_map, tcx); } visit_expr_post: |e| { classify(e, def_map, tcx); },
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
}); });
visit::visit_crate(*crate, (), v); visit::visit_crate(*crate, (), v);
tcx.sess.abort_if_errors(); tcx.sess.abort_if_errors();

View file

@ -74,8 +74,8 @@ fn collect_freevars(def_map: resolve::DefMap, blk: ast::blk)
} }
}; };
let v = visit::mk_vt(@{visit_item: ignore_item, visit_expr: walk_expr let v = visit::mk_vt(@{visit_item: ignore_item, visit_expr: walk_expr,
with *visit::default_visitor()}); .. *visit::default_visitor()});
v.visit_block(blk, 1, v); v.visit_block(blk, 1, v);
return @*refs; return @*refs;
} }
@ -96,8 +96,8 @@ fn annotate_freevars(def_map: resolve::DefMap, crate: @ast::crate) ->
}; };
let visitor = let visitor =
visit::mk_simple_visitor(@{visit_fn: walk_fn visit::mk_simple_visitor(@{visit_fn: walk_fn,
with *visit::default_simple_visitor()}); .. *visit::default_simple_visitor()});
visit::visit_crate(*crate, (), visitor); visit::visit_crate(*crate, (), visitor);
return freevars; return freevars;

View file

@ -81,9 +81,9 @@ fn check_crate(tcx: ty::ctxt,
visit_fn: check_fn, visit_fn: check_fn,
visit_ty: check_ty, visit_ty: check_ty,
visit_item: fn@(i: @item, cx: ctx, v: visit::vt<ctx>) { visit_item: fn@(i: @item, cx: ctx, v: visit::vt<ctx>) {
visit::visit_item(i, {current_item: i.id with cx}, v); visit::visit_item(i, {current_item: i.id,.. cx}, v);
} },
with *visit::default_visitor() .. *visit::default_visitor()
}); });
visit::visit_crate(*crate, ctx, visit); visit::visit_crate(*crate, ctx, visit);
tcx.sess.abort_if_errors(); tcx.sess.abort_if_errors();

View file

@ -165,8 +165,8 @@ struct LanguageItemCollector {
.value); .value);
} }
} }
} },
with *default_simple_visitor() .. *default_simple_visitor()
})); }));
} }

View file

@ -321,7 +321,7 @@ impl ctxt {
new_ctxt = new_ctxt =
ctxt_({is_default: false, ctxt_({is_default: false,
curr: c, curr: c,
with *new_ctxt}); .. *new_ctxt});
new_ctxt.set_level(lint.lint, level); new_ctxt.set_level(lint.lint, level);
} }
} }
@ -362,11 +362,11 @@ fn build_settings_crate(sess: session::session, crate: @ast::crate) {
sess.lint_settings.default_settings.insert(k, v); sess.lint_settings.default_settings.insert(k, v);
} }
let cx = ctxt_({is_default: true with *cx}); let cx = ctxt_({is_default: true,.. *cx});
let visit = visit::mk_vt(@{ let visit = visit::mk_vt(@{
visit_item: build_settings_item visit_item: build_settings_item,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
visit::visit_crate(*crate, cx, visit); visit::visit_crate(*crate, cx, visit);
} }
@ -387,7 +387,7 @@ fn check_item(i: @ast::item, cx: ty::ctxt) {
// not traverse into subitems, since that is handled by the outer // not traverse into subitems, since that is handled by the outer
// lint visitor. // lint visitor.
fn item_stopping_visitor<E>(v: visit::vt<E>) -> visit::vt<E> { fn item_stopping_visitor<E>(v: visit::vt<E>) -> visit::vt<E> {
visit::mk_vt(@{visit_item: |_i, _e, _v| { } with **v}) visit::mk_vt(@{visit_item: |_i, _e, _v| { },.. **v})
} }
fn check_item_while_true(cx: ty::ctxt, it: @ast::item) { fn check_item_while_true(cx: ty::ctxt, it: @ast::item) {
@ -407,8 +407,8 @@ fn check_item_while_true(cx: ty::ctxt, it: @ast::item) {
} }
_ => () _ => ()
} }
} },
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
})); }));
visit::visit_item(it, (), visit); visit::visit_item(it, (), visit);
} }
@ -519,8 +519,8 @@ fn check_item_heap(cx: ty::ctxt, it: @ast::item) {
visit_expr: fn@(e: @ast::expr) { visit_expr: fn@(e: @ast::expr) {
let ty = ty::expr_ty(cx, e); let ty = ty::expr_ty(cx, e);
check_type(cx, e.id, it.id, e.span, ty); check_type(cx, e.id, it.id, e.span, ty);
} },
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
})); }));
visit::visit_item(it, (), visit); visit::visit_item(it, (), visit);
} }
@ -540,8 +540,8 @@ fn check_item_path_statement(cx: ty::ctxt, it: @ast::item) {
} }
_ => () _ => ()
} }
} },
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
})); }));
visit::visit_item(it, (), visit); visit::visit_item(it, (), visit);
} }
@ -681,7 +681,7 @@ fn check_crate(tcx: ty::ctxt, crate: @ast::crate) {
check_fn(tcx, fk, decl, body, span, id), check_fn(tcx, fk, decl, body, span, id),
visit_pat: |pat| visit_pat: |pat|
check_pat(tcx, pat), check_pat(tcx, pat),
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
}); });
visit::visit_crate(*crate, (), v); visit::visit_crate(*crate, (), v);

View file

@ -185,7 +185,7 @@ fn check_crate(tcx: ty::ctxt,
visit_local: visit_local, visit_local: visit_local,
visit_expr: visit_expr, visit_expr: visit_expr,
visit_arm: visit_arm, visit_arm: visit_arm,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
let last_use_map = int_hash(); let last_use_map = int_hash();
@ -457,7 +457,7 @@ fn visit_fn(fk: visit::fn_kind, decl: fn_decl, body: blk,
visit_local: check_local, visit_local: check_local,
visit_expr: check_expr, visit_expr: check_expr,
visit_arm: check_arm, visit_arm: check_arm,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
check_vt.visit_block(body, lsets, check_vt); check_vt.visit_block(body, lsets, check_vt);
lsets.check_ret(id, sp, fk, entry_ln); lsets.check_ret(id, sp, fk, entry_ln);

View file

@ -67,8 +67,8 @@ fn check_crate(tcx: ty::ctxt, crate: @ast::crate) {
} }
visit::visit_expr(expr, env, visitor); visit::visit_expr(expr, env, visitor);
} },
with *visit::default_visitor() .. *visit::default_visitor()
}); });
visit::visit_crate(*crate, (), visitor); visit::visit_crate(*crate, (), visitor);
} }

View file

@ -206,7 +206,7 @@ fn resolve_block(blk: ast::blk, cx: ctxt, visitor: visit::vt<ctxt>) {
record_parent(cx, blk.node.id); record_parent(cx, blk.node.id);
// Descend. // Descend.
let new_cx: ctxt = ctxt {parent: Some(blk.node.id) with cx}; let new_cx: ctxt = ctxt {parent: Some(blk.node.id),.. cx};
visit::visit_block(blk, new_cx, visitor); visit::visit_block(blk, new_cx, visitor);
} }
@ -293,7 +293,7 @@ fn resolve_local(local: @ast::local, cx: ctxt, visitor: visit::vt<ctxt>) {
fn resolve_item(item: @ast::item, cx: ctxt, visitor: visit::vt<ctxt>) { fn resolve_item(item: @ast::item, cx: ctxt, visitor: visit::vt<ctxt>) {
// Items create a new outer block scope as far as we're concerned. // Items create a new outer block scope as far as we're concerned.
let new_cx: ctxt = ctxt {parent: None with cx}; let new_cx: ctxt = ctxt {parent: None,.. cx};
visit::visit_item(item, new_cx, visitor); visit::visit_item(item, new_cx, visitor);
} }
@ -305,7 +305,7 @@ fn resolve_fn(fk: visit::fn_kind, decl: ast::fn_decl, body: ast::blk,
visit::fk_item_fn(*) | visit::fk_method(*) | visit::fk_item_fn(*) | visit::fk_method(*) |
visit::fk_ctor(*) | visit::fk_dtor(*) => { visit::fk_ctor(*) | visit::fk_dtor(*) => {
// Top-level functions are a root scope. // Top-level functions are a root scope.
ctxt {parent: Some(id) with cx} ctxt {parent: Some(id),.. cx}
} }
visit::fk_anon(*) | visit::fk_fn_block(*) => { visit::fk_anon(*) | visit::fk_fn_block(*) => {
@ -340,8 +340,8 @@ fn resolve_crate(sess: session, def_map: resolve::DefMap,
visit_pat: resolve_pat, visit_pat: resolve_pat,
visit_stmt: resolve_stmt, visit_stmt: resolve_stmt,
visit_expr: resolve_expr, visit_expr: resolve_expr,
visit_local: resolve_local visit_local: resolve_local,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
visit::visit_crate(*crate, cx, visitor); visit::visit_crate(*crate, cx, visitor);
return cx.region_map; return cx.region_map;
@ -771,7 +771,7 @@ fn determine_rp_in_crate(sess: session,
visit_ty: determine_rp_in_ty, visit_ty: determine_rp_in_ty,
visit_ty_method: determine_rp_in_ty_method, visit_ty_method: determine_rp_in_ty_method,
visit_struct_field: determine_rp_in_struct_field, visit_struct_field: determine_rp_in_struct_field,
with *visit::default_visitor() .. *visit::default_visitor()
}); });
visit::visit_crate(*crate, cx, visitor); visit::visit_crate(*crate, cx, visitor);

View file

@ -777,9 +777,9 @@ struct Resolver {
visit_block: |block, context, visitor| visit_block: |block, context, visitor|
(*this).build_reduced_graph_for_block(block, (*this).build_reduced_graph_for_block(block,
context, context,
visitor) visitor),
with *default_visitor() .. *default_visitor()
})); }));
} }
@ -3025,8 +3025,8 @@ struct Resolver {
visit_local: |local, _context, visitor| visit_local: |local, _context, visitor|
self.resolve_local(local, visitor), self.resolve_local(local, visitor),
visit_ty: |ty, _context, visitor| visit_ty: |ty, _context, visitor|
self.resolve_type(ty, visitor) self.resolve_type(ty, visitor),
with *default_visitor() .. *default_visitor()
})); }));
} }

View file

@ -140,8 +140,8 @@ fn expand_nested_bindings(bcx: block, m: match_, col: uint, val: ValueRef)
mode: mode, mode: mode,
ty: node_id_type(bcx, ty: node_id_type(bcx,
br.pats[col].id) br.pats[col].id)
}}]) }}]),
with *br}); .. *br});
} }
_ => vec::push(result, br) _ => vec::push(result, br)
} }
@ -174,7 +174,7 @@ fn enter_match(bcx: block, dm: DefMap, m: match_, col: uint, val: ValueRef,
} }
_ => br.bound _ => br.bound
}; };
vec::push(result, @{pats: pats, bound: bound with *br}); vec::push(result, @{pats: pats, bound: bound,.. *br});
} }
None => () None => ()
} }

View file

@ -2841,7 +2841,7 @@ fn trans_lval(cx: block, e: @ast::expr) -> lval_result {
let root_loc = alloca_zeroed(lv.bcx, type_of(cx.ccx(), ty)); let root_loc = alloca_zeroed(lv.bcx, type_of(cx.ccx(), ty));
let bcx = store_temp_expr(lv.bcx, INIT, root_loc, lv, ty, false); let bcx = store_temp_expr(lv.bcx, INIT, root_loc, lv, ty, false);
add_root_cleanup(bcx, scope_id, root_loc, ty); add_root_cleanup(bcx, scope_id, root_loc, ty);
{bcx: bcx with lv} {bcx: bcx,.. lv}
} }
}; };
@ -3335,7 +3335,7 @@ fn body_contains_ret(body: ast::blk) -> bool {
_ => visit::visit_expr(e, cx, v), _ => visit::visit_expr(e, cx, v),
} }
} }
} with *visit::default_visitor() } ,.. *visit::default_visitor()
})); }));
cx.found cx.found
} }
@ -4883,7 +4883,7 @@ fn copy_args_to_allocas(fcx: fn_ctxt, bcx: block, args: ~[ast::arg],
if slf.is_owned { if slf.is_owned {
let self_val = PointerCast(bcx, slf.v, let self_val = PointerCast(bcx, slf.v,
T_ptr(type_of(bcx.ccx(), slf.t))); T_ptr(type_of(bcx.ccx(), slf.t)));
fcx.llself = Some({v: self_val with slf}); fcx.llself = Some({v: self_val,.. slf});
add_clean(bcx, self_val, slf.t); add_clean(bcx, self_val, slf.t);
} }
} }
@ -5667,8 +5667,8 @@ fn trans_constant(ccx: @crate_ctxt, it: @ast::item) {
fn trans_constants(ccx: @crate_ctxt, crate: @ast::crate) { fn trans_constants(ccx: @crate_ctxt, crate: @ast::crate) {
visit::visit_crate(*crate, (), visit::mk_simple_visitor(@{ visit::visit_crate(*crate, (), visit::mk_simple_visitor(@{
visit_item: |a| trans_constant(ccx, a) visit_item: |a| trans_constant(ccx, a),
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
})); }));
} }
@ -5775,8 +5775,8 @@ fn gather_local_rtcalls(ccx: @crate_ctxt, crate: @ast::crate) {
} }
} }
_ => () _ => ()
} },
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
})); }));
} }

View file

@ -120,8 +120,8 @@ fn trans_method_callee(bcx: block, callee_id: ast::node_id,
let {bcx, val} = trans_self_arg(bcx, self, mentry); let {bcx, val} = trans_self_arg(bcx, self, mentry);
{env: self_env(val, node_id_type(bcx, self.id), None, {env: self_env(val, node_id_type(bcx, self.id), None,
mentry.self_mode) mentry.self_mode),
with lval_static_fn(bcx, did, callee_id)} .. lval_static_fn(bcx, did, callee_id)}
} }
typeck::method_param({trait_id:trait_id, method_num:off, typeck::method_param({trait_id:trait_id, method_num:off,
param_num:p, bound_num:b}) => { param_num:p, bound_num:b}) => {
@ -186,8 +186,8 @@ fn trans_static_method_callee(bcx: block, method_id: ast::def_id,
Some(sub_origins)); Some(sub_origins));
{env: null_env, {env: null_env,
val: PointerCast(bcx, lval.val, T_ptr(type_of_fn_from_ty( val: PointerCast(bcx, lval.val, T_ptr(type_of_fn_from_ty(
ccx, node_id_type(bcx, callee_id)))) ccx, node_id_type(bcx, callee_id)))),
with lval} .. lval}
} }
_ => { _ => {
fail ~"vtable_param left in monomorphized function's vtable substs"; fail ~"vtable_param left in monomorphized function's vtable substs";
@ -255,8 +255,8 @@ fn trans_monomorphized_callee(bcx: block, callee_id: ast::node_id,
{env: self_env(val, node_id_type(bcx, base.id), {env: self_env(val, node_id_type(bcx, base.id),
None, mentry.self_mode), None, mentry.self_mode),
val: PointerCast(bcx, lval.val, T_ptr(type_of_fn_from_ty( val: PointerCast(bcx, lval.val, T_ptr(type_of_fn_from_ty(
ccx, node_id_type(bcx, callee_id)))) ccx, node_id_type(bcx, callee_id)))),
with lval} .. lval}
} }
typeck::vtable_trait(*) => { typeck::vtable_trait(*) => {
let {bcx, val} = trans_temp_expr(bcx, base); let {bcx, val} = trans_temp_expr(bcx, base);

View file

@ -144,7 +144,7 @@ fn traverse_public_item(cx: ctx, item: @item) {
} }
fn mk_ty_visitor() -> visit::vt<ctx> { fn mk_ty_visitor() -> visit::vt<ctx> {
visit::mk_vt(@{visit_ty: traverse_ty with *visit::default_visitor()}) visit::mk_vt(@{visit_ty: traverse_ty,.. *visit::default_visitor()})
} }
fn traverse_ty(ty: @ty, cx: ctx, v: visit::vt<ctx>) { fn traverse_ty(ty: @ty, cx: ctx, v: visit::vt<ctx>) {
@ -199,8 +199,8 @@ fn traverse_inline_body(cx: ctx, body: blk) {
} }
visit::visit_block(body, cx, visit::mk_vt(@{ visit::visit_block(body, cx, visit::mk_vt(@{
visit_expr: traverse_expr, visit_expr: traverse_expr,
visit_item: traverse_item visit_item: traverse_item,
with *visit::default_visitor() .. *visit::default_visitor()
})); }));
} }
@ -218,8 +218,8 @@ fn traverse_all_resources_and_impls(cx: ctx, crate_mod: _mod) {
} }
_ => () _ => ()
} }
} },
with *visit::default_visitor() .. *visit::default_visitor()
})); }));
} }

View file

@ -287,8 +287,8 @@ fn handle_body(cx: ctx, body: blk) {
node_type_needs(cx, use_repr, e.id); node_type_needs(cx, use_repr, e.id);
} }
}, },
visit_item: |_i, _cx, _v| { } visit_item: |_i, _cx, _v| { },
with *visit::default_visitor() .. *visit::default_visitor()
}); });
v.visit_block(body, cx, v); v.visit_block(body, cx, v);
} }

View file

@ -1011,7 +1011,7 @@ fn fold_sty(sty: &sty, fldop: fn(t) -> t) -> sty {
{mode: a.mode, ty: new_ty} {mode: a.mode, ty: new_ty}
}); });
let new_output = fldop(f.output); let new_output = fldop(f.output);
ty_fn({inputs: new_args, output: new_output with *f}) ty_fn({inputs: new_args, output: new_output,.. *f})
} }
ty_rptr(r, tm) => { ty_rptr(r, tm) => {
ty_rptr(r, {ty: fldop(tm.ty), mutbl: tm.mutbl}) ty_rptr(r, {ty: fldop(tm.ty), mutbl: tm.mutbl})
@ -1110,7 +1110,7 @@ fn fold_regions_and_ty(
ty::mk_fn(cx, { ty::mk_fn(cx, {
inputs: new_args, inputs: new_args,
output: new_output, output: new_output,
proto: new_proto with f proto: new_proto,.. f
}) })
} }
ref sty => { ref sty => {
@ -2915,7 +2915,7 @@ fn substd_enum_variants(cx: ctxt,
let substd_ctor_ty = subst(cx, substs, variant_info.ctor_ty); let substd_ctor_ty = subst(cx, substs, variant_info.ctor_ty);
@{args: substd_args, ctor_ty: substd_ctor_ty with *variant_info} @{args: substd_args, ctor_ty: substd_ctor_ty,.. *variant_info}
} }
} }

View file

@ -188,8 +188,8 @@ impl isr_alist: get_and_find_region {
fn check_item_types(ccx: @crate_ctxt, crate: @ast::crate) { fn check_item_types(ccx: @crate_ctxt, crate: @ast::crate) {
let visit = visit::mk_simple_visitor(@{ let visit = visit::mk_simple_visitor(@{
visit_item: |a| check_item(ccx, a) visit_item: |a| check_item(ccx, a),
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
}); });
visit::visit_crate(*crate, (), visit); visit::visit_crate(*crate, (), visit);
} }
@ -286,7 +286,7 @@ fn check_fn(ccx: @crate_ctxt,
let ty = method::transform_self_type_for_method( let ty = method::transform_self_type_for_method(
fcx.tcx(), self_region, fcx.tcx(), self_region,
info.self_ty, info.explicit_self.node); info.self_ty, info.explicit_self.node);
Some({self_ty: ty with info}) Some({self_ty: ty,.. info})
} }
}; };
@ -405,8 +405,8 @@ fn check_fn(ccx: @crate_ctxt,
visit_pat: visit_pat, visit_pat: visit_pat,
visit_fn: visit_fn, visit_fn: visit_fn,
visit_item: visit_item, visit_item: visit_item,
visit_block: visit_block visit_block: visit_block,
with *visit::default_visitor()}); .. *visit::default_visitor()});
visit.visit_block(body, (), visit); visit.visit_block(body, (), visit);
} }
@ -1649,7 +1649,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
fcx.infcx().ty_to_str(fty.output))); fcx.infcx().ty_to_str(fty.output)));
} }
} }
ty::mk_fn(tcx, {output: ty::mk_nil(tcx) with fty}) ty::mk_fn(tcx, {output: ty::mk_nil(tcx),.. fty})
} }
_ => { _ => {
tcx.sess.span_fatal(expr.span, ~"a `loop` function's last \ tcx.sess.span_fatal(expr.span, ~"a `loop` function's last \
@ -1672,8 +1672,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
fcx, expr.span, fcx.node_ty(b.id)); fcx, expr.span, fcx.node_ty(b.id));
match ty::get(block_ty).struct { match ty::get(block_ty).struct {
ty::ty_fn(fty) => { ty::ty_fn(fty) => {
fcx.write_ty(expr.id, ty::mk_fn(tcx, {output: ty::mk_bool(tcx) fcx.write_ty(expr.id, ty::mk_fn(tcx, {output: ty::mk_bool(tcx),
with fty})); .. fty}));
} }
_ => fail ~"expected fn type" _ => fail ~"expected fn type"
} }
@ -2113,8 +2113,8 @@ fn check_block_no_value(fcx: @fn_ctxt, blk: ast::blk) -> bool {
fn check_block(fcx0: @fn_ctxt, blk: ast::blk) -> bool { fn check_block(fcx0: @fn_ctxt, blk: ast::blk) -> bool {
let fcx = match blk.node.rules { let fcx = match blk.node.rules {
ast::unchecked_blk => @fn_ctxt {purity: ast::impure_fn with *fcx0}, ast::unchecked_blk => @fn_ctxt {purity: ast::impure_fn,.. *fcx0},
ast::unsafe_blk => @fn_ctxt {purity: ast::unsafe_fn with *fcx0}, ast::unsafe_blk => @fn_ctxt {purity: ast::unsafe_fn,.. *fcx0},
ast::default_blk => fcx0 ast::default_blk => fcx0
}; };
do fcx.with_region_lb(blk.node.id) { do fcx.with_region_lb(blk.node.id) {

View file

@ -324,8 +324,8 @@ struct lookup {
// (where the self type is not permitted), or from a trait // (where the self type is not permitted), or from a trait
// type (in which case methods that refer to self are not // type (in which case methods that refer to self are not
// permitted). // permitted).
let substs = {self_ty: Some(self.self_ty) let substs = {self_ty: Some(self.self_ty),
with bound_substs}; .. bound_substs};
self.add_candidates_from_m( self.add_candidates_from_m(
inner_ty, inner_ty,
@ -371,8 +371,8 @@ struct lookup {
// Note: although it is illegal to invoke a method that uses self // Note: although it is illegal to invoke a method that uses self
// through a trait instance, we use a dummy subst here so that we // through a trait instance, we use a dummy subst here so that we
// can soldier on with the compilation. // can soldier on with the compilation.
let substs = {self_ty: Some(self.self_ty) let substs = {self_ty: Some(self.self_ty),
with trait_substs}; .. trait_substs};
self.add_candidates_from_m( self.add_candidates_from_m(
inner_ty, mode, substs, m, method_trait(did, i)); inner_ty, mode, substs, m, method_trait(did, i));
@ -411,7 +411,7 @@ struct lookup {
match ty::get(ty::lookup_item_type(self.tcx(), did).ty).struct { match ty::get(ty::lookup_item_type(self.tcx(), did).ty).struct {
ty::ty_fn(fty) => { ty::ty_fn(fty) => {
ty::mk_fn(self.tcx(), ty::mk_fn(self.tcx(),
{proto: ty::proto_vstore(ty::vstore_box) with fty}) {proto: ty::proto_vstore(ty::vstore_box),.. fty})
} }
_ => fail ~"ty_from_did: not function ty" _ => fail ~"ty_from_did: not function ty"
} }
@ -534,7 +534,7 @@ struct lookup {
} }
Some(_) => self_substs.self_r Some(_) => self_substs.self_r
}; };
let self_substs = {self_r: self_r with self_substs}; let self_substs = {self_r: self_r,.. self_substs};
// Before we can be sure we succeeded we need to match the // Before we can be sure we succeeded we need to match the
// self type against the impl type that we get when we apply // self type against the impl type that we get when we apply
@ -551,8 +551,8 @@ struct lookup {
// a bit hokey, but the method unbound has a bare protocol, whereas // a bit hokey, but the method unbound has a bare protocol, whereas
// a.b has a protocol like fn@() (perhaps eventually fn&()): // a.b has a protocol like fn@() (perhaps eventually fn&()):
let fty = ty::mk_fn(tcx, {proto: ty::proto_vstore(ty::vstore_box) let fty = ty::mk_fn(tcx, {proto: ty::proto_vstore(ty::vstore_box),
with m.fty}); .. m.fty});
self.candidates.push( self.candidates.push(
{self_ty: self.self_ty, {self_ty: self.self_ty,
@ -689,8 +689,8 @@ struct lookup {
} }
}; };
let all_substs = {tps: vec::append(cand.self_substs.tps, m_substs) let all_substs = {tps: vec::append(cand.self_substs.tps, m_substs),
with cand.self_substs}; .. cand.self_substs};
self.fcx.write_ty_substs(self.node_id, cand.fty, all_substs); self.fcx.write_ty_substs(self.node_id, cand.fty, all_substs);

View file

@ -112,8 +112,8 @@ fn regionck_visitor() -> rvt {
visit_stmt: visit_stmt, visit_stmt: visit_stmt,
visit_expr: visit_expr, visit_expr: visit_expr,
visit_block: visit_block, visit_block: visit_block,
visit_local: visit_local visit_local: visit_local,
with *visit::default_visitor()}) .. *visit::default_visitor()})
} }
fn visit_item(_item: @ast::item, &&_rcx: @rcx, _v: rvt) { fn visit_item(_item: @ast::item, &&_rcx: @rcx, _v: rvt) {

View file

@ -16,7 +16,7 @@ fn replace_bound_regions_in_fn_ty(
// Take self_info apart; the self_ty part is the only one we want // Take self_info apart; the self_ty part is the only one we want
// to update here. // to update here.
let (self_ty, rebuild_self_info) = match self_info { let (self_ty, rebuild_self_info) = match self_info {
Some(s) => (Some(s.self_ty), |t| Some({self_ty: t with s})), Some(s) => (Some(s.self_ty), |t| Some({self_ty: t,.. s})),
None => (None, |_t| None) None => (None, |_t| None)
}; };

View file

@ -464,8 +464,8 @@ fn resolve_in_block(fcx: @fn_ctxt, bl: ast::blk) {
visit::visit_block(bl, fcx, visit::mk_vt(@{ visit::visit_block(bl, fcx, visit::mk_vt(@{
visit_expr: resolve_expr, visit_expr: resolve_expr,
visit_item: fn@(_i: @ast::item, &&_e: @fn_ctxt, visit_item: fn@(_i: @ast::item, &&_e: @fn_ctxt,
_v: visit::vt<@fn_ctxt>) {} _v: visit::vt<@fn_ctxt>) {},
with *visit::default_visitor() .. *visit::default_visitor()
})); }));
} }

View file

@ -185,8 +185,8 @@ fn mk_visitor() -> visit::vt<wb_ctxt> {
visit_expr: visit_expr, visit_expr: visit_expr,
visit_block: visit_block, visit_block: visit_block,
visit_pat: visit_pat, visit_pat: visit_pat,
visit_local: visit_local visit_local: visit_local,
with *visit::default_visitor()}) .. *visit::default_visitor()})
} }
fn resolve_type_vars_in_expr(fcx: @fn_ctxt, e: @ast::expr) -> bool { fn resolve_type_vars_in_expr(fcx: @fn_ctxt, e: @ast::expr) -> bool {

View file

@ -212,8 +212,8 @@ struct CoherenceChecker {
// Nothing to do. // Nothing to do.
} }
}; };
} },
with *default_simple_visitor() .. *default_simple_visitor()
})); }));
} }
@ -237,8 +237,8 @@ struct CoherenceChecker {
// Nothing to do. // Nothing to do.
} }
}; };
} },
with *default_simple_visitor() .. *default_simple_visitor()
})); }));
// Check trait coherence. // Check trait coherence.
@ -501,8 +501,8 @@ struct CoherenceChecker {
visit_item(item, (), visitor); visit_item(item, (), visitor);
} }
} }
} },
with *default_visitor() .. *default_visitor()
})); }));
} }

View file

@ -66,8 +66,8 @@ fn collect_item_types(ccx: @crate_ctxt, crate: @ast::crate) {
visit::visit_crate(*crate, (), visit::mk_simple_visitor(@{ visit::visit_crate(*crate, (), visit::mk_simple_visitor(@{
visit_item: |a|convert(ccx, a), visit_item: |a|convert(ccx, a),
visit_foreign_item: |a|convert_foreign(ccx, a) visit_foreign_item: |a|convert_foreign(ccx, a),
with *visit::default_simple_visitor() .. *visit::default_simple_visitor()
})); }));
} }

View file

@ -17,7 +17,7 @@ trait lattice_ops {
impl Lub: lattice_ops { impl Lub: lattice_ops {
fn bnd(b: bounds<ty::t>) -> Option<ty::t> { b.ub } fn bnd(b: bounds<ty::t>) -> Option<ty::t> { b.ub }
fn with_bnd(b: bounds<ty::t>, t: ty::t) -> bounds<ty::t> { fn with_bnd(b: bounds<ty::t>, t: ty::t) -> bounds<ty::t> {
{ub: Some(t) with b} {ub: Some(t),.. b}
} }
fn ty_bot(t: ty::t) -> cres<ty::t> { fn ty_bot(t: ty::t) -> cres<ty::t> {
Ok(t) Ok(t)
@ -27,7 +27,7 @@ impl Lub: lattice_ops {
impl Glb: lattice_ops { impl Glb: lattice_ops {
fn bnd(b: bounds<ty::t>) -> Option<ty::t> { b.lb } fn bnd(b: bounds<ty::t>) -> Option<ty::t> { b.lb }
fn with_bnd(b: bounds<ty::t>, t: ty::t) -> bounds<ty::t> { fn with_bnd(b: bounds<ty::t>, t: ty::t) -> bounds<ty::t> {
{lb: Some(t) with b} {lb: Some(t),.. b}
} }
fn ty_bot(_t: ty::t) -> cres<ty::t> { fn ty_bot(_t: ty::t) -> cres<ty::t> {
Ok(ty::mk_bot(self.infcx.tcx)) Ok(ty::mk_bot(self.infcx.tcx))

View file

@ -15,14 +15,14 @@ impl Sub: combine {
fn contratys(a: ty::t, b: ty::t) -> cres<ty::t> { fn contratys(a: ty::t, b: ty::t) -> cres<ty::t> {
let opp = combine_fields { let opp = combine_fields {
a_is_expected: !self.a_is_expected, with *self a_is_expected: !self.a_is_expected,.. *self
}; };
Sub(opp).tys(b, a) Sub(opp).tys(b, a)
} }
fn contraregions(a: ty::region, b: ty::region) -> cres<ty::region> { fn contraregions(a: ty::region, b: ty::region) -> cres<ty::region> {
let opp = combine_fields { let opp = combine_fields {
a_is_expected: !self.a_is_expected, with *self a_is_expected: !self.a_is_expected,.. *self
}; };
Sub(opp).regions(b, a) Sub(opp).regions(b, a)
} }

View file

@ -51,7 +51,7 @@ fn loop_query(b: ast::blk, p: fn@(ast::expr_) -> bool) -> bool {
} }
}; };
let v = visit::mk_vt(@{visit_expr: visit_expr let v = visit::mk_vt(@{visit_expr: visit_expr
with *visit::default_visitor()}); ,.. *visit::default_visitor()});
visit::visit_block(b, rs, v); visit::visit_block(b, rs, v);
return *rs; return *rs;
} }

View file

@ -30,8 +30,8 @@ fn run(
fold_item: fold_item, fold_item: fold_item,
fold_enum: fold_enum, fold_enum: fold_enum,
fold_trait: fold_trait, fold_trait: fold_trait,
fold_impl: fold_impl fold_impl: fold_impl,
with *fold::default_any_fold(srv) .. *fold::default_any_fold(srv)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -52,10 +52,10 @@ fn fold_crate(
{ {
topmod: doc::moddoc_({ topmod: doc::moddoc_({
item: { item: {
name: option::get_default(attrs.name, doc.topmod.name()) name: option::get_default(attrs.name, doc.topmod.name()),
with doc.topmod.item .. doc.topmod.item
} },
with *doc.topmod .. *doc.topmod
}) })
} }
} }
@ -84,8 +84,8 @@ fn fold_item(
}; };
{ {
desc: desc desc: desc,
with doc .. doc
} }
} }
@ -162,11 +162,11 @@ fn fold_enum(
}; };
{ {
desc: desc desc: desc,
with variant .. variant
} }
} },
with doc .. doc
} }
} }
@ -191,8 +191,8 @@ fn fold_trait(
let doc = fold::default_seq_fold_trait(fold, doc); let doc = fold::default_seq_fold_trait(fold, doc);
{ {
methods: merge_method_attrs(srv, doc.id(), doc.methods) methods: merge_method_attrs(srv, doc.id(), doc.methods),
with doc .. doc
} }
} }
@ -235,8 +235,8 @@ fn merge_method_attrs(
let desc = attrs.second(); let desc = attrs.second();
{ {
desc: desc desc: desc,
with doc .. doc
} }
} }
} }
@ -266,8 +266,8 @@ fn fold_impl(
let doc = fold::default_seq_fold_impl(fold, doc); let doc = fold::default_seq_fold_impl(fold, doc);
{ {
methods: merge_method_attrs(srv, doc.id(), doc.methods) methods: merge_method_attrs(srv, doc.id(), doc.methods),
with doc .. doc
} }
} }

View file

@ -141,8 +141,8 @@ fn config_from_opts(
let output_dir = getopts::opt_maybe_str(matches, opt_output_dir()); let output_dir = getopts::opt_maybe_str(matches, opt_output_dir());
let output_dir = option::map(output_dir, |s| Path(s)); let output_dir = option::map(output_dir, |s| Path(s));
result::Ok({ result::Ok({
output_dir: option::get_default(output_dir, config.output_dir) output_dir: option::get_default(output_dir, config.output_dir),
with config .. config
}) })
}; };
let result = do result::chain(result) |config| { let result = do result::chain(result) |config| {
@ -154,8 +154,8 @@ fn config_from_opts(
|output_format| { |output_format| {
result::Ok({ result::Ok({
output_format: output_format output_format: output_format,
with config .. config
}) })
} }
} }
@ -168,8 +168,8 @@ fn config_from_opts(
do result::chain(parse_output_style(output_style)) do result::chain(parse_output_style(output_style))
|output_style| { |output_style| {
result::Ok({ result::Ok({
output_style: output_style output_style: output_style,
with config .. config
}) })
} }
} }
@ -180,8 +180,8 @@ fn config_from_opts(
config, pandoc_cmd, program_output); config, pandoc_cmd, program_output);
do result::chain(pandoc_cmd) |pandoc_cmd| { do result::chain(pandoc_cmd) |pandoc_cmd| {
result::Ok({ result::Ok({
pandoc_cmd: pandoc_cmd pandoc_cmd: pandoc_cmd,
with config .. config
}) })
} }
}; };
@ -241,8 +241,8 @@ fn maybe_find_pandoc(
#[test] #[test]
fn should_find_pandoc() { fn should_find_pandoc() {
let config = { let config = {
output_format: pandoc_html output_format: pandoc_html,
with default_config(&Path("test")) .. default_config(&Path("test"))
}; };
let mock_program_output = fn~(_prog: &str, _args: &[~str]) -> { let mock_program_output = fn~(_prog: &str, _args: &[~str]) -> {
status: int, out: ~str, err: ~str status: int, out: ~str, err: ~str
@ -258,8 +258,8 @@ fn should_find_pandoc() {
#[test] #[test]
fn should_error_with_no_pandoc() { fn should_error_with_no_pandoc() {
let config = { let config = {
output_format: pandoc_html output_format: pandoc_html,
with default_config(&Path("test")) .. default_config(&Path("test"))
}; };
let mock_program_output = fn~(_prog: &str, _args: &[~str]) -> { let mock_program_output = fn~(_prog: &str, _args: &[~str]) -> {
status: int, out: ~str, err: ~str status: int, out: ~str, err: ~str

View file

@ -23,8 +23,8 @@ fn run(
let fold = fold::fold({ let fold = fold::fold({
fold_item: fold_item, fold_item: fold_item,
fold_trait: fold_trait, fold_trait: fold_trait,
fold_impl: fold_impl fold_impl: fold_impl,
with *fold::default_any_fold(()) .. *fold::default_any_fold(())
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -33,8 +33,8 @@ fn fold_item(fold: fold::fold<()>, doc: doc::itemdoc) -> doc::itemdoc {
let doc = fold::default_seq_fold_item(fold, doc); let doc = fold::default_seq_fold_item(fold, doc);
{ {
brief: extract(doc.desc) brief: extract(doc.desc),
with doc .. doc
} }
} }
@ -43,10 +43,10 @@ fn fold_trait(fold: fold::fold<()>, doc: doc::traitdoc) -> doc::traitdoc {
{ {
methods: par::map(doc.methods, |doc| { methods: par::map(doc.methods, |doc| {
brief: extract(doc.desc) brief: extract(doc.desc),
with doc .. doc
}) }),
with doc .. doc
} }
} }
@ -55,10 +55,10 @@ fn fold_impl(fold: fold::fold<()>, doc: doc::impldoc) -> doc::impldoc {
{ {
methods: par::map(doc.methods, |doc| { methods: par::map(doc.methods, |doc| {
brief: extract(doc.desc) brief: extract(doc.desc),
with doc .. doc
}) }),
with doc .. doc
} }
} }

View file

@ -142,8 +142,8 @@ fn default_seq_fold_doc<T>(fold: fold<T>, doc: doc::doc) -> doc::doc {
doc::itempage(fold_itemtag(fold, doc)) doc::itempage(fold_itemtag(fold, doc))
} }
} }
} },
with *doc .. *doc
}) })
} }
@ -171,8 +171,8 @@ fn default_any_fold_mod<T:send copy>(
item: fold.fold_item(fold, doc.item), item: fold.fold_item(fold, doc.item),
items: par::map(doc.items, |itemtag, copy fold| { items: par::map(doc.items, |itemtag, copy fold| {
fold_itemtag(fold, itemtag) fold_itemtag(fold, itemtag)
}) }),
with *doc .. *doc
}) })
} }
@ -184,8 +184,8 @@ fn default_seq_fold_mod<T>(
item: fold.fold_item(fold, doc.item), item: fold.fold_item(fold, doc.item),
items: vec::map(doc.items, |itemtag| { items: vec::map(doc.items, |itemtag| {
fold_itemtag(fold, itemtag) fold_itemtag(fold, itemtag)
}) }),
with *doc .. *doc
}) })
} }
@ -197,8 +197,8 @@ fn default_par_fold_mod<T:send copy>(
item: fold.fold_item(fold, doc.item), item: fold.fold_item(fold, doc.item),
items: par::map(doc.items, |itemtag, copy fold| { items: par::map(doc.items, |itemtag, copy fold| {
fold_itemtag(fold, itemtag) fold_itemtag(fold, itemtag)
}) }),
with *doc .. *doc
}) })
} }
@ -210,8 +210,8 @@ fn default_any_fold_nmod<T:send copy>(
item: fold.fold_item(fold, doc.item), item: fold.fold_item(fold, doc.item),
fns: par::map(doc.fns, |fndoc, copy fold| { fns: par::map(doc.fns, |fndoc, copy fold| {
fold.fold_fn(fold, fndoc) fold.fold_fn(fold, fndoc)
}) }),
with doc .. doc
} }
} }
@ -223,8 +223,8 @@ fn default_seq_fold_nmod<T>(
item: fold.fold_item(fold, doc.item), item: fold.fold_item(fold, doc.item),
fns: vec::map(doc.fns, |fndoc| { fns: vec::map(doc.fns, |fndoc| {
fold.fold_fn(fold, fndoc) fold.fold_fn(fold, fndoc)
}) }),
with doc .. doc
} }
} }
@ -236,8 +236,8 @@ fn default_par_fold_nmod<T:send copy>(
item: fold.fold_item(fold, doc.item), item: fold.fold_item(fold, doc.item),
fns: par::map(doc.fns, |fndoc, copy fold| { fns: par::map(doc.fns, |fndoc, copy fold| {
fold.fold_fn(fold, fndoc) fold.fold_fn(fold, fndoc)
}) }),
with doc .. doc
} }
} }
@ -275,8 +275,8 @@ fn default_seq_fold_fn<T>(
doc: doc::fndoc doc: doc::fndoc
) -> doc::fndoc { ) -> doc::fndoc {
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }
@ -285,8 +285,8 @@ fn default_seq_fold_const<T>(
doc: doc::constdoc doc: doc::constdoc
) -> doc::constdoc { ) -> doc::constdoc {
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }
@ -295,8 +295,8 @@ fn default_seq_fold_enum<T>(
doc: doc::enumdoc doc: doc::enumdoc
) -> doc::enumdoc { ) -> doc::enumdoc {
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }
@ -305,8 +305,8 @@ fn default_seq_fold_trait<T>(
doc: doc::traitdoc doc: doc::traitdoc
) -> doc::traitdoc { ) -> doc::traitdoc {
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }
@ -315,8 +315,8 @@ fn default_seq_fold_impl<T>(
doc: doc::impldoc doc: doc::impldoc
) -> doc::impldoc { ) -> doc::impldoc {
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }
@ -325,8 +325,8 @@ fn default_seq_fold_type<T>(
doc: doc::tydoc doc: doc::tydoc
) -> doc::tydoc { ) -> doc::tydoc {
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }

View file

@ -20,8 +20,8 @@ fn run(
) -> doc::doc { ) -> doc::doc {
let fold = fold::fold({ let fold = fold::fold({
fold_mod: fold_mod, fold_mod: fold_mod,
fold_nmod: fold_nmod fold_nmod: fold_nmod,
with *fold::default_any_fold(config) .. *fold::default_any_fold(config)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -34,8 +34,8 @@ fn fold_mod(
let doc = fold::default_any_fold_mod(fold, doc); let doc = fold::default_any_fold_mod(fold, doc);
doc::moddoc_({ doc::moddoc_({
index: Some(build_mod_index(doc, fold.ctxt)) index: Some(build_mod_index(doc, fold.ctxt)),
with *doc .. *doc
}) })
} }
@ -47,8 +47,8 @@ fn fold_nmod(
let doc = fold::default_any_fold_nmod(fold, doc); let doc = fold::default_any_fold_nmod(fold, doc);
{ {
index: Some(build_nmod_index(doc, fold.ctxt)) index: Some(build_nmod_index(doc, fold.ctxt)),
with doc .. doc
} }
} }
@ -229,8 +229,8 @@ mod test {
fn mk_doc(output_style: config::output_style, source: ~str) -> doc::doc { fn mk_doc(output_style: config::output_style, source: ~str) -> doc::doc {
do astsrv::from_str(source) |srv| { do astsrv::from_str(source) |srv| {
let config = { let config = {
output_style: output_style output_style: output_style,
with config::default_config(&Path("whatever")) .. config::default_config(&Path("whatever"))
}; };
let doc = extract::from_srv(srv, ~""); let doc = extract::from_srv(srv, ~"");
let doc = attr_pass::mk_pass().f(srv, doc); let doc = attr_pass::mk_pass().f(srv, doc);

View file

@ -537,12 +537,12 @@ fn should_correctly_indent_fn_signature() {
doc::cratepage({ doc::cratepage({
topmod: doc::moddoc_({ topmod: doc::moddoc_({
items: ~[doc::fntag({ items: ~[doc::fntag({
sig: Some(~"line 1\nline 2") sig: Some(~"line 1\nline 2"),
with doc.cratemod().fns()[0] .. doc.cratemod().fns()[0]
})] })],
with *doc.cratemod() .. *doc.cratemod()
}) }),
with doc.cratedoc() .. doc.cratedoc()
}) })
] ]
}); });
@ -784,8 +784,8 @@ mod test {
do astsrv::from_str(source) |srv| { do astsrv::from_str(source) |srv| {
let config = { let config = {
output_style: config::doc_per_crate output_style: config::doc_per_crate,
with config::default_config(&Path("whatever")) .. config::default_config(&Path("whatever"))
}; };
let doc = extract::from_srv(srv, ~""); let doc = extract::from_srv(srv, ~"");

View file

@ -205,8 +205,8 @@ fn should_use_markdown_file_name_based_off_crate() {
let config = { let config = {
output_dir: Path("output/dir"), output_dir: Path("output/dir"),
output_format: config::markdown, output_format: config::markdown,
output_style: config::doc_per_crate output_style: config::doc_per_crate,
with config::default_config(&Path("input/test.rc")) .. config::default_config(&Path("input/test.rc"))
}; };
let doc = test::mk_doc(~"test", ~""); let doc = test::mk_doc(~"test", ~"");
let page = doc::cratepage(doc.cratedoc()); let page = doc::cratepage(doc.cratedoc());
@ -219,8 +219,8 @@ fn should_name_html_crate_file_name_index_html_when_doc_per_mod() {
let config = { let config = {
output_dir: Path("output/dir"), output_dir: Path("output/dir"),
output_format: config::pandoc_html, output_format: config::pandoc_html,
output_style: config::doc_per_mod output_style: config::doc_per_mod,
with config::default_config(&Path("input/test.rc")) .. config::default_config(&Path("input/test.rc"))
}; };
let doc = test::mk_doc(~"", ~""); let doc = test::mk_doc(~"", ~"");
let page = doc::cratepage(doc.cratedoc()); let page = doc::cratepage(doc.cratedoc());
@ -233,8 +233,8 @@ fn should_name_mod_file_names_by_path() {
let config = { let config = {
output_dir: Path("output/dir"), output_dir: Path("output/dir"),
output_format: config::pandoc_html, output_format: config::pandoc_html,
output_style: config::doc_per_mod output_style: config::doc_per_mod,
with config::default_config(&Path("input/test.rc")) .. config::default_config(&Path("input/test.rc"))
}; };
let doc = test::mk_doc(~"", ~"mod a { mod b { } }"); let doc = test::mk_doc(~"", ~"mod a { mod b { } }");
let modb = doc.cratemod().mods()[0].mods()[0]; let modb = doc.cratemod().mods()[0].mods()[0];

View file

@ -60,8 +60,8 @@ fn find_pages(doc: doc::doc, page_chan: page_chan) {
let fold = fold::fold({ let fold = fold::fold({
fold_crate: fold_crate, fold_crate: fold_crate,
fold_mod: fold_mod, fold_mod: fold_mod,
fold_nmod: fold_nmod fold_nmod: fold_nmod,
with *fold::default_any_fold(page_chan) .. *fold::default_any_fold(page_chan)
}); });
fold.fold_doc(fold, doc); fold.fold_doc(fold, doc);
@ -76,8 +76,8 @@ fn fold_crate(
let doc = fold::default_seq_fold_crate(fold, doc); let doc = fold::default_seq_fold_crate(fold, doc);
let page = doc::cratepage({ let page = doc::cratepage({
topmod: strip_mod(doc.topmod) topmod: strip_mod(doc.topmod),
with doc .. doc
}); });
comm::send(fold.ctxt, Some(page)); comm::send(fold.ctxt, Some(page));
@ -110,8 +110,8 @@ fn strip_mod(doc: doc::moddoc) -> doc::moddoc {
doc::nmodtag(_) => false, doc::nmodtag(_) => false,
_ => true _ => true
} }
} },
with *doc .. *doc
}) })
} }

View file

@ -26,16 +26,16 @@ fn run(srv: astsrv::srv, doc: doc::doc) -> doc::doc {
let fold = fold::fold({ let fold = fold::fold({
fold_item: fold_item, fold_item: fold_item,
fold_mod: fold_mod, fold_mod: fold_mod,
fold_nmod: fold_nmod fold_nmod: fold_nmod,
with *fold::default_any_fold(ctxt) .. *fold::default_any_fold(ctxt)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
fn fold_item(fold: fold::fold<ctxt>, doc: doc::itemdoc) -> doc::itemdoc { fn fold_item(fold: fold::fold<ctxt>, doc: doc::itemdoc) -> doc::itemdoc {
{ {
path: fold.ctxt.path path: fold.ctxt.path,
with doc .. doc
} }
} }
@ -48,8 +48,8 @@ fn fold_mod(fold: fold::fold<ctxt>, doc: doc::moddoc) -> doc::moddoc {
if !is_topmod { vec::pop(fold.ctxt.path); } if !is_topmod { vec::pop(fold.ctxt.path); }
doc::moddoc_({ doc::moddoc_({
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with *doc .. *doc
}) })
} }
@ -59,8 +59,8 @@ fn fold_nmod(fold: fold::fold<ctxt>, doc: doc::nmoddoc) -> doc::nmoddoc {
vec::pop(fold.ctxt.path); vec::pop(fold.ctxt.path);
{ {
item: fold.fold_item(fold, doc.item) item: fold.fold_item(fold, doc.item),
with doc .. doc
} }
} }

View file

@ -13,8 +13,8 @@ fn mk_pass() -> pass {
fn run(srv: astsrv::srv, doc: doc::doc) -> doc::doc { fn run(srv: astsrv::srv, doc: doc::doc) -> doc::doc {
let fold = fold::fold({ let fold = fold::fold({
fold_mod: fold_mod fold_mod: fold_mod,
with *fold::default_any_fold(srv) .. *fold::default_any_fold(srv)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -28,8 +28,8 @@ fn fold_mod(
doc::moddoc_({ doc::moddoc_({
items: vec::filter(doc.items, |itemtag| { items: vec::filter(doc.items, |itemtag| {
!is_hidden(fold.ctxt, itemtag.item()) !is_hidden(fold.ctxt, itemtag.item())
}) }),
with *doc .. *doc
}) })
} }

View file

@ -53,8 +53,8 @@ fn test_run_passes() {
doc::cratepage({ doc::cratepage({
topmod: doc::moddoc_({ topmod: doc::moddoc_({
item: { item: {
name: doc.cratemod().name() + ~"two" name: doc.cratemod().name() + ~"two",
with doc.cratemod().item .. doc.cratemod().item
}, },
items: ~[], items: ~[],
index: None index: None
@ -72,8 +72,8 @@ fn test_run_passes() {
doc::cratepage({ doc::cratepage({
topmod: doc::moddoc_({ topmod: doc::moddoc_({
item: { item: {
name: doc.cratemod().name() + ~"three" name: doc.cratemod().name() + ~"three",
with doc.cratemod().item .. doc.cratemod().item
}, },
items: ~[], items: ~[],
index: None index: None

View file

@ -15,8 +15,8 @@ fn run(_srv: astsrv::srv, doc: doc::doc) -> doc::doc {
let fold = fold::fold({ let fold = fold::fold({
fold_item: fold_item, fold_item: fold_item,
fold_trait: fold_trait, fold_trait: fold_trait,
fold_impl: fold_impl fold_impl: fold_impl,
with *fold::default_any_fold(()) .. *fold::default_any_fold(())
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -27,8 +27,8 @@ fn fold_item(fold: fold::fold<()>, doc: doc::itemdoc) -> doc::itemdoc {
{ {
desc: desc, desc: desc,
sections: sections sections: sections,
with doc .. doc
} }
} }
@ -41,11 +41,11 @@ fn fold_trait(fold: fold::fold<()>, doc: doc::traitdoc) -> doc::traitdoc {
{ {
desc: desc, desc: desc,
sections: sections sections: sections,
with method ..method
} }
} },
with doc .. doc
} }
} }
@ -58,11 +58,11 @@ fn fold_impl(fold: fold::fold<()>, doc: doc::impldoc) -> doc::impldoc {
{ {
desc: desc, desc: desc,
sections: sections sections: sections,
with method .. method
} }
} },
with doc .. doc
} }
} }
@ -109,8 +109,8 @@ fn sectionalize(desc: Option<~str>) -> (Option<~str>, ~[doc::section]) {
match copy current_section { match copy current_section {
Some(section) => { Some(section) => {
current_section = Some({ current_section = Some({
body: section.body + ~"\n" + line body: section.body + ~"\n" + line,
with section .. section
}); });
} }
None => { None => {

View file

@ -23,8 +23,8 @@ fn run(
lteq: item_lteq lteq: item_lteq
) -> doc::doc { ) -> doc::doc {
let fold = fold::fold({ let fold = fold::fold({
fold_mod: fold_mod fold_mod: fold_mod,
with *fold::default_any_fold(lteq) .. *fold::default_any_fold(lteq)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -36,8 +36,8 @@ fn fold_mod(
) -> doc::moddoc { ) -> doc::moddoc {
let doc = fold::default_any_fold_mod(fold, doc); let doc = fold::default_any_fold_mod(fold, doc);
doc::moddoc_({ doc::moddoc_({
items: sort::merge_sort(fold.ctxt, doc.items) items: sort::merge_sort(fold.ctxt, doc.items),
with *doc .. *doc
}) })
} }

View file

@ -25,8 +25,8 @@ fn run(
fold_item: fold_item, fold_item: fold_item,
fold_enum: fold_enum, fold_enum: fold_enum,
fold_trait: fold_trait, fold_trait: fold_trait,
fold_impl: fold_impl fold_impl: fold_impl,
with *fold::default_any_fold(op) .. *fold::default_any_fold(op)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -41,8 +41,8 @@ fn fold_item(fold: fold::fold<op>, doc: doc::itemdoc) -> doc::itemdoc {
{ {
brief: maybe_apply_op(fold.ctxt, doc.brief), brief: maybe_apply_op(fold.ctxt, doc.brief),
desc: maybe_apply_op(fold.ctxt, doc.desc), desc: maybe_apply_op(fold.ctxt, doc.desc),
sections: apply_to_sections(fold.ctxt, doc.sections) sections: apply_to_sections(fold.ctxt, doc.sections),
with doc .. doc
} }
} }
@ -59,11 +59,11 @@ fn fold_enum(fold: fold::fold<op>, doc: doc::enumdoc) -> doc::enumdoc {
{ {
variants: do par::map(doc.variants) |variant, copy fold| { variants: do par::map(doc.variants) |variant, copy fold| {
{ {
desc: maybe_apply_op(fold.ctxt, variant.desc) desc: maybe_apply_op(fold.ctxt, variant.desc),
with variant .. variant
} }
} },
with doc .. doc
} }
} }
@ -71,8 +71,8 @@ fn fold_trait(fold: fold::fold<op>, doc: doc::traitdoc) -> doc::traitdoc {
let doc = fold::default_seq_fold_trait(fold, doc); let doc = fold::default_seq_fold_trait(fold, doc);
{ {
methods: apply_to_methods(fold.ctxt, doc.methods) methods: apply_to_methods(fold.ctxt, doc.methods),
with doc .. doc
} }
} }
@ -81,8 +81,8 @@ fn apply_to_methods(op: op, docs: ~[doc::methoddoc]) -> ~[doc::methoddoc] {
{ {
brief: maybe_apply_op(op, doc.brief), brief: maybe_apply_op(op, doc.brief),
desc: maybe_apply_op(op, doc.desc), desc: maybe_apply_op(op, doc.desc),
sections: apply_to_sections(op, doc.sections) sections: apply_to_sections(op, doc.sections),
with doc .. doc
} }
} }
} }
@ -91,8 +91,8 @@ fn fold_impl(fold: fold::fold<op>, doc: doc::impldoc) -> doc::impldoc {
let doc = fold::default_seq_fold_impl(fold, doc); let doc = fold::default_seq_fold_impl(fold, doc);
{ {
methods: apply_to_methods(fold.ctxt, doc.methods) methods: apply_to_methods(fold.ctxt, doc.methods),
with doc .. doc
} }
} }

View file

@ -26,8 +26,8 @@ fn run(
fold_enum: fold_enum, fold_enum: fold_enum,
fold_trait: fold_trait, fold_trait: fold_trait,
fold_impl: fold_impl, fold_impl: fold_impl,
fold_type: fold_type fold_type: fold_type,
with *fold::default_any_fold(srv) .. *fold::default_any_fold(srv)
}); });
fold.fold_doc(fold, doc) fold.fold_doc(fold, doc)
} }
@ -40,8 +40,8 @@ fn fold_fn(
let srv = fold.ctxt; let srv = fold.ctxt;
{ {
sig: get_fn_sig(srv, doc.id()) sig: get_fn_sig(srv, doc.id()),
with doc .. doc
} }
} }
@ -91,8 +91,8 @@ fn fold_const(
} }
_ => fail ~"fold_const: id not bound to a const item" _ => fail ~"fold_const: id not bound to a const item"
} }
}) }),
with doc .. doc
} }
} }
@ -128,11 +128,11 @@ fn fold_enum(
}; };
{ {
sig: Some(sig) sig: Some(sig),
with variant .. variant
} }
} },
with doc .. doc
} }
} }
@ -147,8 +147,8 @@ fn fold_trait(
doc: doc::traitdoc doc: doc::traitdoc
) -> doc::traitdoc { ) -> doc::traitdoc {
{ {
methods: merge_methods(fold.ctxt, doc.id(), doc.methods) methods: merge_methods(fold.ctxt, doc.id(), doc.methods),
with doc .. doc
} }
} }
@ -159,8 +159,8 @@ fn merge_methods(
) -> ~[doc::methoddoc] { ) -> ~[doc::methoddoc] {
do par::map(docs) |doc| { do par::map(docs) |doc| {
{ {
sig: get_method_sig(srv, item_id, doc.name) sig: get_method_sig(srv, item_id, doc.name),
with doc .. doc
} }
} }
} }
@ -258,8 +258,8 @@ fn fold_impl(
{ {
trait_types: trait_types, trait_types: trait_types,
self_ty: self_ty, self_ty: self_ty,
methods: merge_methods(fold.ctxt, doc.id(), doc.methods) methods: merge_methods(fold.ctxt, doc.id(), doc.methods),
with doc .. doc
} }
} }
@ -311,8 +311,8 @@ fn fold_type(
} }
_ => fail ~"expected type" _ => fail ~"expected type"
} }
} },
with doc .. doc
} }
} }

View file

@ -7,5 +7,5 @@ type point = {x: int, y: int};
fn main() { fn main() {
let origin: point = {x: 0, y: 0}; let origin: point = {x: 0, y: 0};
let origin3d: point = {z: 0 with origin}; let origin3d: point = {z: 0,.. origin};
} }

View file

@ -4,6 +4,6 @@ type point = {x: int, y: int};
fn main() { fn main() {
let mut origin: point; let mut origin: point;
origin = {x: 10 with origin}; //~ ERROR use of possibly uninitialized variable: `origin` origin = {x: 10,.. origin}; //~ ERROR use of possibly uninitialized variable: `origin`
copy origin; copy origin;
} }

View file

@ -4,5 +4,5 @@ fn main() {
let a = {foo: 0i}; let a = {foo: 0i};
let b = {foo: true with a}; let b = {foo: true,.. a};
} }

View file

@ -9,7 +9,7 @@ struct my_resource {
fn main() { fn main() {
{ {
let a = {x: 0, y: my_resource(20)}; let a = {x: 0, y: my_resource(20)};
let b = {x: 2 with a}; let b = {x: 2,.. a};
log(error, (a, b)); log(error, (a, b));
} }
} }

View file

@ -1,5 +1,5 @@
// error-pattern:beep boop // error-pattern:beep boop
fn main() { fn main() {
let origin = {x: 0, y: 0}; let origin = {x: 0, y: 0};
let f: {x:int,y:int} = {x: (fail ~"beep boop") with origin}; let f: {x:int,y:int} = {x: (fail ~"beep boop"),.. origin};
} }

View file

@ -8,12 +8,12 @@ fn main() {
let y = { let y = {
f: 1, f: 1,
g: 1, g: 1,
with x .. x
}; };
let z = { let z = {
f: 1, f: 1,
with x .. x
}; };
} }

View file

@ -47,7 +47,7 @@ type biggy = {
fn getbig(i: biggy) { fn getbig(i: biggy) {
if i.a00 != 0u64 { if i.a00 != 0u64 {
getbig({a00: i.a00 - 1u64 with i}); getbig({a00: i.a00 - 1u64,.. i});
} }
} }

View file

@ -6,8 +6,8 @@ type point = {x: int, y: int};
fn main() { fn main() {
let origin: point = {x: 0, y: 0}; let origin: point = {x: 0, y: 0};
let right: point = {x: origin.x + 10 with origin}; let right: point = {x: origin.x + 10,.. origin};
let up: point = {y: origin.y + 10 with origin}; let up: point = {y: origin.y + 10,.. origin};
assert (origin.x == 0); assert (origin.x == 0);
assert (origin.y == 0); assert (origin.y == 0);
assert (right.x == 10); assert (right.x == 10);