Support resolution of #[macro_use] extern crate

This commit is contained in:
uHOOCCOOHu
2019-08-30 01:56:00 +08:00
parent f2a200c1ee
commit f5bea9051b
4 changed files with 30 additions and 2 deletions

View File

@@ -934,6 +934,7 @@ impl AstNode for ExternCrateItem {
&self.syntax
}
}
impl ast::AttrsOwner for ExternCrateItem {}
impl ExternCrateItem {
pub fn name_ref(&self) -> Option<NameRef> {
AstChildren::new(&self.syntax).next()

View File

@@ -669,6 +669,7 @@ Grammar(
collections: [("use_trees", "UseTree")]
),
"ExternCrateItem": (
traits: ["AttrsOwner"],
options: ["NameRef", "Alias"],
),
"ArgList": (