Skip to content

Commit 54972b6

Browse files
committed
---
yaml --- r: 23436 b: refs/heads/master c: 5ccf817 h: refs/heads/master v: v3
1 parent 63655ab commit 54972b6

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: feca839b9bd1ca8f8dac2533e6d87c62b1c1a02d
2+
refs/heads/master: 5ccf8175a8ae5f6aaff30bb2330a5f05ec89028d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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)