Skip to content

Commit 744bbd3

Browse files
committed
---
yaml --- r: 12903 b: refs/heads/master c: af418d9 h: refs/heads/master i: 12901: 6e6564c 12899: 2c6a033 12895: 17a89de v: v3
1 parent f0e4104 commit 744bbd3

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-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: 34b42eeb657dfe051ebaf0f95ba5a428441b04af
2+
refs/heads/master: af418d97c093e4ab401e67826e20fdf6140c9ddd
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//xfail-test
2+
3+
// Issue #2263.
4+
5+
// Should pass region checking.
6+
fn ok(f: fn@(x: &uint)) {
7+
// Here, g is a function that can accept a uint pointer with
8+
// lifetime r, and f is a function that can accept a uint pointer
9+
// with any lifetime. The assignment g = f should be OK (i.e., f
10+
// should be a subtype of g), because f can be used in any context
11+
// that expects g's type. But this currently fails.
12+
let mut g: fn@(y: &r.uint) = fn@(x: &r.uint) { };
13+
g = f;
14+
}
15+
16+
// This version is the same as above, except that here, g's type is
17+
// inferred.
18+
fn ok_inferred(f: fn@(x: &uint)) {
19+
let mut g = fn@(x: &r.uint) { };
20+
g = f;
21+
}
22+
23+
fn main() {
24+
}

0 commit comments

Comments
 (0)