fix: comletion detail shows {unknown} for impl Trait in return position

This commit is contained in:
iDawer 2022-04-12 20:40:31 +05:00
parent 66c232d03b
commit f972adc201
2 changed files with 42 additions and 3 deletions

View file

@ -602,3 +602,42 @@ fn func() {
"#]],
);
}
#[test]
fn detail_impl_trait_in_return_position() {
check_empty(
r"
//- minicore: sized
trait Trait<T> {}
fn foo<U>() -> impl Trait<U> {}
fn main() {
self::$0
}
",
expect![[r"
tt Trait
fn main() fn()
fn foo() fn() -> impl Trait<U>
"]],
);
}
#[test]
fn detail_async_fn() {
// FIXME: #11438
check_empty(
r#"
//- minicore: future, sized
trait Trait<T> {}
async fn foo() -> u8 {}
fn main() {
self::$0
}
"#,
expect![[r"
tt Trait
fn main() fn()
fn foo() async fn() -> impl Future<Output = u8>
"]],
);
}