mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
19 lines
418 B
Rust
19 lines
418 B
Rust
// Tests that namespaced crate names work inside macros.
|
|
|
|
//@ aux-crate: my_api::utils=open-ns-my_api_utils.rs
|
|
//@ compile-flags: -Z namespaced-crates
|
|
//@ edition: 2024
|
|
//@ check-pass
|
|
|
|
macro_rules! import_and_call {
|
|
($import_path:path, $fn_name:ident) => {{
|
|
use $import_path;
|
|
$fn_name();
|
|
}};
|
|
}
|
|
|
|
fn main() {
|
|
import_and_call!(my_api::utils::utils_helper, utils_helper);
|
|
let _x = 4 + 5;
|
|
}
|