Skip to content

Commit 4d12e9e

Browse files
committed
---
yaml --- r: 4532 b: refs/heads/master c: 7d5092e h: refs/heads/master v: v3
1 parent 04cf4f9 commit 4d12e9e

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5b084e4e366cacaf63036667dc4c378ce653324b
2+
refs/heads/master: 7d5092ee7b549edeb8a2fc6af4c81c8efa29b85c

trunk/src/comp/middle/typeck.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1226,14 +1226,14 @@ fn gather_locals(ccx: &@crate_ctxt, f: &ast::_fn, id: &ast::node_id,
12261226
};
12271227
let tcx = ccx.tcx;
12281228

1229-
let next_var_id = lambda(nvi: @mutable int) -> int {
1229+
let next_var_id = lambda() -> int {
12301230
let rv = *nvi;
12311231
*nvi += 1;
12321232
ret rv;
12331233
};
12341234
let assign = lambda(nid: ast::node_id, ident: &ast::ident,
12351235
ty_opt: option::t[ty::t]) {
1236-
let var_id = next_var_id(nvi);
1236+
let var_id = next_var_id();
12371237
locals.insert(nid, var_id);
12381238
local_names.insert(nid, ident);
12391239
alt ty_opt {
@@ -2027,7 +2027,7 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
20272027
ast::expr_alt(expr, arms) {
20282028
bot = check_expr(fcx, expr);
20292029
// Typecheck the patterns first, so that we get types for all the
2030-
// bindings.
2030+
// bindings.
20312031

20322032
let pattern_ty = ty::expr_ty(tcx, expr);
20332033
for arm: ast::arm in arms {

trunk/src/comp/syntax/ast.rs

+1-30
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,13 @@ tag def {
4242
def_arg(def_id);
4343
def_local(def_id);
4444
def_variant(def_id, /* tag */def_id);
45-
46-
4745
/* variant */
4846
def_ty(def_id);
4947
def_ty_arg(uint, kind);
5048
def_binding(def_id);
5149
def_use(def_id);
5250
def_native_ty(def_id);
5351
def_native_fn(def_id);
54-
55-
5652
/* A "fake" def for upvars. This never appears in the def_map, but
5753
* freevars::def_lookup will return it for a def that is an upvar.
5854
* It contains the actual def. */
@@ -256,8 +252,6 @@ type stmt = spanned[stmt_];
256252
tag stmt_ {
257253
stmt_decl(@decl, node_id);
258254
stmt_expr(@expr, node_id);
259-
260-
261255
// These only exist in crate-level blocks.
262256
stmt_crate_directive(@crate_directive);
263257
}
@@ -314,7 +308,6 @@ tag expr_ {
314308
expr_alt(@expr, [arm]);
315309
expr_fn(_fn);
316310
expr_block(blk);
317-
318311
/*
319312
* FIXME: many of these @exprs should be constrained with
320313
* is_lval once we have constrained types working.
@@ -335,15 +328,10 @@ tag expr_ {
335328
expr_put(option::t[@expr]);
336329
expr_be(@expr);
337330
expr_log(int, @expr);
338-
339-
340331
/* just an assert, no significance to typestate */
341332
expr_assert(@expr);
342-
343-
344333
/* preds that typestate is aware of */
345334
expr_check(check_mode, @expr);
346-
347335
/* FIXME Would be nice if expr_check desugared
348336
to expr_if_check. */
349337
expr_if_check(@expr, blk, option::t[@expr]);
@@ -438,29 +426,20 @@ tag ty_ {
438426
ty_bot; /* return type of ! functions and type of
439427
ret/fail/break/cont. there is no syntax
440428
for this type. */
441-
442-
443-
444429
/* bot represents the value of functions that don't return a value
445430
locally to their context. in contrast, things like log that do
446431
return, but don't return a meaningful value, have result type nil. */
447-
ty_bool;
432+
ty_bool;
448433
ty_int;
449434
ty_uint;
450435
ty_float;
451436
ty_machine(ty_mach);
452437
ty_char;
453438
ty_str;
454439
ty_istr; // interior string
455-
456-
457-
458440
ty_box(mt);
459441
ty_vec(mt);
460442
ty_ivec(mt); // interior vector
461-
462-
463-
464443
ty_ptr(mt);
465444
ty_task;
466445
ty_port(@ty);
@@ -523,21 +502,13 @@ type fn_decl =
523502

524503
tag purity {
525504
pure_fn; // declared with "pred"
526-
527-
528-
529505
impure_fn; // declared with "fn"
530-
531506
}
532507

533508
tag controlflow {
534509
noreturn; // functions with return type _|_ that always
535510
// raise an error or exit (i.e. never return to the caller)
536-
537-
538-
539511
return; // everything else
540-
541512
}
542513

543514
type _fn = {decl: fn_decl, proto: proto, body: blk};

0 commit comments

Comments
 (0)