aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty
Commit message (Collapse)AuthorAgeFilesLines
* internal: use cov-mark rather than bailing out diagnosticAleksey Kladov2021-06-131-14/+3
|
* internal: refactor incorrect case diagnosticsAleksey Kladov2021-06-131-3/+0
|
* Merge #9246bors[bot]2021-06-131-11/+7
|\ | | | | | | | | | | | | | | | | 9246: internal: unified missing fields diagnostic r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * internal: unified missing fields diagnosticAleksey Kladov2021-06-131-11/+7
| |
* | Merge #9244bors[bot]2021-06-134-36/+138
|\ \ | |/ |/| | | | | | | | | | | | | | | 9244: feat: Make block-local trait impls work r=flodiebold a=flodiebold As long as either the trait or the implementing type are defined in the same block. CC #8961 Co-authored-by: Florian Diebold <[email protected]>
| * Make block-local trait impls workFlorian Diebold2021-06-134-36/+138
| | | | | | | | | | As long as either the trait or the implementing type are defined in the same block.
* | minor: put a mark backAleksey Kladov2021-06-131-0/+1
|/
* cargo fmtMaan20032021-06-132-9/+2
|
* clippy::redundant_field_namesMaan20032021-06-131-1/+1
|
* clippy::redundant_closureMaan20032021-06-134-5/+5
|
* clippy::useless_conversionMaan20032021-06-131-1/+1
|
* clippy::redudant_borrowMaan20032021-06-1310-29/+29
|
* Merge #9239bors[bot]2021-06-125-54/+183
|\ | | | | | | | | | | | | | | | | | | 9239: fix: Fix coercion in match with expected type r=flodiebold a=flodiebold Plus add infrastructure to test type mismatches without expect. CC #8961 Co-authored-by: Florian Diebold <[email protected]>
| * Fix coercion in match with expected typeFlorian Diebold2021-06-125-54/+183
| | | | | | | | Plus add infrastructure to test type mismatches without expect.
* | internal: cross-crate cov-marksAleksey Kladov2021-06-122-1/+3
|/
* internal: move diagnostics infra to hirAleksey Kladov2021-06-124-612/+13
|
* Move some hir_ty diagnostics to hirAleksey Kladov2021-06-124-1763/+97
|
* minor: reduce visibilityAleksey Kladov2021-06-121-3/+2
|
* internal: move missing unsafe diagnostic to hirAleksey Kladov2021-06-123-162/+21
|
* internal: move inference diagnostics to hirAleksey Kladov2021-06-123-239/+10
|
* Set enable_proc_attr_macros in hir_ty TestDBJonas Schievink2021-06-031-1/+9
|
* Merge #9104bors[bot]2021-06-032-1/+64
|\ | | | | | | | | | | | | | | | | | | | | 9104: Implement `#[rustc_skip_array_during_method_dispatch]` r=flodiebold a=jonas-schievink haxx run the world Closes https://github.com/rust-analyzer/rust-analyzer/issues/8552 Part of https://github.com/rust-analyzer/rust-analyzer/issues/9056 Co-authored-by: Jonas Schievink <[email protected]>
| * Implement `#[rustc_skip_array_during_method_dispatch]`Jonas Schievink2021-06-012-1/+64
| |
* | Merge #9105bors[bot]2021-06-035-15/+50
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9105: internal: calculate pattern adjustments r=flodiebold a=iDawer This extends `InferenceResult` with `pub pat_adjustments: FxHashMap<PatId, Vec<Ty>>`. Fixes #9095 Co-authored-by: Dawer <[email protected]>
| * | internal: implement pattern adjustments.Dawer2021-06-013-2/+35
| | |
| * | minor: Avoid eprintln on panicDawer2021-06-012-13/+15
| | |
* | | Fix bind patterns always being treated as ref taking patternsLukas Wirth2021-06-022-19/+32
| |/ |/|
* | Implement per-edition preludesJonas Schievink2021-06-015-44/+97
|/
* Merge #8717bors[bot]2021-05-316-805/+2768
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8717: Update match checking algorithm r=iDawer a=iDawer I've recently got interest in the match checking to extend the current algo to support reporting witnesses of non-exhaustiveness. It appears the algo is outdated from rustc's implementation. I decided to rewrite it based on the latest rustc's version. It is a diff-based port to ra codebase. That means you can diff-compare these files to rustc. I'm striving to keep minimal ra-related changes in the algo to make it easier to backport future changes from the upstream. Based on upstream algorithm of version rust-lang/rust 1.52.0-nightly (25c15cdbe 2021-04-22) https://github.com/rust-lang/rust/blob/25c15cdbe/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs The goal of this PR is to cover the current `missing-match-arm` diagnostic. What is remaining to do: - [x] Error handling. The errors that are unrelated to match checking will be handled before the check. Just like how it made in rustc. - [x] Lowering `hir_def::expr::Pat` to `hir_ty::diagnostics::match_check::Pat`. rustc's match checking works on top of `rustc_mir_build::thir::Pat`, which is lowered from `hir::Pat` and carries some extra semantics used by the check. All unrelated checks are done there. RA could use this to rule out running the check on unimplemented cases (`Pat::ConstBlock`, etc). - [x] ~~Proper~~Loose typecheck of match arm patterns (https://github.com/rust-analyzer/rust-analyzer/pull/8840, https://github.com/rust-analyzer/rust-analyzer/pull/8875). - [x] Tests from `hir_ty::diagnostics::match_check::tests`. - [x] Clean up `todo`s - [x] Test run on real repos https://github.com/rust-analyzer/rust-analyzer/pull/8717#issuecomment-847120265. Co-authored-by: Dawer <[email protected]>
| * Expand fixme commentsDawer2021-05-313-2/+5
| |
| * fix: panic on extra fields in a patternDawer2021-05-311-0/+25
| |
| * Correct binding pattern's type; handle invalid records.Dawer2021-05-311-5/+55
| |
| * Take substitutions into account.Dawer2021-05-313-14/+33
| |
| * eprint panic contextDawer2021-05-313-14/+36
| |
| * minor: doc comment pat_utilDawer2021-05-311-0/+4
| |
| * Test match guards, reference patternsDawer2021-05-311-0/+51
| |
| * Box field detection; test #[non-exhaustive] attributeDawer2021-05-313-10/+52
| |
| * Better tests: check if match checking bails out.Dawer2021-05-312-1/+69
| |
| * Replace the old match checking algorithmDawer2021-05-317-1927/+311
| |
| * Include old testsDawer2021-05-311-69/+597
| |
| * Don't panic on a pattern of unresolved ADT variant.Dawer2021-05-312-50/+14
| |
| * Clean up, more docs.Dawer2021-05-314-101/+383
| |
| * Check pattern types.Dawer2021-05-313-30/+85
| |
| * Expand binding patterns.Dawer2021-05-312-6/+110
| |
| * Fix visibility warningsDawer2021-05-313-12/+12
| |
| * Lower binding patternDawer2021-05-312-9/+28
| |
| * Lower bool literalsDawer2021-05-312-13/+29
| |
| * Treat ctor of unhandled type as non-exhaustive.Dawer2021-05-312-4/+24
| |
| * Lower Pat::PathDawer2021-05-311-0/+18
| |
| * Do not do match check if lowering failed.Dawer2021-05-311-2/+19
| |