@@ -883,7 +883,6 @@ mod collect {
883
883
884
884
885
885
// Type unification
886
-
887
886
mod unify {
888
887
fn unify ( fcx : & @fn_ctxt , expected : & ty:: t , actual : & ty:: t ) ->
889
888
ty:: unify:: result {
@@ -1009,12 +1008,12 @@ mod demand {
1009
1008
} else if ( adk == AUTODEREF_BLOCK_COERCE ) {
1010
1009
actual_1 = do_fn_block_coerce ( fcx, sp, actual, expected) ;
1011
1010
}
1011
+
1012
1012
let ty_param_substs: [ mutable ty:: t ] = ~[ mutable] ;
1013
1013
let ty_param_subst_var_ids: [ int ] = ~[ ] ;
1014
1014
for ty_param_subst: ty:: t in ty_param_substs_0 {
1015
1015
// Generate a type variable and unify it with the type parameter
1016
1016
// substitution. We will then pull out these type variables.
1017
-
1018
1017
let t_0 = next_ty_var ( fcx) ;
1019
1018
ty_param_substs += ~[ mutable t_0] ;
1020
1019
ty_param_subst_var_ids += ~[ ty:: ty_var_id ( fcx. ccx . tcx , t_0) ] ;
@@ -1370,12 +1369,11 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
1370
1369
let v_def_ids = ast:: variant_def_ids ( v_def) ;
1371
1370
let tag_tpt = ty:: lookup_item_type ( fcx. ccx . tcx , v_def_ids. tg ) ;
1372
1371
let path_tpot = instantiate_path ( fcx, path, tag_tpt, pat. span ) ;
1373
- // Take the tag type params out of `expected`.
1374
1372
1373
+ // Take the tag type params out of `expected`.
1375
1374
alt structure_of ( fcx, pat. span , expected) {
1376
1375
ty:: ty_tag ( _, expected_tps) {
1377
1376
// Unify with the expected tag type.
1378
-
1379
1377
let ctor_ty =
1380
1378
ty:: ty_param_substs_opt_and_ty_to_monotype ( fcx. ccx . tcx ,
1381
1379
path_tpot) ;
@@ -1385,8 +1383,8 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
1385
1383
NO_AUTODEREF ) ;
1386
1384
path_tpot =
1387
1385
{ substs: some[ [ ty:: t] ] ( path_tpt. substs ) , ty: path_tpt. ty } ;
1388
- // Get the number of arguments in this tag variant.
1389
1386
1387
+ // Get the number of arguments in this tag variant.
1390
1388
let arg_types =
1391
1389
variant_arg_types ( fcx. ccx , pat. span , v_def_ids. var ,
1392
1390
expected_tps) ;
@@ -1417,9 +1415,6 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
1417
1415
}
1418
1416
} else if ( subpats_len > 0 u) {
1419
1417
// TODO: note definition of tag variant
1420
- // TODO (issue #448): Wrap a #fmt string over multiple
1421
- // lines...
1422
-
1423
1418
fcx. ccx . tcx . sess . span_fatal
1424
1419
( pat. span , #fmt ( "this pattern has %u field%s, \
1425
1420
but the corresponding \
0 commit comments