about summary refs log tree commit diff
path: root/src/test/ui/static
diff options
context:
space:
mode:
authorCaio <c410.f3r@gmail.com>2021-11-06 15:35:20 -0300
committerCaio <c410.f3r@gmail.com>2021-11-06 15:35:20 -0300
commit7fd15f09008dd72f40d76a5bebb60e3991095a5f (patch)
tree45b540395fe976fa12c67d74f4f965023b84ad3f /src/test/ui/static
parentd32993afe81a49701edd6f2b8f018020ca50da1a (diff)
downloadrust-7fd15f09008dd72f40d76a5bebb60e3991095a5f.tar.gz
rust-7fd15f09008dd72f40d76a5bebb60e3991095a5f.zip
Move some tests to more reasonable directories
Diffstat (limited to 'src/test/ui/static')
-rw-r--r--src/test/ui/static/auxiliary/nested_item.rs30
-rw-r--r--src/test/ui/static/nested_item_main.rs10
2 files changed, 40 insertions, 0 deletions
diff --git a/src/test/ui/static/auxiliary/nested_item.rs b/src/test/ui/static/auxiliary/nested_item.rs
new file mode 100644
index 00000000000..9db9d19d6f6
--- /dev/null
+++ b/src/test/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;
+    }
+}
diff --git a/src/test/ui/static/nested_item_main.rs b/src/test/ui/static/nested_item_main.rs
new file mode 100644
index 00000000000..2fe00aede00
--- /dev/null
+++ b/src/test/ui/static/nested_item_main.rs
@@ -0,0 +1,10 @@
+// run-pass
+// aux-build:nested_item.rs
+
+
+extern crate nested_item;
+
+pub fn main() {
+    assert_eq!(2, nested_item::foo::<()>());
+    assert_eq!(2, nested_item::foo::<isize>());
+}