about summary refs log tree commit diff
path: root/src/test/ui/match
AgeCommit message (Collapse)AuthorLines
2019-04-23Auto merge of #60125 - estebank:continue-evaluating, r=oli-obkbors-0/+9
Don't stop evaluating due to errors before borrow checking r? @oli-obk Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-0/+9
2019-04-22Remove double trailing newlinesvarkor-2/+0
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-3/+3
2019-03-11Update testsVadim Petrochenkov-36/+36
2019-03-02Point at enum definition when match patterns are not exhaustiveEsteban Küber-2/+26
``` 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.
2019-02-21Add address stability test for matchesMatthew Jasper-0/+39
2019-02-08review comments: (marginally) reduce memory consumtionEsteban Küber-1/+41
2019-02-07Add test for type mismatch on first match armEsteban Küber-0/+58
2019-01-14Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obkbors-77/+0
Use structured suggestions for nonstandard style lints This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered. Fixes #48103. Fixes #52414.
2019-01-12Don't add label to the match expr when the type is not fully realizedEsteban Küber-2/+0
2019-01-12Reword label as per review commentEsteban Küber-3/+3
2019-01-12Point at the match discriminant when arm pattern has a type mismatchEsteban Küber-1/+7
2019-01-08improve non_upper_case_globals diagnosticsAndy Russell-77/+0
Use a structured suggestion and tighten the span to just the identifier.
2018-12-31Improve type mismatch error messagesYuning Zhang-1/+1
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-25Remove licensesMark Rousskov-347/+76
2018-12-24make non_camel_case_types an early lintAndy Russell-41/+37
2018-11-30Fix bug in matching on floating-point rangesvarkor-7/+1
2018-11-30Update existing tests with more precise error messagesvarkor-3/+9
2018-11-07fix ICEF001-0/+27
2018-10-20Auto merge of #55119 - varkor:unwarned-match-on-never, r=nikomatsakisbors-30/+0
Allow explicit matches on ! without warning It's now possible to explicitly match on `!` without an unreachable code warning. This seems desirable as promoting explicitness. Fixes https://github.com/rust-lang/rust/issues/55116.
2018-10-17Update output for borrowck=migrate compare mode.David Wood-25/+0
This commit updates the test output for the updated NLL compare mode that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The previous commit changes `compiletest` and this commit only updates `.nll.stderr` files.
2018-10-16Remove outdated testvarkor-30/+0
2018-09-01Update testsBasile Desloges-12/+0
2018-08-25Use smaller span for adjustments on block expressionsMatthew Jasper-21/+15
2018-08-14Update former compile-fail testsMatthew Jasper-2/+2
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+1493