Skip to content

Commit db542be

Browse files
committed
---
yaml --- r: 36642 b: refs/heads/try2 c: 3f78e0e h: refs/heads/master v: v3
1 parent da84d45 commit db542be

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ac2b0456f4273474c2c2ef39a85ac2ee3be28682
8+
refs/heads/try2: 3f78e0ecc03b9e0c7b46c64a4be69343c6a8888a
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4454,11 +4454,17 @@ impl Resolver {
44544454
let class_def = def_class(class_id);
44554455
self.record_def(pattern.id, class_def);
44564456
}
4457+
Some(definition @ def_class(class_id))
4458+
if self.structs.contains_key(class_id) => {
4459+
self.record_def(pattern.id, definition);
4460+
}
44574461
Some(definition @ def_variant(_, variant_id))
44584462
if self.structs.contains_key(variant_id) => {
44594463
self.record_def(pattern.id, definition);
44604464
}
4461-
_ => {
4465+
result => {
4466+
debug!("(resolving pattern) didn't find struct \
4467+
def: %?", result);
44624468
self.session.span_err(
44634469
path.span,
44644470
fmt!("`%s` does not name a structure",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#[crate_type="lib"];
2+
3+
pub struct S {
4+
x: int,
5+
y: int
6+
}
7+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// xfail-fast
2+
extern mod struct_destructuring_cross_crate;
3+
4+
fn main() {
5+
let x = struct_destructuring_cross_crate::S { x: 1, y: 2 };
6+
let struct_destructuring_cross_crate::S { x: a, y: b } = x;
7+
assert a == 1;
8+
assert b == 2;
9+
}

0 commit comments

Comments
 (0)