gcc/testsuite/rust/compile/self_import_namespace.rs
raw| 1 | // { dg-additional-options "-frust-name-resolution-2.0" } |
| 2 | |
| 3 | mod bar { |
| 4 | pub mod foo {} |
| 5 | pub fn foo() {} |
| 6 | } |
| 7 | |
| 8 | // This only imports the module `foo`. The function `foo` lives in |
| 9 | // the value namespace and is not imported. |
| 10 | use bar::foo::{self}; |
| 11 | |
| 12 | fn main() { |
| 13 | foo(); // { dg-error "expected value" } |
| 14 | } |