diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-23 15:40:07 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-23 15:40:07 +0100 |
commit | 4a18509a98149fb3d5c73dbf0c6de4cfa8d4596c (patch) | |
tree | 2e10739d01c0eccf3c2b4eabc43470c0a815dc7e /crates/ra_hir_def/src/body | |
parent | 0502be3bf4539d24d34d24f3a4b9521d99a32aee (diff) | |
parent | 4176c03d1254a462da1c84a3a1185c8f2161e8a8 (diff) |
Merge #4099
4099: Remove SyntaxPtr::range from more places r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/scope.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index fe4137176..5b36a7cc1 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs | |||
@@ -325,8 +325,11 @@ mod tests { | |||
325 | let resolved = scopes.resolve_name_in_scope(expr_scope, &name_ref.as_name()).unwrap(); | 325 | let resolved = scopes.resolve_name_in_scope(expr_scope, &name_ref.as_name()).unwrap(); |
326 | let pat_src = source_map.pat_syntax(resolved.pat()).unwrap(); | 326 | let pat_src = source_map.pat_syntax(resolved.pat()).unwrap(); |
327 | 327 | ||
328 | let local_name = pat_src.value.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); | 328 | let local_name = pat_src.value.either( |
329 | assert_eq!(local_name.range(), expected_name.syntax().text_range()); | 329 | |it| it.syntax_node_ptr().to_node(file.syntax()), |
330 | |it| it.syntax_node_ptr().to_node(file.syntax()), | ||
331 | ); | ||
332 | assert_eq!(local_name.text_range(), expected_name.syntax().text_range()); | ||
330 | } | 333 | } |
331 | 334 | ||
332 | #[test] | 335 | #[test] |