about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-02 13:35:42 +0000
committerbors <bors@rust-lang.org>2024-01-02 13:35:42 +0000
commit76591096fb3348022ad40b63b3c892a286272293 (patch)
treef9fcc37b457caf46d59073aacdc98a4a546364f1 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parent34df29620aee42179bdfec13cc221460241f27d4 (diff)
parent9a36bc393d06629d58295f86e4447051d1cfa923 (diff)
downloadrust-76591096fb3348022ad40b63b3c892a286272293.tar.gz
rust-76591096fb3348022ad40b63b3c892a286272293.zip
Auto merge of #16136 - saiintbrisson:fix/completion/a-tad-smarter-with-fns, r=Veykril
fix(completion): make the expected type a tad smarter with `Fn`s

This commit changes how the expected type is calculated when
working with Fn pointers, making the parenthesis stop vanishing
when completing the function name.

I've been bugged by the behavior of parenthesis completion for
a long while now. R-a assumes that the `LetStmt` type is the same
as the function type I've just written. Worse is that all parenthesis
vanish, even from functions that have completely different signatures.
It will now verify if the signature is the same.

While working on this, I noticed that record fields behave the same,
so I also made it prioritize the field type instead of the current
expression when possible, but I'm unsure if this is OK, so input is
appreciated.

ImplTraits as return types will still behave weirdly because lowering
is disallowed at the time it resolves the function types.

![image](https://github.com/rust-lang/rust-analyzer/assets/29989290/c06d6c93-5cac-4ebe-a93b-923017a6ae8c)
![image](https://github.com/rust-lang/rust-analyzer/assets/29989290/31594d82-fa4d-446c-a77e-47e9de1a9a67)
![image](https://github.com/rust-lang/rust-analyzer/assets/29989290/cf33856e-a485-411b-91af-11090d78a44e)
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions