summaryrefslogtreecommitdiffstats
path: root/src/test/ui/resolve/issue-23716.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/resolve/issue-23716.rs')
-rw-r--r--src/test/ui/resolve/issue-23716.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/resolve/issue-23716.rs b/src/test/ui/resolve/issue-23716.rs
new file mode 100644
index 000000000..e9139c0aa
--- /dev/null
+++ b/src/test/ui/resolve/issue-23716.rs
@@ -0,0 +1,17 @@
+static foo: i32 = 0;
+
+fn bar(foo: i32) {}
+//~^ ERROR function parameters cannot shadow statics
+//~| cannot be named the same as a static
+
+mod submod {
+ pub static answer: i32 = 42;
+}
+
+use self::submod::answer;
+
+fn question(answer: i32) {}
+//~^ ERROR function parameters cannot shadow statics
+//~| cannot be named the same as a static
+fn main() {
+}