diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-09 21:04:42 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-09 21:04:42 +0100 |
commit | b863272899a1bae63c7d9411d0ebff74652bae8e (patch) | |
tree | f5b95ae6af1ee37545eff70813c8940979e99daf /crates/ra_hir/src/expr/scope.rs | |
parent | cc284dad30de4990516eeccf60f24e613fd78a2a (diff) | |
parent | 88189c428242d2d65b749d0980eb447e72766e77 (diff) |
Merge #1126
1126: Swithc to native salsa interning r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/expr/scope.rs')
-rw-r--r-- | crates/ra_hir/src/expr/scope.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs index 48283907b..f1e6e0f02 100644 --- a/crates/ra_hir/src/expr/scope.rs +++ b/crates/ra_hir/src/expr/scope.rs | |||
@@ -294,9 +294,9 @@ pub struct ReferenceDescriptor { | |||
294 | 294 | ||
295 | #[cfg(test)] | 295 | #[cfg(test)] |
296 | mod tests { | 296 | mod tests { |
297 | use ra_db::salsa::InternKey; | ||
297 | use ra_syntax::{SourceFile, algo::find_node_at_offset}; | 298 | use ra_syntax::{SourceFile, algo::find_node_at_offset}; |
298 | use test_utils::{extract_offset, assert_eq_text}; | 299 | use test_utils::{extract_offset, assert_eq_text}; |
299 | use ra_arena::ArenaId; | ||
300 | use crate::Function; | 300 | use crate::Function; |
301 | 301 | ||
302 | use crate::expr::{ExprCollector}; | 302 | use crate::expr::{ExprCollector}; |
@@ -316,7 +316,8 @@ mod tests { | |||
316 | let file = SourceFile::parse(&code); | 316 | let file = SourceFile::parse(&code); |
317 | let marker: &ast::PathExpr = find_node_at_offset(file.syntax(), off).unwrap(); | 317 | let marker: &ast::PathExpr = find_node_at_offset(file.syntax(), off).unwrap(); |
318 | let fn_def: &ast::FnDef = find_node_at_offset(file.syntax(), off).unwrap(); | 318 | let fn_def: &ast::FnDef = find_node_at_offset(file.syntax(), off).unwrap(); |
319 | let irrelevant_function = Function { id: crate::ids::FunctionId::from_raw(0.into()) }; | 319 | let irrelevant_function = |
320 | Function { id: crate::ids::FunctionId::from_intern_id(0u32.into()) }; | ||
320 | let (body, source_map) = collect_fn_body_syntax(irrelevant_function, fn_def); | 321 | let (body, source_map) = collect_fn_body_syntax(irrelevant_function, fn_def); |
321 | let scopes = ExprScopes::new(Arc::new(body)); | 322 | let scopes = ExprScopes::new(Arc::new(body)); |
322 | let scopes = | 323 | let scopes = |
@@ -421,7 +422,8 @@ mod tests { | |||
421 | let fn_def: &ast::FnDef = find_node_at_offset(file.syntax(), off).unwrap(); | 422 | let fn_def: &ast::FnDef = find_node_at_offset(file.syntax(), off).unwrap(); |
422 | let name_ref: &ast::NameRef = find_node_at_offset(file.syntax(), off).unwrap(); | 423 | let name_ref: &ast::NameRef = find_node_at_offset(file.syntax(), off).unwrap(); |
423 | 424 | ||
424 | let irrelevant_function = Function { id: crate::ids::FunctionId::from_raw(0.into()) }; | 425 | let irrelevant_function = |
426 | Function { id: crate::ids::FunctionId::from_intern_id(0u32.into()) }; | ||
425 | let (body, source_map) = collect_fn_body_syntax(irrelevant_function, fn_def); | 427 | let (body, source_map) = collect_fn_body_syntax(irrelevant_function, fn_def); |
426 | let scopes = ExprScopes::new(Arc::new(body)); | 428 | let scopes = ExprScopes::new(Arc::new(body)); |
427 | let scopes = | 429 | let scopes = |