diff options
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 0f8551a9d..0f2172ddf 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -10,6 +10,7 @@ use test_utils::covers; | |||
10 | use crate::{ | 10 | use crate::{ |
11 | source_binder, | 11 | source_binder, |
12 | mock::MockDatabase, | 12 | mock::MockDatabase, |
13 | ty::display::HirDisplay, | ||
13 | }; | 14 | }; |
14 | 15 | ||
15 | // These tests compare the inference results for all expressions in a file | 16 | // These tests compare the inference results for all expressions in a file |
@@ -2196,7 +2197,7 @@ fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { | |||
2196 | let node = algo::find_node_at_offset::<ast::Expr>(syntax.syntax(), pos.offset).unwrap(); | 2197 | let node = algo::find_node_at_offset::<ast::Expr>(syntax.syntax(), pos.offset).unwrap(); |
2197 | let expr = body_source_map.node_expr(node).unwrap(); | 2198 | let expr = body_source_map.node_expr(node).unwrap(); |
2198 | let ty = &inference_result[expr]; | 2199 | let ty = &inference_result[expr]; |
2199 | ty.to_string() | 2200 | ty.display(db).to_string() |
2200 | } | 2201 | } |
2201 | 2202 | ||
2202 | fn infer(content: &str) -> String { | 2203 | fn infer(content: &str) -> String { |
@@ -2232,7 +2233,7 @@ fn infer(content: &str) -> String { | |||
2232 | "{} '{}': {}\n", | 2233 | "{} '{}': {}\n", |
2233 | syntax_ptr.range(), | 2234 | syntax_ptr.range(), |
2234 | ellipsize(node.text().to_string().replace("\n", " "), 15), | 2235 | ellipsize(node.text().to_string().replace("\n", " "), 15), |
2235 | ty | 2236 | ty.display(&db) |
2236 | ) | 2237 | ) |
2237 | .unwrap(); | 2238 | .unwrap(); |
2238 | } | 2239 | } |