mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
fix: Attempt to resolve paths in const arguments heuristically
While we don't support const args in type inference yet, we can at least make use of the fallback path resolution to resolve paths in const args in the IDE layer to enable some features for them.
This commit is contained in:
parent
7959c24876
commit
4a1423337f
4 changed files with 51 additions and 41 deletions
|
@ -118,6 +118,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
|
|||
<span class="brace">}</span>
|
||||
|
||||
<span class="keyword">fn</span> <span class="function declaration">const_param</span><span class="angle"><</span><span class="keyword">const</span> <span class="const_param declaration">FOO</span><span class="colon">:</span> <span class="builtin_type">usize</span><span class="angle">></span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="operator">-></span> <span class="builtin_type">usize</span> <span class="brace">{</span>
|
||||
<span class="function">const_param</span><span class="operator">::</span><span class="angle"><</span><span class="brace">{</span> <span class="const_param">FOO</span> <span class="brace">}</span><span class="angle">></span><span class="parenthesis">(</span><span class="parenthesis">)</span><span class="semicolon">;</span>
|
||||
<span class="const_param">FOO</span>
|
||||
<span class="brace">}</span>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue