rust-analyzer/crates
bors[bot] ab896e38e1
Merge #11550
11550: Refactor autoderef/method resolution r=flodiebold a=flodiebold

- don't return the receiver type from method resolution; instead just
 return the autorefs/autoderefs that happened and repeat them. This
 ensures all the effects like trait obligations and whatever we learned
 about type variables from derefing them are actually applied. Also, it
 allows us to get rid of `decanonicalize_ty`, which was just wrong in
 principle.

 - Autoderef itself now directly works with an inference table. Sadly
 this has the effect of making it harder to use as an iterator, often
 requiring manual `while let` loops. (rustc works around this by using
 inner mutability in the inference context, so that things like unifying
 types don't require a unique reference.)

 - We now record the adjustments (autoref/deref) for method receivers
 and index expressions, which we didn't before.

 - Removed the redundant crate parameter from method resolution, since
 the trait_env contains the crate as well.

 - in the HIR API, the methods now take a scope to determine the trait env.
 `Type` carries a trait env, but I think that's probably a bad decision
 because it's easy to create it with the wrong env, e.g. by using
 `Adt::ty`. This mostly didn't matter so far because
 `iterate_method_candidates` took a crate parameter and ignored
 `self.krate`, but the trait env would still have been wrong in those
 cases, which I think would give some wrong results in some edge cases.

Fixes #10058.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-02-25 16:11:22 +00:00
..
base_db Add test for giving attribute proc macros valid syntax 2022-02-07 12:54:08 +01:00
cfg Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
flycheck Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
hir Refactor autoderef and method resolution 2022-02-25 11:47:14 +01:00
hir_def feat: support concat_bytes 2022-02-25 18:46:11 +08:00
hir_expand feat: support concat_bytes 2022-02-25 18:46:11 +08:00
hir_ty Avoid autoderef coercions leaking if they don't apply 2022-02-25 15:46:02 +01:00
ide add logic to highlight continue and break keywords according to expectations 2022-02-24 18:58:14 +01:00
ide_assists Refactor autoderef and method resolution 2022-02-25 11:47:14 +01:00
ide_completion Refactor autoderef and method resolution 2022-02-25 11:47:14 +01:00
ide_db Refactor autoderef and method resolution 2022-02-25 11:47:14 +01:00
ide_diagnostics More correct $crate handling in eager macros 2022-01-27 16:57:53 +01:00
ide_ssr Refactor autoderef and method resolution 2022-02-25 11:47:14 +01:00
limit Use compare_exchange_weak in limit::Limit::check 2022-01-28 18:19:35 +03:00
mbe internal: Split unresolve proc-macro error out of mbe 2022-02-22 10:08:00 +01:00
parser Update tests 2022-02-21 08:34:35 +02:00
paths Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
proc_macro_api Set current working directory for procedural macros 2022-01-27 16:18:12 +03:00
proc_macro_srv fix: Fix proc-macro server not using the supplied span in Ident::new 2022-01-31 17:02:57 +01:00
proc_macro_test Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
profile Generate AnyHasDocComments node 2022-01-07 12:38:18 +01:00
project_model Pass required features to cargo when using run action 2022-02-06 19:02:25 +03:00
rust-analyzer Add CSV output to analysis-stats 2022-02-25 11:45:44 +01:00
sourcegen Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
stdx Generate AnyHasDocComments node 2022-01-07 12:38:18 +01:00
syntax fix(11422): have two different funuctions - one for iterating breaks, one for iteraating breaks and continues 2022-02-24 19:00:08 +01:00
test_utils fix: Do not complete Drop::drop, complete std::mem::drop instead 2021-12-22 02:25:38 +01:00
text_edit Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
toolchain Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
tt Track synthetic tokens, to be able to remove them again later 2022-02-08 18:13:18 +01:00
vfs Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
vfs-notify Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00