Go to file
bors 492b3deba7 Auto merge of #13971 - lowr:fix/more-precise-builtin-binop-types, r=Veykril
fix: more precise binop inference

While inferring binary operator expressions, Rust puts some extra constraints on the types of the operands for better inference. Relevant part in rustc is [this](159ba8a92c/compiler/rustc_hir_typeck/src/op.rs (L128-L152)).

There are two things we currently fail to consider:
- we should enforce them only when both lhs and rhs type are builtin types that are applicable to the binop
- lhs and rhs types may be single reference to applicable builtin types

This PR basically ports [`enforce_builtin_binop_types()`](159ba8a92c/compiler/rustc_hir_typeck/src/op.rs (L159)) and [`is_builtin_binop()`](159ba8a92c/compiler/rustc_hir_typeck/src/op.rs (LL927)) to our inference context.
2023-01-17 12:39:53 +00:00
.cargo Add CARGO_WORKSPACE_DIR env var in .cargo/config.toml 2022-07-19 13:02:16 +02:00
.github Tweak wording and remove blank issue template 2023-01-10 17:25:02 +02:00
.vscode ⬆️ rust-analyzer 2022-08-16 11:24:50 +03:00
assets
bench_data avoid a &str to String conversion 2022-08-17 04:58:26 +09:00
crates Enforce builtin binop expectations even without lang items 2023-01-17 20:17:15 +09:00
docs Regen config 2023-01-16 17:02:30 +01:00
editors/code Regen config 2023-01-16 17:02:30 +01:00
lib Make it clearer when the server expects an initialized notification 2023-01-09 17:03:36 +01:00
xtask Iterate over arrays dirrectly, instead of going through a slice 2023-01-14 13:02:28 +00:00
.editorconfig
.git-blame-ignore-revs add prettier format commit to ignored revisions 2022-05-17 18:15:51 +01:00
.gitattributes Fix .gitattributes for test_data 2022-07-24 14:05:35 +02:00
.gitignore
Cargo.lock Update command-group from 1.0.8 to 2.0.1 2023-01-15 08:20:25 +00:00
Cargo.toml Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00
LICENSE-APACHE
LICENSE-MIT
PRIVACY.md
README.md ⬆️ rust-analyzer 2022-08-09 07:23:57 +03:00
rustfmt.toml
triagebot.toml ⬆️ rust-analyzer 2022-11-09 21:49:10 +02: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.

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.