From c5ee60e05b1fafe20f56b21cfab30e7b80cb9d42 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 14 Mar 2019 22:03:39 +0100 Subject: Replace Display by a pretty printing trait for Ty This allows removing the names from Adt and FnDef (and more later), as a first step towards aligning more with chalk's Ty :) --- crates/ra_hir/src/ty/tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/ty/tests.rs') diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index c7d409e6d..acae71c26 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; use crate::{ source_binder, mock::MockDatabase, + ty::display::HirDisplay, }; // These tests compare the inference results for all expressions in a file @@ -2142,7 +2143,7 @@ fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { let node = algo::find_node_at_offset::(syntax.syntax(), pos.offset).unwrap(); let expr = body_source_map.node_expr(node).unwrap(); let ty = &inference_result[expr]; - ty.to_string() + ty.display(db).to_string() } fn infer(content: &str) -> String { @@ -2178,7 +2179,7 @@ fn infer(content: &str) -> String { "{} '{}': {}\n", syntax_ptr.range(), ellipsize(node.text().to_string().replace("\n", " "), 15), - ty + ty.display(&db) ) .unwrap(); } -- cgit v1.2.3