Skip to content

Commit 200959d

Browse files
committed
Remove 'with'
1 parent ef880f2 commit 200959d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+404
-419
lines changed

doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,9 +1595,9 @@ The order of the fields in a record expression is significant, and
15951595
determines the type of the resulting value. `{a: u8, b: u8}` and `{b:
15961596
u8, a: u8}` are two different fields.
15971597

1598-
A record expression can terminate with the word `with` followed by an
1598+
A record expression can terminate with the syntax `..` followed by an
15991599
expression to denote a functional update. The expression following
1600-
`with` (the base) must be of a record type that includes at least all the
1600+
`..` (the base) must be of a record type that includes at least all the
16011601
fields mentioned in the record expression. A new record will be
16021602
created, of the same type as the base expression, with the given
16031603
values for the fields that were explicitly specified, and the values
@@ -1606,7 +1606,7 @@ such a record expression is not significant.
16061606

16071607
~~~~
16081608
let base = {x: 1, y: 2, z: 3};
1609-
{y: 0, z: 10 with base};
1609+
{y: 0, z: 10, .. base};
16101610
~~~~
16111611

16121612
### Field expressions

src/cargo/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ fn load_crate(filename: &Path) -> Option<crate> {
362362
let v = visit::mk_simple_visitor(@{
363363
visit_view_item: |a| goto_view_item(sess, e, a),
364364
visit_item: |a| goto_item(e, a),
365-
with *visit::default_simple_visitor()
365+
.. *visit::default_simple_visitor()
366366
});
367367

368368
visit::visit_crate(*c, (), v);

src/fuzzer/fuzzer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
132132
let tys = @mut ~[];
133133
let v = visit::mk_simple_visitor(@{
134134
visit_expr: |a| stash_expr_if(safe_to_steal_expr, exprs, a, tm),
135-
visit_ty: |a| stash_ty_if(safe_to_steal_ty, tys, a, tm)
136-
with *visit::default_simple_visitor()
135+
visit_ty: |a| stash_ty_if(safe_to_steal_ty, tys, a, tm),
136+
.. *visit::default_simple_visitor()
137137
});
138138
visit::visit_crate(crate, (), v);
139139
{exprs: *exprs, tys: *tys}
@@ -182,8 +182,8 @@ fn replace_expr_in_crate(crate: ast::crate, i: uint,
182182
let afp = @{
183183
fold_expr: fold::wrap(|a,b| {
184184
fold_expr_rep(j, i, newexpr.node, a, b, tm)
185-
})
186-
with *fold::default_ast_fold()
185+
}),
186+
.. *fold::default_ast_fold()
187187
};
188188
let af = fold::make_fold(afp);
189189
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,
205205
} else { fold::noop_fold_ty(original, fld) }
206206
}
207207
let afp = @{
208-
fold_ty: fold::wrap(|a,b| fold_ty_rep(j, i, newty.node, a, b, tm) )
209-
with *fold::default_ast_fold()
208+
fold_ty: fold::wrap(|a,b| fold_ty_rep(j, i, newty.node, a, b, tm) ),
209+
.. *fold::default_ast_fold()
210210
};
211211
let af = fold::make_fold(afp);
212212
let crate2: @ast::crate = @af.fold_crate(crate);
@@ -452,8 +452,8 @@ fn has_raw_pointers(c: ast::crate) -> bool {
452452
}
453453
}
454454
let v =
455-
visit::mk_simple_visitor(@{visit_ty: |a| visit_ty(has_rp, a)
456-
with *visit::default_simple_visitor()});
455+
visit::mk_simple_visitor(@{visit_ty: |a| visit_ty(has_rp, a),
456+
.. *visit::default_simple_visitor()});
457457
visit::visit_crate(c, (), v);
458458
return *has_rp;
459459
}

