From 6b993a97602da5ddee4033d4d76a68471f8d1ee1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Apr 2019 22:51:22 +0300 Subject: migrate to salsas interning --- crates/ra_hir/src/expr/scope.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src/expr') 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 { #[cfg(test)] mod tests { + use ra_db::salsa::InternKey; use ra_syntax::{SourceFile, algo::find_node_at_offset}; use test_utils::{extract_offset, assert_eq_text}; - use ra_arena::ArenaId; use crate::Function; use crate::expr::{ExprCollector}; @@ -316,7 +316,8 @@ mod tests { let file = SourceFile::parse(&code); let marker: &ast::PathExpr = find_node_at_offset(file.syntax(), off).unwrap(); let fn_def: &ast::FnDef = find_node_at_offset(file.syntax(), off).unwrap(); - let irrelevant_function = Function { id: crate::ids::FunctionId::from_raw(0.into()) }; + let irrelevant_function = + Function { id: crate::ids::FunctionId::from_intern_id(0u32.into()) }; let (body, source_map) = collect_fn_body_syntax(irrelevant_function, fn_def); let scopes = ExprScopes::new(Arc::new(body)); let scopes = @@ -421,7 +422,8 @@ mod tests { let fn_def: &ast::FnDef = find_node_at_offset(file.syntax(), off).unwrap(); let name_ref: &ast::NameRef = find_node_at_offset(file.syntax(), off).unwrap(); - let irrelevant_function = Function { id: crate::ids::FunctionId::from_raw(0.into()) }; + let irrelevant_function = + Function { id: crate::ids::FunctionId::from_intern_id(0u32.into()) }; let (body, source_map) = collect_fn_body_syntax(irrelevant_function, fn_def); let scopes = ExprScopes::new(Arc::new(body)); let scopes = -- cgit v1.2.3