rust-analyzer/crates/hir_ty/src
bors[bot] 29f5154d1c
Merge #6350
6350: Make IncorrectDiagnostic match rustc by copying rustc's code. r=popzxc a=ArifRoktim

This closes #6343 and closes #6345.

The old algorithm which used a `DetectedCase` enum, didn't match how rustc thinks of cases. Some inputs can be interpreted as more than 1 case depending on the situation. For example, to rustc:
- `ABCD`: Can be both camel case and upper snake case
- `X86_64`: Can be both camel case and upper snake case

I could've made `detect_case` return a collection of `DetectedCase` and then modified the other code as such, but I think using the same code rustc uses is simpler and a surefire way to achieve the same diagnostics as rustc.

Co-authored-by: Arif Roktim <arifrroktim@gmail.com>
2020-10-26 13:20:57 +00:00
..
diagnostics Make IncorrectDiagnostic match rustc by copying rustc's code. 2020-10-24 19:21:53 -04:00
infer binary operator overload type inference: add test mark 2020-10-14 19:00:04 +02:00
tests binary operator overload type inference: add test mark 2020-10-14 19:00:04 +02:00
traits Get rid of FAKE_PLACEHOLDER 2020-10-25 12:42:38 +01:00
autoderef.rs Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00
db.rs Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00
diagnostics.rs Add descriptions for diagnostics parseable by xtask 2020-10-19 20:55:16 +03:00
display.rs Fix trait object hir formatting behind pointer and references 2020-10-06 14:40:27 +02:00
infer.rs Implement binary operator overloading type inference 2020-10-13 20:48:08 +02:00
lib.rs Update chalk to 0.27 and adapt to chalk changes. 2020-09-15 22:37:05 +08:00
lower.rs Use Ty::apply instead of simple and fix method resolution. 2020-09-17 00:58:41 +08:00
method_resolution.rs Use Ty::apply instead of simple and fix method resolution. 2020-09-17 00:58:41 +08:00
op.rs Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00
primitive.rs Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00
test_db.rs Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00
tests.rs Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
traits.rs Improve Chalk debugging 2020-10-23 15:28:02 +02:00
utils.rs Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00