Skip to content

Commit 36c1aeb

Browse files
committed
---
yaml --- r: 39307 b: refs/heads/incoming c: 3f78e0e h: refs/heads/master i: 39305: 9a161d5 39303: 45a9857 v: v3
1 parent 0a245c3 commit 36c1aeb

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
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: ac2b0456f4273474c2c2ef39a85ac2ee3be28682
9+
refs/heads/incoming: 3f78e0ecc03b9e0c7b46c64a4be69343c6a8888a
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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)