made ExprCollector pub(crate) and moved

collect_fn_body_syntax
This commit is contained in:
Lenard Pratt 2019-04-02 19:21:08 +01:00
parent 88e22e9d70
commit b9d2c2c21f
2 changed files with 11 additions and 14 deletions

View file

@ -462,7 +462,7 @@ impl Pat {
// Queries
struct ExprCollector {
pub(crate) struct ExprCollector {
owner: DefWithBody,
exprs: Arena<ExprId, Expr>,
pats: Arena<PatId, Pat>,
@ -943,12 +943,3 @@ pub(crate) fn body_with_source_map_query(
pub(crate) fn body_hir_query(db: &impl HirDatabase, def: DefWithBody) -> Arc<Body> {
db.body_with_source_map(def).0
}
#[cfg(test)]
use crate::{Function};
#[cfg(test)]
fn collect_fn_body_syntax(function: Function, node: &ast::FnDef) -> (Body, BodySourceMap) {
let mut collector = ExprCollector::new(DefWithBody::Function(function));
collector.collect_fn_body(node);
collector.finish()
}