about summary refs log tree commit diff
path: root/src/test/ui/check_match
AgeCommit message (Collapse)AuthorLines
2019-10-27Gather together usefulness testsNadrieril-213/+0
I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder.
2019-10-16Only emit overlapping patterns lint if the overlap is partialEsteban Küber-18/+0
2019-10-16Continue to emit unreachable pattern on cases caught by overlapping patternsEsteban Küber-0/+6
2019-10-16Move overlapping patterns to its own lintEsteban Küber-2/+8
2019-10-16Add check for overlapping ranges to unreachable patterns lintEsteban Küber-12/+47
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-1/+1
2019-03-11Update testsVadim Petrochenkov-8/+8
2019-03-02Point at enum definition when match patterns are not exhaustiveEsteban Küber-0/+22
``` error[E0004]: non-exhaustive patterns: type `X` is non-empty --> file.rs:9:11 | 1 | / enum X { 2 | | A, | | - variant not covered 3 | | B, | | - variant not covered 4 | | C, | | - variant not covered 5 | | } | |_- `X` defined here ... 9 | match x { | ^ | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: `B` and `C` not covered --> file.rs:11:11 | 1 | / enum X { 2 | | A, 3 | | B, 4 | | C, | | - not covered 5 | | } | |_- `X` defined here ... 11 | match x { | ^ patterns `C` not covered ``` When a match expression doesn't have patterns covering every variant, point at the enum's definition span. On a best effort basis, point at the variant(s) that are missing. This does not handle the case when the missing pattern is due to a field's enum variants: ``` enum E1 { A, B, C, } enum E2 { A(E1), B, } fn foo() { match E2::A(E1::A) { E2::A(E1::B) => {} E2::B => {} } //~^ ERROR `E2::A(E1::A)` and `E2::A(E1::C)` not handled } ``` Unify look between match with no arms and match with some missing patterns. Fix #37518.
2018-12-25Remove licensesMark Rousskov-32/+12
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-6/+6
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-04-13Rename must-compile-successfully into compile-passGuillaume Gomez-1/+1
2018-03-14update testsGuillaume Gomez-1/+1
2018-02-26Update UI testsVadim Petrochenkov-12/+12
2018-02-25Update ui testsGuillaume Gomez-0/+1
2017-12-10Update ui tests' line numbers.Tommy Ip-8/+8
2017-12-10Add must-compile-successfully comment to appropriate ui tests.Tommy Ip-0/+2
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-16/+16
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-8/+13
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-07-16Fix `range_covered_by_constructor` for exclusive ranges.Sam Cappleman-Lynes-0/+71
This resolves #43253
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-1/+1
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-05-24Change error count messagesMichael Kohl-1/+1
See #33525 for details.
2017-01-03Improve error message, fix and add tests.Andrew Cann-2/+2
Changes the non-exhaustive match error message to generate more general witnesses.
2016-10-26un-break the `construct_witness` logicAriel Ben-Yehuda-0/+103
Fixes #35609.