No description
Find a file
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
.cargo xtask: replace "lint" command by a simply cargo alias 2021-03-14 13:36:45 +01:00
.github Update issue template 2022-02-18 19:30:15 +02:00
.vscode Add "Win Attach to Server" debug configuration 2021-01-25 17:46:03 +03:00
assets Simplified the dot in the wide logo 2021-10-13 01:41:12 +03:00
bench_data Add benchmark test for mbe 2021-02-25 05:47:13 +08:00
crates Merge #11550 2022-02-25 16:11:22 +00:00
docs Add Kakoune and Helix configuration 2022-02-23 08:55:56 +01:00
editors/code Remove reference to updates.channel from settings 2022-02-23 06:38:01 +02:00
lib Set MSRV 2021-10-23 15:07:11 +03:00
xtask Add CSV output to analysis-stats 2022-02-25 11:45:44 +01:00
.gitattributes Mark large benchmark data files as binary to filter greps 2021-09-22 12:51:58 -07:00
.gitignore internal: add "Shuffle Crate Graph" command 2021-12-07 16:37:19 +01:00
bors.toml Reduce bors timeout 2020-10-14 13:37:20 +02:00
Cargo.lock Upgrade ungrammar to 1.15.0 2022-02-21 08:34:36 +02:00
Cargo.toml cleanup 2022-02-15 14:47:23 +00:00
LICENSE-APACHE Licenses 2018-01-10 22:47:04 +03:00
LICENSE-MIT Licenses 2018-01-10 22:47:04 +03:00
PRIVACY.md Update privacy note 2021-12-23 14:04:15 +02:00
README.md Update README.md 2022-01-30 14:21:52 +01:00
rustfmt.toml Remove forcing \n via rustfmt 2019-11-02 22:19:59 +03:00

rust-analyzer logo

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

Work on rust-analyzer is sponsored by

Ferrous Systems

Quick Start

https://rust-analyzer.github.io/manual.html#installation

Documentation

If you want to contribute to rust-analyzer or are just curious about how things work under the hood, check the ./docs/dev folder.

If you want to use rust-analyzer's language server with your editor of choice, check the manual folder. It also contains some tips & tricks to help you be more productive when using rust-analyzer.

Security and Privacy

See the corresponding sections of the manual.

Communication

For usage and troubleshooting requests, please use "IDEs and Editors" category of the Rust forum:

https://users.rust-lang.org/c/ide/14

For questions about development and implementation, join rust-analyzer working group on Zulip:

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer

License

Rust analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.