about summary refs log tree commit diff
path: root/tests/ui/imports/use-declaration-no-path-segment-prefix.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/imports/use-declaration-no-path-segment-prefix.rs')
-rw-r--r--tests/ui/imports/use-declaration-no-path-segment-prefix.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/ui/imports/use-declaration-no-path-segment-prefix.rs b/tests/ui/imports/use-declaration-no-path-segment-prefix.rs
new file mode 100644
index 00000000000..f7fbc084ebf
--- /dev/null
+++ b/tests/ui/imports/use-declaration-no-path-segment-prefix.rs
@@ -0,0 +1,40 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/10806
+
+//@ edition: 2015
+//@ run-pass
+#![allow(unused_imports)]
+
+
+pub fn foo() -> isize {
+    3
+}
+pub fn bar() -> isize {
+    4
+}
+
+pub mod baz {
+    use {foo, bar};
+    pub fn quux() -> isize {
+        foo() + bar()
+    }
+}
+
+pub mod grault {
+    use {foo};
+    pub fn garply() -> isize {
+        foo()
+    }
+}
+
+pub mod waldo {
+    use {};
+    pub fn plugh() -> isize {
+        0
+    }
+}
+
+pub fn main() {
+    let _x = baz::quux();
+    let _y = grault::garply();
+    let _z = waldo::plugh();
+}