mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Fix coercion of async block
This commit is contained in:
parent
56bee2ddaf
commit
da3fa2b7f0
2 changed files with 42 additions and 1 deletions
|
@ -1120,4 +1120,30 @@ fn test() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn type_hints_async_block() {
|
||||
check_types(
|
||||
r#"
|
||||
//- minicore: future
|
||||
async fn main() {
|
||||
let _x = async { 8_i32 };
|
||||
//^^ impl Future<Output = i32>
|
||||
}"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn type_hints_async_block_with_tail_return_exp() {
|
||||
check_types(
|
||||
r#"
|
||||
//- minicore: future
|
||||
async fn main() {
|
||||
let _x = async {
|
||||
//^^ impl Future<Output = i32>
|
||||
return 8_i32;
|
||||
};
|
||||
}"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue