From 643bbf15a2a76e7241156249261bf0d060deecd4 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 6 Oct 2020 14:40:27 +0200 Subject: Fix trait object hir formatting behind pointer and references --- crates/ide/src/inlay_hints.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'crates/ide/src') diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 1d7e8de56..3a4dc6a84 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -1023,6 +1023,40 @@ mod collections { type Item=T; } } +"#, + ); + } + + #[test] + fn multi_dyn_trait_bounds() { + check_with_config( + InlayHintsConfig { + type_hints: true, + parameter_hints: false, + chaining_hints: false, + max_length: None, + }, + r#" +//- /main.rs crate:main +pub struct Vec {} + +impl Vec { + pub fn new() -> Self { Vec {} } +} + +pub struct Box {} + +trait Display {} +trait Sync {} + +fn main() { + let _v = Vec::>::new(); + //^^ Vec> + let _v = Vec::>::new(); + //^^ Vec> + let _v = Vec::>::new(); + //^^ Vec> +} "#, ); } -- cgit v1.2.3