diff --git a/src/test/compile-fail/regions-name-undeclared.rs b/src/test/compile-fail/regions-name-undeclared.rs index e9e585e84d0..ffd1501075e 100644 --- a/src/test/compile-fail/regions-name-undeclared.rs +++ b/src/test/compile-fail/regions-name-undeclared.rs @@ -44,6 +44,9 @@ fn bar<'a>(x: &'a int) { // &'a CAN be declared on functions and used then: fn g<'a>(a: &'a int) { } // OK fn h(a: for<'a>|&'a int|) { } // OK + + // But not in the bound of a closure, it's not in scope *there* + fn i(a: for<'a>|&int|:'a) { } //~ ERROR undeclared lifetime } // Test nesting of lifetimes in fn type declarations