rust/crates/hir_ty
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
..
src Merge #6350 2020-10-26 13:20:57 +00:00
Cargo.toml Add tracing to main rust-analyzer binary 2020-10-25 13:53:38 +01:00