about summary refs log tree commit diff
path: root/tests/ui/nested-ty-params.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nested-ty-params.rs')
-rw-r--r--tests/ui/nested-ty-params.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/nested-ty-params.rs b/tests/ui/nested-ty-params.rs
new file mode 100644
index 00000000000..85413acdb14
--- /dev/null
+++ b/tests/ui/nested-ty-params.rs
@@ -0,0 +1,8 @@
+// error-pattern:can't use generic parameters from outer function
+fn hd<U>(v: Vec<U> ) -> U {
+    fn hd1(w: [U]) -> U { return w[0]; }
+
+    return hd1(v);
+}
+
+fn main() {}