about summary refs log tree commit diff
path: root/compiler/rustc_plugin_impl/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-08-07 01:46:33 +0900
committerGitHub <noreply@github.com>2021-08-07 01:46:33 +0900
commit8ee962f88e1be7e29482b13c7776c26b98a93bf7 (patch)
tree2ffb547ab09085b2502bfdbf2b11d2445365c663 /compiler/rustc_plugin_impl/src
parent3b0e797ee6678175d1df9a01e944312b348d05b0 (diff)
parentd0d49477755cead57aa20a4958562e7ca6e8f805 (diff)
downloadrust-8ee962f88e1be7e29482b13c7776c26b98a93bf7.tar.gz
rust-8ee962f88e1be7e29482b13c7776c26b98a93bf7.zip
Rollup merge of #87775 - Kobzol:single-associated-item-hint, r=oli-obk
Add hint for unresolved associated trait items if the trait has a single item

This PR introduces a special-cased hint for unresolved trait items paths. It is shown if:
- the path was not resolved to any existing trait item
- and no existing trait item's name was reasonably close with regard to edit distance
- and the trait only has a single item in the corresponding namespace

I didn't know where I should put tests, therefore so far I just managed to bless two existing tests. I would be glad for hints where should tests for a hint like this be created, how should they be named (with reference to the original issue?) and what tests should I create (is it enough to test it just for types? or create separate tests also for functions and constants?).

It could also be turned into a machine applicable suggestion I suppose.

This is my first `rustc` PR, so please go easy on me :)

Fixes: https://github.com/rust-lang/rust/issues/87638
Diffstat (limited to 'compiler/rustc_plugin_impl/src')
0 files changed, 0 insertions, 0 deletions