Skip to content

Commit 89c2a9f

Browse files
committed
Forbid pattern-matching structs until the next snapshot (#3215)
1 parent 09cf5c1 commit 89c2a9f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/rustc/middle/typeck/check/alt.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
283283
for fields.each |field| {
284284
match field_map.find(field.ident) {
285285
some(index) => {
286+
tcx.sess.span_err(pat.span, ~"Pattern-matching structs \
287+
is not allowed (#3215) until the next snapshot.");
286288
let class_field = class_fields[index];
287289
let field_type = ty::lookup_field_type(tcx,
288290
class_id,

src/test/run-pass/struct-pattern-matching.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// xfail-test
12
struct Foo {
23
x: int;
34
y: int;

0 commit comments

Comments
 (0)