b38f9a5810
4570: Use Chalk's built-in impls r=matklad a=flodiebold This contains two changes: - Chalk has begun adding built-in representations of primitive types; use these in our type conversion logic. There's one somewhat 'iffy' part here, namely references; we don't keep track of lifetimes, but Chalk does, so it will expect a lifetime parameter on references. If we didn't provide that, it could cause crashes in Chalk code that expects the lifetime, so I rather hackily add an (always the same) lifetime placeholder during conversion. I expect that we'll fully switch to using Chalk's types everywhere before we add lifetime support, so I think this is the best solution for now. - let Chalk know about well-known traits (from lang items), so it can apply its built-in impls. Before: ``` Total expressions: 181485 Expressions of unknown type: 2940 (1%) Expressions of partially unknown type: 2884 (1%) Type mismatches: 901 Inference: 37.821210245s, 0b allocated 0b resident Total: 53.399467609s, 0b allocated 0b resident ``` After: ``` Total expressions: 181485 Expressions of unknown type: 2923 (1%) Expressions of partially unknown type: 2879 (1%) Type mismatches: 734 Inference: 39.157752509s, 0b allocated 0b resident Total: 54.110767621s, 0b allocated 0b resident ``` (I will start splitting up `chalk.rs` in a separate PR, since it's getting pretty big...) Co-authored-by: Florian Diebold <flodiebold@gmail.com> Co-authored-by: Florian Diebold <florian.diebold@freiheit.com> |
||
---|---|---|
.cargo | ||
.github | ||
.vscode | ||
crates | ||
docs | ||
editors/code | ||
xtask | ||
.gitattributes | ||
.gitignore | ||
bors.toml | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
rustfmt.toml |
rust-analyzer is an experimental 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. If you want to get involved, check the rls-2.0 working group:
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0
Work on rust-analyzer is sponsored by
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.
Getting in touch
We are on the rust-lang Zulip!
https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0
Quick Links
- API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide/
- Website: https://rust-analyzer.github.io/
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.