src/libcore/task.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ priv impl TaskBuilder {
247247
fail ~"Cannot copy a task_builder"; // Fake move mode on self
248248
}
249249
self.consumed = true;
250-
TaskBuilder({ can_not_copy: None, mut consumed: false, with *self })
250+
TaskBuilder({ can_not_copy: None, mut consumed: false,.. *self })
251251
}
252252
}
253253

@@ -258,9 +258,9 @@ impl TaskBuilder {
258258
*/
259259
fn unlinked() -> TaskBuilder {
260260
TaskBuilder({
261-
opts: { linked: false with self.opts },
261+
opts: { linked: false,.. self.opts },
262262
can_not_copy: None,
263-
with *self.consume()
263+
.. *self.consume()
264264
})
265265
}
266266
/**
@@ -270,9 +270,9 @@ impl TaskBuilder {
270270
*/
271271
fn supervised() -> TaskBuilder {
272272
TaskBuilder({
273-
opts: { linked: false, supervised: true with self.opts },
273+
opts: { linked: false, supervised: true,.. self.opts },
274274
can_not_copy: None,
275-
with *self.consume()
275+
.. *self.consume()
276276
})
277277
}
278278
/**
@@ -281,9 +281,9 @@ impl TaskBuilder {
281281
*/
282282
fn linked() -> TaskBuilder {
283283
TaskBuilder({
284-
opts: { linked: true, supervised: false with self.opts },
284+
opts: { linked: true, supervised: false,.. self.opts },
285285
can_not_copy: None,
286-
with *self.consume()
286+
.. *self.consume()
287287
})
288288
}
289289

@@ -326,18 +326,18 @@ impl TaskBuilder {
326326
327327
// Reconfigure self to use a notify channel.
328328
TaskBuilder({
329-
opts: { notify_chan: Some(ch) with self.opts },
329+
opts: { notify_chan: Some(ch),.. self.opts },
330330
can_not_copy: None,
331-
with *self.consume()
331+
.. *self.consume()
332332
})
333333
}
334334
/// Configure a custom scheduler mode for the task.
335335
fn sched_mode(mode: SchedMode) -> TaskBuilder {
336336
TaskBuilder({
337-
opts: { sched: Some({ mode: mode, foreign_stack_size: None})
338-
with self.opts },
337+
opts: { sched: Some({ mode: mode, foreign_stack_size: None}),
338+
.. self.opts },
339339
can_not_copy: None,
340-
with *self.consume()
340+
.. *self.consume()
341341
})
342342
}
343343
@@ -358,7 +358,7 @@ impl TaskBuilder {
358358
TaskBuilder({
359359
gen_body: |body| { wrapper(prev_gen_body(body)) },
360360
can_not_copy: None,
361-
with *self.consume()
361+
.. *self.consume()
362362
})
363363
}
364364
@@ -1560,8 +1560,8 @@ fn test_spawn_raw_simple() {
15601560
#[ignore(cfg(windows))]
15611561
fn test_spawn_raw_unsupervise() {
15621562
let opts = {
1563-
linked: false
1564-
with default_task_opts()
1563+
linked: false,
1564+
.. default_task_opts()
15651565
};
15661566
do spawn_raw(opts) {
15671567
fail;
@@ -1623,9 +1623,9 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails
16231623
// they don't make sense (redundant with task().supervised()).
16241624
let b0 = task();
16251625
let b1 = TaskBuilder({
1626-
opts: { linked: true, supervised: true with b0.opts },
1626+
opts: { linked: true, supervised: true,.. b0.opts },
16271627
can_not_copy: None,
1628-
with *b0
1628+
.. *b0
16291629
});
16301630
do b1.spawn { fail; }
16311631
comm::recv(po); // We should get punted awake
@@ -1636,9 +1636,9 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails
16361636
// they don't make sense (redundant with task().supervised()).
16371637
let b0 = task();
16381638
let b1 = TaskBuilder({
1639-
opts: { linked: true, supervised: true with b0.opts },
1639+
opts: { linked: true, supervised: true,.. b0.opts },
16401640
can_not_copy: None,
1641-
with *b0
1641+
.. *b0
16421642
});
16431643
do b1.spawn { loop { task::yield(); } }
16441644
fail; // *both* mechanisms would be wrong if this didn't kill the child...
@@ -1724,8 +1724,8 @@ fn test_spawn_raw_notify() {
17241724
let notify_ch = comm::Chan(notify_po);
17251725

17261726
let opts = {
1727-
notify_chan: Some(notify_ch)
1728-
with default_task_opts()
1727+
notify_chan: Some(notify_ch),
1728+
.. default_task_opts()
17291729
};
17301730
do spawn_raw(opts) {
17311731
comm::send(task_ch, get_task());
@@ -1735,8 +1735,8 @@ fn test_spawn_raw_notify() {
17351735

17361736
let opts = {
17371737
linked: false,
1738-
notify_chan: Some(notify_ch)
1739-
with default_task_opts()
1738+
notify_chan: Some(notify_ch),
1739+
.. default_task_opts()
17401740
};
17411741
do spawn_raw(opts) {
17421742
comm::send(task_ch, get_task());
@@ -2042,7 +2042,7 @@ fn test_unkillable() {
20422042
let ch = po.chan();
20432043
20442044
// We want to do this after failing
2045-
do spawn_raw({ linked: false with default_task_opts() }) {
2045+
do spawn_raw({ linked: false,.. default_task_opts() }) {
20462046
for iter::repeat(10u) { yield() }
20472047
ch.send(());
20482048
}
@@ -2078,7 +2078,7 @@ fn test_unkillable_nested() {
20782078
let ch = po.chan();
20792079
20802080
// We want to do this after failing
2081-
do spawn_raw({ linked: false with default_task_opts() }) {
2081+
do spawn_raw({ linked: false,.. default_task_opts() }) {
20822082
for iter::repeat(10u) { yield() }
20832083
ch.send(());
20842084
}

src/libsyntax/ast_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ fn mk_ast_map_visitor() -> vt {
9696
visit_local: map_local,
9797
visit_arm: map_arm,
9898
visit_view_item: map_view_item,
99-
visit_block: map_block
100-
with *visit::default_visitor()
99+
visit_block: map_block,
100+
.. *visit::default_visitor()
101101
});
102102
}
103103

src/libsyntax/ext/auto_serialize.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ fn expand(cx: ext_ctxt,
9696
}
9797

9898
fn filter_attrs(item: @ast::item) -> @ast::item {
99-
@{attrs: vec::filter(item.attrs, not_auto_serialize)
100-
with *item}
99+
@{attrs: vec::filter(item.attrs, not_auto_serialize),
100+
.. *item}
101101
}
102102

103103
do vec::flat_map(in_items) |in_item| {
@@ -281,8 +281,8 @@ impl ext_ctxt: ext_ctxt_helpers {
281281

282282
fn clone_folder() -> fold::ast_fold {
283283
fold::make_fold(@{
284-
new_id: |_id| self.next_id()
285-
with *fold::default_ast_fold()
284+
new_id: |_id| self.next_id(),
285+
.. *fold::default_ast_fold()
286286
})
287287
}
288288

@@ -311,8 +311,8 @@ impl ext_ctxt: ext_ctxt_helpers {
311311
}
312312

313313
let fld = fold::make_fold(@{
314-
new_span: |a| repl_sp(a, ast_util::dummy_sp(), span)
315-
with *fold::default_ast_fold()
314+
new_span: |a| repl_sp(a, ast_util::dummy_sp(), span),
315+
.. *fold::default_ast_fold()
316316
});
317317

318318
fld.fold_expr(expr)
@@ -799,8 +799,8 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
799799
vec::map(tps, |tp| {
800800
let cloned = cx.clone_ty_param(tp);
801801
{bounds: @(vec::append(*cloned.bounds,
802-
~[ast::bound_copy]))
803-
with cloned}
802+
~[ast::bound_copy])),
803+
.. cloned}
804804
}));
805805

806806
let deser_blk = cx.expr_blk(f(cx, tps_map, #ast[expr]{__d}));

src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn expand_mod_items(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
160160
}
161161
};
162162

163-
return {items: new_items with module_};
163+
return {items: new_items,.. module_};
164164
}
165165

166166

@@ -259,8 +259,8 @@ fn expand_crate(parse_sess: parse::parse_sess,
259259
@{fold_expr: |a,b,c| expand_expr(exts, cx, a, b, c, afp.fold_expr),
260260
fold_mod: |a,b| expand_mod_items(exts, cx, a, b, afp.fold_mod),
261261
fold_item: |a,b| expand_item(exts, cx, a, b, afp.fold_item),
262-
new_span: |a|new_span(cx, a)
263-
with *afp};
262+
new_span: |a|new_span(cx, a),
263+
.. *afp};
264264
let f = make_fold(f_pre);
265265
let cm = parse_expr_from_source_str(~"<core-macros>",
266266
@core_macros(),

src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ trait append_types {
3535

3636
impl @ast::path: append_types {
3737
fn add_ty(ty: @ast::ty) -> @ast::path {
38-
@{types: vec::append_one(self.types, ty)
39-
with *self}
38+
@{types: vec::append_one(self.types, ty),
39+
.. *self}
4040
}
4141

4242
fn add_tys(+tys: ~[@ast::ty]) -> @ast::path {
43-
@{types: vec::append(self.types, tys)
44-
with *self}
43+
@{types: vec::append(self.types, tys),
44+
.. *self}
4545
}
4646
}
4747

src/libsyntax/ext/qquote.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ impl @ast::pat: qq_helper {
117117
fn gather_anti_quotes<N: qq_helper>(lo: uint, node: N) -> aq_ctxt
118118
{
119119
let v = @{visit_expr: |node, &&cx, v| visit_aq(node, ~"from_expr", cx, v),
120-
visit_ty: |node, &&cx, v| visit_aq(node, ~"from_ty", cx, v)
121-
with *default_visitor()};
120+
visit_ty: |node, &&cx, v| visit_aq(node, ~"from_ty", cx, v),
121+
.. *default_visitor()};
122122
let cx = @{lo:lo, gather: DVec()};
123123
node.visit(cx, mk_vt(v));
124124
// 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)
301301
let f_pre = @{fold_expr: |a,b,c|replace_expr(repls, a, b, c,
302302
aft.fold_expr),
303303
fold_ty: |a,b,c|replace_ty(repls, a, b, c,
304-
aft.fold_ty)
305-
with *aft};
304+
aft.fold_ty),
305+
.. *aft};
306306
return ff(make_fold(f_pre), node);
307307
}
308308
fn fold_crate(f: ast_fold, &&n: @ast::crate) -> @ast::crate {

src/libsyntax/ext/simplext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ fn transcribe(cx: ext_ctxt, b: bindings, body: @expr) -> @expr {
196196
map_exprs: |x,y|
197197
transcribe_exprs(cx, b, idx_path, x, y)
198198
,
199-
new_id: |x|new_id(x, cx)
200-
with *afp};
199+
new_id: |x|new_id(x, cx),
200+
.. *afp};
201201
let f = make_fold(f_pre);
202202
let result = f.fold_expr(body);
203203
return result;
@@ -246,8 +246,8 @@ fn free_vars(b: bindings, e: @expr, it: fn(ident)) {
246246
// using fold is a hack: we want visit, but it doesn't hit idents ) :
247247
// solve this with macros
248248
let f_pre =
249-
@{fold_ident: |x,y|mark_ident(x, y, b, idents)
250-
with *default_ast_fold()};
249+
@{fold_ident: |x,y|mark_ident(x, y, b, idents),
250+
.. *default_ast_fold()};
251251
let f = make_fold(f_pre);
252252
f.fold_expr(e); // ignore result
253253
for idents.each_key |x| { it(x); };

0 commit comments

Comments
 (0)