From ecdb741df766e77789c7ad6ab632772a0992b3f9 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sat, 15 Nov 2014 17:26:51 -0500 Subject: [PATCH] Test resolving of names with `for` binders. --- src/test/compile-fail/regions-name-undeclared.rs | 3 +++ 1 file changed, 3 insertions(+) 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