Skip to content

Commit ecdb741

Browse files
committed
Test resolving of names with for binders.
1 parent a298014 commit ecdb741

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/compile-fail/regions-name-undeclared.rs

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ fn bar<'a>(x: &'a int) {
4444
// &'a CAN be declared on functions and used then:
4545
fn g<'a>(a: &'a int) { } // OK
4646
fn h(a: for<'a>|&'a int|) { } // OK
47+
48+
// But not in the bound of a closure, it's not in scope *there*
49+
fn i(a: for<'a>|&int|:'a) { } //~ ERROR undeclared lifetime
4750
}
4851

4952
// Test nesting of lifetimes in fn type declarations

0 commit comments

Comments
 (0)