diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-07-18 22:06:07 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-07-25 20:38:54 +0500 |
| commit | e9959aa74e23eb340d6c9e9a4eab807be03b028f (patch) | |
| tree | 493df6b8c16382a44c1a8a51d5a1f5f7e416e5a7 /tests/ui/imports/use-declaration-no-path-segment-prefix.rs | |
| parent | 9f38ca97eab53ba2f431a48bec2343ef52335714 (diff) | |
| download | rust-e9959aa74e23eb340d6c9e9a4eab807be03b028f.tar.gz rust-e9959aa74e23eb340d6c9e9a4eab807be03b028f.zip | |
comments
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.rs | 40 |
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(); +} |
