aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/inlay_hints.rs
diff options
context:
space:
mode:
authorBenjamin Coenen <[email protected]>2020-10-28 11:29:42 +0000
committerBenjamin Coenen <[email protected]>2020-10-28 13:07:12 +0000
commitef2f7bb2438e66fd046791bb67849b6c61d946ab (patch)
tree5a00c8683a031f026bddf2fb33645b4af2c5fdaf /crates/ide/src/inlay_hints.rs
parent8762b797fd37e9a9cab3e5fe534a9672f30e6022 (diff)
do not use associated types placeholder for inlay hint
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ide/src/inlay_hints.rs')
-rw-r--r--crates/ide/src/inlay_hints.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs
index 49d8e4ae1..adb93efd7 100644
--- a/crates/ide/src/inlay_hints.rs
+++ b/crates/ide/src/inlay_hints.rs
@@ -1235,4 +1235,25 @@ fn main() {
1235"#, 1235"#,
1236 ); 1236 );
1237 } 1237 }
1238
1239 #[test]
1240 fn infer_call_method_return_associated_types_with_generic() {
1241 check(
1242 r#"
1243 pub trait Default {
1244 fn default() -> Self;
1245 }
1246 pub trait Foo {
1247 type Bar: Default;
1248 }
1249
1250 pub fn quux<T: Foo>() -> T::Bar {
1251 let y = Default::default();
1252 //^ <T as Foo>::Bar
1253
1254 y
1255 }
1256 "#,
1257 );
1258 }
1238} 1259}