aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r--crates/ra_hir/src/expr/scope.rs13
-rw-r--r--crates/ra_hir/src/expr/validation.rs11
2 files changed, 11 insertions, 13 deletions
diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs
index 83d226fc1..f27cc6e8d 100644
--- a/crates/ra_hir/src/expr/scope.rs
+++ b/crates/ra_hir/src/expr/scope.rs
@@ -1,12 +1,11 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_arena::{impl_arena_id, Arena, RawId};
3use rustc_hash::FxHashMap; 4use rustc_hash::FxHashMap;
4use ra_arena::{Arena, RawId, impl_arena_id};
5 5
6use crate::{ 6use crate::{
7 Name, DefWithBody, 7 expr::{Body, Expr, ExprId, Pat, PatId, Statement},
8 expr::{PatId, ExprId, Pat, Expr, Body, Statement}, 8 DefWithBody, HirDatabase, Name,
9 HirDatabase,
10}; 9};
11 10
12#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] 11#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -173,10 +172,10 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope
173#[cfg(test)] 172#[cfg(test)]
174mod tests { 173mod tests {
175 use ra_db::SourceDatabase; 174 use ra_db::SourceDatabase;
176 use ra_syntax::{algo::find_node_at_offset, AstNode, SyntaxNodePtr, ast}; 175 use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNodePtr};
177 use test_utils::{extract_offset, assert_eq_text}; 176 use test_utils::{assert_eq_text, extract_offset};
178 177
179 use crate::{source_binder::SourceAnalyzer, mock::MockDatabase}; 178 use crate::{mock::MockDatabase, source_binder::SourceAnalyzer};
180 179
181 fn do_check(code: &str, expected: &[&str]) { 180 fn do_check(code: &str, expected: &[&str]) {
182 let (off, code) = extract_offset(code); 181 let (off, code) = extract_offset(code);
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs
index 534fd482b..8206dae2e 100644
--- a/crates/ra_hir/src/expr/validation.rs
+++ b/crates/ra_hir/src/expr/validation.rs
@@ -1,17 +1,16 @@
1use std::sync::Arc;
2use rustc_hash::FxHashSet; 1use rustc_hash::FxHashSet;
2use std::sync::Arc;
3 3
4use ra_syntax::ast::{AstNode, StructLit}; 4use ra_syntax::ast::{AstNode, StructLit};
5 5
6use super::{Expr, ExprId, StructLitField};
6use crate::{ 7use crate::{
7 expr::AstPtr,
8 HirDatabase, Function, Name, HasSource,
9 diagnostics::{DiagnosticSink, MissingFields},
10 adt::AdtDef, 8 adt::AdtDef,
11 Path, 9 diagnostics::{DiagnosticSink, MissingFields},
10 expr::AstPtr,
12 ty::InferenceResult, 11 ty::InferenceResult,
12 Function, HasSource, HirDatabase, Name, Path,
13}; 13};
14use super::{Expr, StructLitField, ExprId};
15 14
16pub(crate) struct ExprValidator<'a, 'b: 'a> { 15pub(crate) struct ExprValidator<'a, 'b: 'a> {
17 func: Function, 16 func: Function,