Skip to content

Commit 3c622a5

Browse files
committed
Clarifying comments in test.
1 parent 43eb5f0 commit 3c622a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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)