There's only one call-site for the function, so it seems fine to
inline
This commit is contained in:
Aleksey Kladov 2019-11-08 23:53:39 +03:00
parent dc5e5f610c
commit 785887b382
2 changed files with 5 additions and 7 deletions

View File

@ -195,12 +195,6 @@ pub struct Resolution {
pub import: Option<ImportId>,
}
impl Resolution {
fn from_macro(macro_: MacroDefId) -> Self {
Resolution { def: PerNs::macros(macro_), import: None }
}
}
#[derive(Debug, Clone)]
struct ResolvePathResult {
resolved_def: PerNs,

View File

@ -182,7 +182,11 @@ where
// In Rust, `#[macro_export]` macros are unconditionally visible at the
// crate root, even if the parent modules is **not** visible.
if export {
self.update(self.def_map.root, None, &[(name, Resolution::from_macro(macro_))]);
self.update(
self.def_map.root,
None,
&[(name, Resolution { def: PerNs::macros(macro_), import: None })],
);
}
}