Skip to content

Commit

Permalink
Forbid pattern-matching structs until the next snapshot (#3215)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblum committed Aug 17, 2012
1 parent 09cf5c1 commit 89c2a9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rustc/middle/typeck/check/alt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
for fields.each |field| {
match field_map.find(field.ident) {
some(index) => {
tcx.sess.span_err(pat.span, ~"Pattern-matching structs \
is not allowed (#3215) until the next snapshot.");
let class_field = class_fields[index];
let field_type = ty::lookup_field_type(tcx,
class_id,
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/struct-pattern-matching.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// xfail-test
struct Foo {
x: int;
y: int;
Expand Down

0 comments on commit 89c2a9f

Please sign in to comment.