rust-analyzer/crates
Francis McKenzie e77752eaf0 Fix for #17497 - Invalid RA diagnostic error: expected 2 arguments, found 1
The issue occurs because in some configurations of traits where one of them has Deref as a supertrait, RA's type inference algorithm fails to resolve the Deref::Target type, and instead uses a TyKind::BoundVar (i.e. an unknown type). This "autoderefed" type then incorrectly acts as if it implements all traits in scope.

The fix is to re-apply the same sanity-check that is done in iterate_method_candidates_with_autoref(), that is: don't try to resolve methods on unknown types. This same sanity-check is now done on each autoderefed type for which trait methods are about to be checked. If the autoderefed type is unknown, then the iterating of the trait methods for that type is skipped.

Includes a unit test that only passes after applying the fixes in this commit.

Includes a change to the assertion count in test syntax_highlighting::tests::benchmark_syntax_highlighting_parser as suggested by Lukas Wirth during review.

Includes a change to the sanity-check code as suggested by Florian Diebold during review.
2024-07-28 00:32:37 +08:00
..
base-db Make LRU opt-in 2024-07-19 18:38:08 +02:00
cfg Make CfgExpr slimmer 2024-07-21 14:50:44 +02:00
flycheck feature: move linked_projects discovery to the rust-analyzer server 2024-07-18 12:01:27 -04:00
hir Fix incorrect handling of cfg'd varargs 2024-07-25 11:02:19 +02:00
hir-def Remove unused trace module 2024-07-25 14:08:48 +02:00
hir-expand fix: Fix includes not working with expr fragment inputs 2024-07-26 10:12:06 +02:00
hir-ty Fix for #17497 - Invalid RA diagnostic error: expected 2 arguments, found 1 2024-07-28 00:32:37 +08:00
ide Fix for #17497 - Invalid RA diagnostic error: expected 2 arguments, found 1 2024-07-28 00:32:37 +08:00
ide-assists Auto merge of #17647 - joshka:jm/rename-commands, r=Veykril 2024-07-22 08:10:03 +00:00
ide-completion fix: Allow flyimport to import primitive shadowing modules 2024-07-21 13:26:19 +02:00
ide-db chore: update codegens 2024-07-23 22:36:46 +01:00
ide-diagnostics early exit if unresolved field is an index 2024-07-26 22:44:47 +02:00
ide-ssr Parse try as a keyword only in edition 2018 and up 2024-07-19 15:43:20 +02:00
intern Fix incorrect handling of cfg'd varargs 2024-07-25 11:02:19 +02:00
limit Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
load-cargo minor changes 2024-07-23 15:50:12 +02:00
mbe Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
parser fix: move use parsing to outer match arm 2024-07-23 22:36:46 +01:00
paths Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
proc-macro-api Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
proc-macro-srv Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
proc-macro-srv-cli Abstract proc-macro-srv protocol format 2024-06-30 16:56:30 +02:00
profile Fix stop_watch on linux 2024-07-07 08:40:41 +02:00
project-model fix: Support new cargo config get env format 2024-07-25 12:28:31 +02:00
rust-analyzer Auto merge of #17674 - davidbarsky:david/add-more-information-to-status-command, r=Veykril 2024-07-24 10:10:58 +00:00
salsa Fix and enable unsafe_op_in_unsafe_fn 2024-07-25 08:41:30 +03:00
span Remove Params and Fields from AstIdMap 2024-07-25 10:22:05 +02:00
stdx Fix and enable unsafe_op_in_unsafe_fn 2024-07-25 08:41:30 +03:00
syntax Auto merge of #17676 - winstxnhdw:precise-capturing, r=Veykril 2024-07-25 11:10:56 +00:00
test-fixture Prefer standard library paths over shorter extern deps re-exports 2024-07-21 09:14:17 +02:00
test-utils fix: Allow flyimport to import primitive shadowing modules 2024-07-21 13:26:19 +02:00
text-edit Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
toolchain Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00
tt Switch token trees to use Symbols 2024-07-16 10:11:59 +02:00
vfs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
vfs-notify Remove inline rust_2018_idioms, unused_lifetimes lint warn, Cargo.toml already enforces this 2024-06-30 15:23:54 +02:00