@@ -250,14 +250,14 @@ fn type_is_scalar(&@fn_ctxt fcx, &span sp, ty::t typ) -> bool {
250
250
// corresponding to a definition ID:
251
251
fn ast_ty_to_ty ( & ty:: ctxt tcx, & ty_getter getter, & @ast:: ty ast_ty ) -> ty:: t {
252
252
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) ) {
255
255
tcx. sess . span_fatal ( ast_ty. span ,
256
256
"illegal recursive type \
257
257
insert a tag in the cycle, \
258
258
if this is desired)") ;
259
259
}
260
- case ( none[ option :: t [ ty :: t ] ] ) { }
260
+ case ( none) { }
261
261
} /* go on */
262
262
263
263
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,
1201
1201
1202
1202
// Add object fields, if any.
1203
1203
alt ( get_obj_info( ccx) ) {
1204
- case ( option :: some( ?oinfo) ) {
1204
+ case ( some( ?oinfo) ) {
1205
1205
alt ( oinfo) {
1206
1206
case ( regular_obj( ?obj_fields, _) ) {
1207
1207
for ( ast:: obj_field f in obj_fields) {
@@ -1219,7 +1219,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
1219
1219
}
1220
1220
}
1221
1221
}
1222
- case ( option :: none) { /* no fields * / }
1222
+ case ( none) { /* no fields * / }
1223
1223
}
1224
1224
// Add formal parameters.
1225
1225
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,
1240
1240
case ( none) {
1241
1241
// Auto slot.
1242
1242
assign( ccx. tcx, vb, locals, local_names, nvi, local. node. id,
1243
- local. node. ident, none[ ty :: t ] ) ;
1243
+ local. node. ident, none) ;
1244
1244
}
1245
1245
case ( some( ?ast_ty) ) {
1246
1246
// Explicitly typed slot.
@@ -1261,7 +1261,7 @@ fn gather_locals(&@crate_ctxt ccx, &ast::_fn f,
1261
1261
alt ( p. node) {
1262
1262
case ( ast:: pat_bind( ?ident) ) {
1263
1263
assign( ccx. tcx, vb, locals, local_names, nvi,
1264
- p. id, ident, none[ ty :: t ] ) ;
1264
+ p. id, ident, none) ;
1265
1265
}
1266
1266
case ( _) { /* no-op * / }
1267
1267
}
@@ -1296,14 +1296,14 @@ fn replace_expr_type(&@fn_ctxt fcx, &@ast::expr expr,
1296
1296
auto new_tps;
1297
1297
if ( ty:: expr_has_ty_params( fcx. ccx. tcx, expr) ) {
1298
1298
new_tps = some[ ty:: t[ ] ] ( new_tyt. _0) ;
1299
- } else { new_tps = none[ ty :: t [ ] ] ; }
1299
+ } else { new_tps = none; }
1300
1300
write:: ty_fixup( fcx, expr. id, tup( new_tps, new_tyt. _1) ) ;
1301
1301
}
1302
1302
1303
1303
// FIXME remove once std::ivec::find makes it into a snapshot
1304
1304
fn ivec_find[ T ] ( fn ( & T ) -> bool f, & T [ ] v) -> option:: t[ T ] {
1305
1305
for ( T elt in v) { if ( f( elt) ) { ret some[ T ] ( elt) ; } }
1306
- ret none[ T ] ;
1306
+ ret none;
1307
1307
}
1308
1308
1309
1309
// AST fragment checking
@@ -1692,16 +1692,16 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
1692
1692
check_block( fcx, thn) ;
1693
1693
auto if_t =
1694
1694
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) }
1705
1705
} ;
1706
1706
write:: ty_only_fixup( fcx, id, if_t) ;
1707
1707
}
0 commit comments