Skip to content

Commit accee4e

Browse files
committed
---
yaml --- r: 30036 b: refs/heads/incoming c: 5ccf817 h: refs/heads/master v: v3
1 parent 2541dae commit accee4e

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: feca839b9bd1ca8f8dac2533e6d87c62b1c1a02d
9+
refs/heads/incoming: 5ccf8175a8ae5f6aaff30bb2330a5f05ec89028d
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/rustc/middle/region.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,25 @@ fn determine_rp_in_ty(ty: @ast::ty,
655655
_ => {}
656656
}
657657

658+
// temporary hack: right now, fn() is short for &fn(), but @(fn())
659+
// is `@fn()`, so catch this and set anon_implies_rp to none in
660+
// that case
661+
match ty.node {
662+
ast::ty_box(mt) | ast::ty_uniq(mt) => {
663+
match mt.ty.node {
664+
ast::ty_fn(ast::proto_bare, _, _) |
665+
ast::ty_fn(ast::proto_block, _, _) => {
666+
do cx.with(cx.item_id, false) {
667+
visit_mt(mt, cx, visitor);
668+
}
669+
return;
670+
}
671+
_ => {}
672+
}
673+
}
674+
_ => {}
675+
}
676+
658677
match ty.node {
659678
ast::ty_box(mt) | ast::ty_uniq(mt) | ast::ty_vec(mt) |
660679
ast::ty_rptr(_, mt) | ast::ty_ptr(mt) => {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
struct param1 {
2+
g: &fn();
3+
}
4+
5+
struct param2 {
6+
g: fn();
7+
}
8+
9+
struct not_param1 {
10+
g: @fn();
11+
}
12+
13+
struct not_param2 {
14+
g: @fn();
15+
}
16+
17+
fn take1(p: param1) -> param1 { p } //~ ERROR mismatched types
18+
fn take2(p: param2) -> param2 { p } //~ ERROR mismatched types
19+
fn take3(p: not_param1) -> not_param1 { p }
20+
fn take4(p: not_param2) -> not_param2 { p }
21+
22+
fn main() {}

0 commit comments

Comments
 (0)