Skip test/bench attr expansion in resolution instead of collection

This commit is contained in:
Lukas Wirth
2021-11-16 20:23:56 +01:00
parent 9f1e26c3f9
commit b57289c4cb
6 changed files with 47 additions and 37 deletions

View File

@@ -701,16 +701,6 @@ impl<N: AstNode> InFile<N> {
}
}
impl InFile<ast::Fn> {
pub fn map_out_of_test_attr(self, db: &dyn db::AstDatabase) -> InFile<ast::Fn> {
(|| {
let InFile { file_id, value } = self.file_id.call_node(db)?;
ast::Fn::cast(value).map(|n| InFile::new(file_id, n))
})()
.unwrap_or(self)
}
}
/// In Rust, macros expand token trees to token trees. When we want to turn a
/// token tree into an AST node, we need to figure out what kind of AST node we
/// want: something like `foo` can be a type, an expression, or a pattern.