aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index ca1693679..c1024d03c 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -4694,14 +4694,16 @@ fn infer(content: &str) -> String {
4694 } 4694 }
4695 4695
4696 // sort ranges for consistency 4696 // sort ranges for consistency
4697 types.sort_by_key(|(src_ptr, _)| (src_ptr.ast.range().start(), src_ptr.ast.range().end())); 4697 types.sort_by_key(|(src_ptr, _)| {
4698 (src_ptr.value.range().start(), src_ptr.value.range().end())
4699 });
4698 for (src_ptr, ty) in &types { 4700 for (src_ptr, ty) in &types {
4699 let node = src_ptr.ast.to_node(&src_ptr.file_syntax(&db)); 4701 let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db));
4700 4702
4701 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { 4703 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) {
4702 (self_param.self_kw_token().text_range(), "self".to_string()) 4704 (self_param.self_kw_token().text_range(), "self".to_string())
4703 } else { 4705 } else {
4704 (src_ptr.ast.range(), node.text().to_string().replace("\n", " ")) 4706 (src_ptr.value.range(), node.text().to_string().replace("\n", " "))
4705 }; 4707 };
4706 let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" }; 4708 let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" };
4707 write!( 4709 write!(