Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
catamorphism committed May 3, 2013
1 parent 13df2ea commit 32b3d3e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/librustc/middle/typeck/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ pub fn check_pat_variant(pcx: &pat_ctxt, pat: @ast::pat, path: @ast::Path,
let enum_tpt = ty::lookup_item_type(tcx, enm);
instantiate_path(pcx.fcx, path, enum_tpt, pat.span, pat.id,
pcx.block_region);

// check that the type of the value being matched is a subtype
// of the type of the pattern:
let pat_ty = fcx.node_ty(pat.id);
demand::subtype(fcx, pat.span, expected, pat_ty);

// Get the expected types of the arguments.
arg_types = {
let vinfo =
Expand All @@ -143,18 +143,18 @@ pub fn check_pat_variant(pcx: &pat_ctxt, pat: @ast::pat, path: @ast::Path,
}
})
};

kind_name = "variant";
}
None => {
let resolved_expected =
fcx.infcx().ty_to_str(fcx.infcx().resolve_type_vars_if_possible(expected));
fcx.infcx().type_error_message_str(pat.span,
|actual| {
fmt!("mismatched types: expected `%s` but found %s",
resolved_expected, actual)},
~"a structure pattern",
None);
fmt!("mismatched types: expected `%s` but found %s",
resolved_expected, actual)},
~"a structure pattern",
None);
fcx.write_error(pat.id);
kind_name = "[error]";
arg_types = (copy subpats).get_or_default(~[]).map(|_|
Expand Down

5 comments on commit 32b3d3e

@bors
Copy link
Contributor

@bors bors commented on 32b3d3e May 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from catamorphism
at catamorphism@32b3d3e

@bors
Copy link
Contributor

@bors bors commented on 32b3d3e May 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging catamorphism/rust/issue-5358 = 32b3d3e into auto

@bors
Copy link
Contributor

@bors bors commented on 32b3d3e May 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catamorphism/rust/issue-5358 = 32b3d3e merged ok, testing candidate = 517bfc9

@bors
Copy link
Contributor

@bors bors commented on 32b3d3e May 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 32b3d3e May 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 517bfc9

Please sign in to comment.