Skip to content

Commit 2031420

Browse files
committed
---
yaml --- r: 13172 b: refs/heads/master c: 43eb5f0 h: refs/heads/master v: v3
1 parent 2975037 commit 2031420

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: 9a89a7503d4451efe9f74a77bfa2125c5bc31d06
2+
refs/heads/master: 43eb5f0a2e9fb52e154ac9a463061bb673431f19
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Issue #2263.
2+
3+
// Here, `f` is a function that takes a pointer `x` and a function
4+
// `g`, where `g` requires its argument `y` to be in the same region
5+
// that `x` is in.
6+
fn has_same_region(f: fn(x: &a.int, g: fn(y: &a.int))) {
7+
// Somewhat counterintuitively, this fails because, in
8+
// `wants_two_regions`, the `g` argument needs to be able to
9+
// accept any region. That is, the type that `has_same_region`
10+
// expects is *not* a subtype of the type that `wants_two_regions`
11+
// expects.
12+
wants_two_regions(f); //! ERROR mismatched types
13+
}
14+
15+
fn wants_two_regions(_f: fn(x: &int, g: fn(y: &int))) {
16+
}
17+
18+
fn main() {
19+
}
20+
21+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// xfail-test
2+
3+
// Issue #2263.
4+
5+
// Here, `f` is a function that takes a pointer `x` and a function
6+
// `g`, where `g` requires its argument `y` to be in the same region
7+
// that `x` is in.
8+
fn has_same_region(f: fn(x: &a.int, g: fn(y: &a.int))) {
9+
// `f` should be the type that `wants_same_region` wants, but
10+
// right now the compiler complains that it isn't.
11+
wants_same_region(f);
12+
}
13+
14+
fn wants_same_region(_f: fn(x: &b.int, g: fn(y: &b.int))) {
15+
}
16+
17+
fn main() {
18+
}
19+
20+

0 commit comments

Comments
 (0)