Skip to content

Commit fedecae

Browse files
committed
---
yaml --- r: 4006 b: refs/heads/master c: 19a17b3 h: refs/heads/master v: v3
1 parent 1cca5d4 commit fedecae

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 00e017f60ee032c7d7c733c622fc62c2596e2bef
2+
refs/heads/master: 19a17b3d1d0d25155c8bd11c73bf88238f9bd180

trunk/src/comp/middle/typeck.rs

+19-19
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ fn type_is_scalar(&@fn_ctxt fcx, &span sp, ty::t typ) -> bool {
250250
// corresponding to a definition ID:
251251
fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
252252
alt (tcx.ast_ty_to_ty_cache.find(ast_ty)) {
253-
case (some[option::t[ty::t]](some[ty::t](?ty))) { ret ty; }
254-
case (some[option::t[ty::t]](none)) {
253+
case (some(some(?ty))) { ret ty; }
254+
case (some(none)) {
255255
tcx.sess.span_fatal(ast_ty.span,
256256
"illegal recursive type \
257257
insert a tag in the cycle, \
258258
if this is desired)");
259259
}
260-
case (none[option::t[ty::t]]) { }
260+
case (none) { }
261261
} /* go on */
262262

263263
tcx.ast_ty_to_ty_cache.insert(ast_ty, none[ty::t]);
@@ -1201,7 +1201,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
12011201

12021202
// Add object fields, if any.
12031203
alt (get_obj_info(ccx)) {
1204-
case (option::some(?oinfo)) {
1204+
case (some(?oinfo)) {
12051205
alt (oinfo) {
12061206
case (regular_obj(?obj_fields, _)) {
12071207
for (ast::obj_field f in obj_fields) {
@@ -1219,7 +1219,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
12191219
}
12201220
}
12211221
}
1222-
case (option::none) {/* no fields */ }
1222+
case (none) {/* no fields */ }
12231223
}
12241224
// Add formal parameters.
12251225
auto args = ty::ty_fn_args(ccx.tcx, ty::node_id_to_type(ccx.tcx, id));
@@ -1240,7 +1240,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
12401240
case (none) {
12411241
// Auto slot.
12421242
assign(ccx.tcx, vb, locals, local_names, nvi, local.node.id,
1243-
local.node.ident, none[ty::t]);
1243+
local.node.ident, none);
12441244
}
12451245
case (some(?ast_ty)) {
12461246
// Explicitly typed slot.
@@ -1261,7 +1261,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
12611261
alt (p.node) {
12621262
case (ast::pat_bind(?ident)) {
12631263
assign(ccx.tcx, vb, locals, local_names, nvi,
1264-
p.id, ident, none[ty::t]);
1264+
p.id, ident, none);
12651265
}
12661266
case (_) {/* no-op */ }
12671267
}
@@ -1296,14 +1296,14 @@ fn replace_expr_type(&@fn_ctxt fcx, &@ast::expr expr,
12961296
auto new_tps;
12971297
if (ty::expr_has_ty_params(fcx.ccx.tcx, expr)) {
12981298
new_tps = some[ty::t[]](new_tyt._0);
1299-
} else { new_tps = none[ty::t[]]; }
1299+
} else { new_tps = none; }
13001300
write::ty_fixup(fcx, expr.id, tup(new_tps, new_tyt._1));
13011301
}
13021302

13031303
// FIXME remove once std::ivec::find makes it into a snapshot
13041304
fn ivec_find[T](fn(&T) -> bool f, &T[] v) -> option::t[T] {
13051305
for (T elt in v) { if (f(elt)) { ret some[T](elt); } }
1306-
ret none[T];
1306+
ret none;
13071307
}
13081308

13091309
// AST fragment checking
@@ -1692,16 +1692,16 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
16921692
check_block(fcx, thn);
16931693
auto if_t =
16941694
alt (elsopt) {
1695-
case (some(?els)) {
1696-
check_expr(fcx, els);
1697-
auto thn_t = block_ty(fcx.ccx.tcx, thn);
1698-
auto elsopt_t = expr_ty(fcx.ccx.tcx, els);
1699-
demand::simple(fcx, sp, thn_t, elsopt_t);
1700-
if (!ty::type_is_bot(fcx.ccx.tcx, elsopt_t)) {
1701-
elsopt_t
1702-
} else { thn_t }
1703-
}
1704-
case (none) { ty::mk_nil(fcx.ccx.tcx) }
1695+
case (some(?els)) {
1696+
check_expr(fcx, els);
1697+
auto thn_t = block_ty(fcx.ccx.tcx, thn);
1698+
auto elsopt_t = expr_ty(fcx.ccx.tcx, els);
1699+
demand::simple(fcx, sp, thn_t, elsopt_t);
1700+
if (!ty::type_is_bot(fcx.ccx.tcx, elsopt_t)) {
1701+
elsopt_t
1702+
} else { thn_t }
1703+
}
1704+
case (none) { ty::mk_nil(fcx.ccx.tcx) }
17051705
};
17061706
write::ty_only_fixup(fcx, id, if_t);
17071707
}

0 commit comments

Comments
 (0)