diff options
Diffstat (limited to 'tests/ui/resolve/issue-23716.rs')
-rw-r--r-- | tests/ui/resolve/issue-23716.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/resolve/issue-23716.rs b/tests/ui/resolve/issue-23716.rs new file mode 100644 index 000000000..e9139c0aa --- /dev/null +++ b/tests/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() { +} |