-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyArea: Visibility / privacyT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Description
Paths usually respect use
aliases of modules, but paths in pub(in)
not.
mod m1 {
pub(in crate::m2) fn f() {}
//~^ERROR cannot find module `m2` in module `crate`
}
use m1 as m2;
This seems to be a matter of the order of evaluation, hence the following variant compiles:
mod m1 {
crate::id! {
pub(in crate::m2) fn f() {}
}
}
use m1 as m2;
#[macro_export]
macro_rules! id {
($($x:tt)*) => { $($x)* };
}
I expect these behaviors to match.
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyArea: Visibility / privacyT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team