2020-10-14 21:12:03 +02:00
|
|
|
// aux-build:macro_pub_in_module.rs
|
|
|
|
|
// edition:2018
|
|
|
|
|
// build-aux-docs
|
|
|
|
|
// @has external_crate/some_module/macro.external_macro.html
|
|
|
|
|
|
2020-10-12 19:50:12 +02:00
|
|
|
//! See issue #74355
|
2020-10-13 20:25:19 +02:00
|
|
|
#![feature(decl_macro, no_core, rustc_attrs)]
|
2020-10-12 19:50:12 +02:00
|
|
|
#![crate_name = "krate"]
|
2020-10-13 20:25:19 +02:00
|
|
|
#![no_core]
|
2020-10-12 19:50:12 +02:00
|
|
|
|
2020-10-14 21:12:03 +02:00
|
|
|
extern crate external_crate;
|
|
|
|
|
|
2020-10-13 20:25:19 +02:00
|
|
|
pub mod inner {
|
2020-10-14 21:12:03 +02:00
|
|
|
// @has krate/inner/macro.raw_const.html
|
|
|
|
|
pub macro raw_const() {}
|
2020-10-13 20:25:19 +02:00
|
|
|
|
|
|
|
|
// @has krate/inner/macro.test.html
|
|
|
|
|
#[rustc_builtin_macro]
|
|
|
|
|
pub macro test($item:item) {}
|
|
|
|
|
|
|
|
|
|
// @has krate/inner/macro.Clone.html
|
|
|
|
|
#[rustc_builtin_macro]
|
|
|
|
|
pub macro Clone($item:item) {}
|
2020-10-14 21:12:03 +02:00
|
|
|
|
|
|
|
|
// Make sure the logic is not affected by a re-export.
|
|
|
|
|
mod private {
|
|
|
|
|
pub macro m() {}
|
|
|
|
|
}
|
|
|
|
|
// @has krate/inner/macro.renamed.html
|
|
|
|
|
pub use private::m as renamed;
|
|
|
|
|
|
|
|
|
|
// @has krate/inner/macro.external_macro.html
|
|
|
|
|
pub use ::external_crate::some_module::external_macro;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Namespaces: Make sure the logic does not mix up a function name with a module name…
|
|
|
|
|
fn both_fn_and_mod() {
|
|
|
|
|
pub macro m() {}
|
|
|
|
|
}
|
|
|
|
|
pub mod both_fn_and_mod {
|
|
|
|
|
// @!has krate/both_fn_and_mod/macro.m.html
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const __: () = {
|
|
|
|
|
pub macro m() {}
|
|
|
|
|
};
|
|
|
|
|
pub mod __ {
|
|
|
|
|
// @!has krate/__/macro.m.html
|
2020-10-12 19:50:12 +02:00
|
|
|
}
|