mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
made ExprCollector pub(crate) and moved
collect_fn_body_syntax
This commit is contained in:
parent
88e22e9d70
commit
b9d2c2c21f
2 changed files with 11 additions and 14 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue