about summary refs log tree commit diff
path: root/src/test/ui/uninhabited
AgeCommit message (Collapse)AuthorLines
2021-02-06path trimming: ignore type aliasesDan Aloni-3/+3
2021-01-03Add note on void reference testDaniel Noom-0/+1
This test is also changed by adding a note about uninhabited references still counting as inhabited.
2020-09-01Permit uninhabited enums to cast into intsMark Rousskov-10/+3
This essentially reverts part of #6204.
2020-07-27mv std libs to library/mark-3/+3
2020-06-15Tweak "non-primitive cast" errorEsteban Küber-3/+1
- Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-12/+7
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+8
2020-03-23Ignore tests on some platforms due to #53081Aaron Hill-7/+12
2020-03-22Store idents for `DefPathData` into crate metadataAaron Hill-0/+15
Previously, we threw away the `Span` associated with a definition's identifier when we encoded crate metadata, causing us to lose location and hygiene information. We now store the identifier's `Span` in the crate metadata. When we decode items from the metadata, we combine the name and span back into an `Ident`. This improves the output of several tests, which previously had messages suppressed due to dummy spans. This is a prerequisite for #68686, since throwing away a `Span` means that we lose hygiene information.
2020-01-24Normalise notes with the/isvarkor-1/+1
2020-01-18slice_patterns: remove gates in testsMazdak Farrokhzad-1/+1
2019-12-22Remove mem::uninitalized from testsMark Rousskov-14/+17
This purges uses of uninitialized where possible from test cases. Some are merely moved over to the equally bad pattern of MaybeUninit::uninit().assume_init() but with an annotation that this is "the best we can do".
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-7/+9
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-12-04Forgot to update some test outputsNadrieril-0/+3
2019-11-21Remove `#![feature(never_type)]` from tests.Mazdak Farrokhzad-9/+7
Also remove `never_type` the feature-gate test.
2019-11-05Make exhaustiveness error message more consistent for slice patternsNadrieril-2/+2
This improves error messages by indicating when slices above a certain lengths have not been matched. Previously, we would only report examples of such lengths, but of course never all of them.
2019-10-27Gather together usefulness testsNadrieril-51/+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-15Organize `never_type` testsMazdak Farrokhzad-0/+51
Also move {run-fail -> ui}/never_type
2019-10-09Suggest `if let` on `let` refutable bindingEsteban Küber-0/+14
2019-09-09check_match: unify check_irrefutable & check_exhaustive more.Mazdak Farrokhzad-0/+1
2019-07-05Remove never_type feature requirement for exhaustive patternsMarcel Hellwig-0/+9
2019-07-04Permit use of mem::uninitialized via allow(deprecated)Mark Rousskov-7/+9
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-1/+1
2019-04-22Remove double trailing newlinesvarkor-2/+0
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+1
2019-03-11Update testsVadim Petrochenkov-12/+12
2019-03-02Point at enum definition when match patterns are not exhaustiveEsteban Küber-17/+19
``` 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-58/+18
2018-12-11Update testsvarkor-2/+2
2018-12-11Restore old match behaviourvarkor-3/+27
2018-12-11Make liveness analysis respect privacyvarkor-2/+3
2018-12-11Add privately uninhabited dead code testvarkor-0/+19
2018-12-11Update uninhabited matches testsvarkor-27/+3
2018-11-20Enclose type in backticks for "non-exhaustive patterns" errorvarkor-3/+3
This makes the error style consistent with the convention in error messages.
2018-11-03Make "all possible cases" help message uniform with existing help messagesvarkor-3/+3
Specifically no capitalisation or trailing full stops.
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+280