rust/crates
bors[bot] b38f9a5810
Merge #4570
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>
2020-05-22 17:31:39 +00:00
..
ra_arena Extract messy tree handling out of profiling code 2020-04-25 21:22:40 +02:00
ra_assists KISS SourceChange 2020-05-22 18:04:26 +02:00
ra_cfg Move feature desugaring to the right abstraction layer 2020-05-08 02:56:53 +02:00
ra_db Expand fixture documentation a little 2020-05-10 16:51:12 +02:00
ra_flycheck Cleanups 2020-05-15 02:09:30 +02:00
ra_fmt Introduce EffectExpr 2020-05-02 11:21:39 +02:00
ra_hir Add doc comment for resolve_hir_path_qualifier 2020-05-16 20:40:58 +01:00
ra_hir_def Provide Chalk well-known traits 2020-05-22 17:32:49 +02:00
ra_hir_expand Store proc-macro result in salsa db 2020-05-14 17:57:51 +08:00
ra_hir_ty Add some tests for Chalk built-in trait impls 2020-05-22 18:52:07 +02:00
ra_ide KISS SourceChange 2020-05-22 18:04:26 +02:00
ra_ide_db KISS SourceChange 2020-05-22 18:04:26 +02:00
ra_mbe Reuse Vec allocations 2020-05-16 22:20:44 +02:00
ra_parser Shrink ra_parser::Event from 32 bytes to 16 bytes 2020-05-16 22:20:44 +02:00
ra_proc_macro proc_macro: add ability to log to stderr and view output in vscode 2020-04-23 01:57:02 +03:00
ra_proc_macro_srv Remove dbg 2020-05-10 06:39:36 +08:00
ra_prof Simplify profiler impl (bubble up Option and shorten code 2020-04-26 00:55:49 +03:00
ra_project_model Make some stuff public so that they can be reused by other tools 2020-05-14 11:14:46 +02:00
ra_syntax Merge #4521 #4522 2020-05-19 23:30:48 +00:00
ra_text_edit Formalize JoinLines protocol extension 2020-05-21 20:05:33 +02:00
ra_toolchain Simplify match 2020-05-09 22:20:11 +03:00
ra_tt Reduce reallocations in ra_tt::buffer::TokenBuffer::new_inner 2020-05-16 22:20:44 +02:00
rust-analyzer Merge #4571 2020-05-22 16:09:37 +00:00
stdx Use snippets in add function 2020-05-20 01:23:05 +02:00
test_utils Switch to new magic marks 2020-05-20 13:02:53 +02:00