about summary refs log tree commit diff
path: root/tests/ui/static/auxiliary/nested_item.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/static/auxiliary/nested_item.rs')
-rw-r--r--tests/ui/static/auxiliary/nested_item.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/static/auxiliary/nested_item.rs b/tests/ui/static/auxiliary/nested_item.rs
new file mode 100644
index 00000000000..9db9d19d6f6
--- /dev/null
+++ b/tests/ui/static/auxiliary/nested_item.rs
@@ -0,0 +1,30 @@
+// original problem
+pub fn foo<T>() -> isize {
+    {
+        static foo: isize = 2;
+        foo
+    }
+}
+
+// issue 8134
+struct Foo;
+impl Foo {
+    pub fn foo<T>(&self) {
+        static X: usize = 1;
+    }
+}
+
+// issue 8134
+pub struct Parser<T>(T);
+impl<T: std::iter::Iterator<Item=char>> Parser<T> {
+    fn in_doctype(&mut self) {
+        static DOCTYPEPattern: [char; 6] = ['O', 'C', 'T', 'Y', 'P', 'E'];
+    }
+}
+
+struct Bar;
+impl Foo {
+    pub fn bar<T>(&self) {
+        static X: usize = 1;
+    }
+}