Skip to content

Commit 264a3e9

Browse files
committed
---
yaml --- r: 13173 b: refs/heads/master c: 3c622a5 h: refs/heads/master i: 13171: 2975037 v: v3
1 parent 2031420 commit 264a3e9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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: 43eb5f0a2e9fb52e154ac9a463061bb673431f19
2+
refs/heads/master: 3c622a5b1278484f02d49cb37cfb7005239f30a4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/test/compile-fail/regions-fn-subtyping.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Issue #2263.
2-
31
// Here, `f` is a function that takes a pointer `x` and a function
42
// `g`, where `g` requires its argument `y` to be in the same region
53
// that `x` is in.
@@ -13,6 +11,11 @@ fn has_same_region(f: fn(x: &a.int, g: fn(y: &a.int))) {
1311
}
1412

1513
fn wants_two_regions(_f: fn(x: &int, g: fn(y: &int))) {
14+
// Suppose we were to write code here that passed some arbitrary
15+
// &int and some arbitrary fn(&int) to whatever's passed in as _f.
16+
// This would be fine as far as the type annotation on the formal
17+
// parameter _f goes, but if _f were `f` we'd be in trouble since
18+
// `f` can't handle those arguments.
1619
}
1720

1821
fn main() {

0 commit comments

Comments
 (0)