summary refs log tree commit diff
path: root/src/test/ui/empty
AgeCommit message (Collapse)AuthorLines
2022-06-16diagnostics: fix trailing spaceklensy-2/+2
2022-05-15rustc: Stricter checking for #[link] attributesVadim Petrochenkov-4/+4
2022-03-28Remove duplicated and unused test filesCaio-0/+36
2022-03-08Suggest `if let`/`let_else` for refutable pat in `let`Esteban Kuber-1/+5
2022-03-08Rollup merge of #94580 - xFrednet:55112-only-reason-in-lint-attr, r=lcnrMatthias Krüger-9/+20
Emit `unused_attributes` if a level attr only has a reason Fixes a comment from `compiler/rustc_lint/src/levels.rs`. Lint level attributes that only contain a reason will also trigger the `unused_attribute` lint. The lint now also checks for the `expect` lint level. That's it, have a great rest of the day for everyone reasoning this :upside_down_face: cc: #55112
2022-03-08Point at uncovered variants in enum definition in `note` instead of a ↵Esteban Kuber-10/+9
`span_label` This makes the order of the output always consistent: 1. Place of the `match` missing arms 2. The `enum` definition span 3. The structured suggestion to add a fallthrough arm
2022-03-03Emit `unused_attributes` if a level attr only has a reasonxFrednet-9/+20
2021-11-22Auto merge of #88681 - ehuss:duplicate-attributes, r=petrochenkovbors-0/+77
Check for duplicate attributes. This adds some checks for duplicate attributes. In many cases, the duplicates were being ignored without error or warning. This adds several kinds of checks (see `AttributeDuplicates` enum). The motivation here is to issue unused warnings with similar reasoning for any unused lint, and to error for cases where there are conflicts. This also adds a check for empty attribute lists in a few attributes where this causes the attribute to be ignored. Closes #55112.
2021-11-18Add checks for more empty attributes.Eric Huss-0/+77
2021-11-16Suggest removal of arguments for unit variant, not replacementEsteban Kuber-4/+6
2021-10-17Rollup merge of #89963 - r00ster91:parenthesisparentheses, r=nagisaMatthias Krüger-2/+2
Some "parenthesis" and "parentheses" fixes "Parenthesis" is the singular (e.g. one `(` or one `)`) and "parentheses" is the plural (multiple `(` or `)`s) and this is not hard to mix up so here are some fixes for that. Inspired by #89958
2021-10-17Some "parenthesis" and "parentheses" fixesr00ster91-2/+2
2021-10-15Bless testsCameron Steffen-1/+1
2021-08-11Modify structured suggestion outputEsteban Küber-38/+38
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-18/+18
2021-05-02add suggestion for unit enum variant when matched with a paternAliénore Bouttefeux-16/+86
2021-01-13Update tests for extern block lintingMark Rousskov-2/+1
2020-09-30Re-run tests with --blessTemirkhan Myrzamadi-0/+3
2020-08-11Detect tuple variants used as struct pattern and suggest correct patternEsteban Küber-5/+11
2020-08-10Point at item definition in foreign cratesEsteban Küber-7/+27
2020-08-10Tweak ordering of suggestionsEsteban Küber-36/+76
Modify logic to make it easier to follow and recover labels that would otherwise be lost.
2020-07-14Suggest struct pat on incorrect unit or tuple patEsteban Küber-82/+108
When encountering a unit or tuple pattern for a struct-like item, suggest using the correct pattern. Use `insert_field_names_local` when evaluating variants and store field names even when the list is empty in order to produce accurate structured suggestions.
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+1
2020-02-01Update existing tests for or-patternsMatthew Jasper-10/+2
2020-01-11Auto merge of #65912 - estebank:variants-orig, r=petrochenkovbors-0/+90
Point at the span for the definition of crate foreign ADTs Follow up to #65421. Partially addresses #65386. Blocked on #53081.
2020-01-10Point at the span for the definition of crate foreign ADTsEsteban Küber-0/+90
2020-01-08Unify output of "variant not found" errorsEsteban Küber-6/+6
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-2/+4
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-11-21Remove `#![feature(never_type)]` from tests.Mazdak Farrokhzad-4/+2
Also remove `never_type` the feature-gate test.
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-61/+69
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+2
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-09Suggest `if let` on `let` refutable bindingEsteban Küber-0/+7
2019-09-22Point at definition when misusing ADTEsteban Küber-2/+32
When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-21unify errors for tuple/struct variantsGuanqun Lu-3/+4
fix #63983
2019-09-15resolve: Remove `!` from "cannot find" diagnostics for macrosVadim Petrochenkov-1/+1
2019-09-09check_match: unify check_irrefutable & check_exhaustive more.Mazdak Farrokhzad-0/+1
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-3/+3
2019-08-05Make use of possibly uninitialized data a hard errorTyler Mandry-32/+3
This is one of the behaviors we no longer allow in NLL. Since it can lead to undefined behavior, I think it's definitely worth making it a hard error without waiting to turn off migration mode (#58781). Closes #60450. My ulterior motive here is making it impossible to leave variables partially initialized across a yield (see discussion at #63035), so tests are included for that.
2019-07-19normalize use of backticks in compiler messages for librustc_metadataSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-05-21Add FAQ for NLL migrationJethro Beekman-0/+1
2019-05-12Change compare mode to use -Zborrowck=mirMatthew Jasper-0/+23
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-1/+14
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-2/+2
2019-04-09improve unknown enum variant errorsAndy Russell-9/+17
2019-03-23Tweak spans for E0599Esteban Küber-8/+8
2019-03-11Update testsVadim Petrochenkov-24/+24
2019-03-02Point at enum definition when match patterns are not exhaustiveEsteban Küber-2/+9
``` 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-01-20Use structured suggestion in stead of notesEsteban Küber-6/+4
2019-01-09clarify resolve typo suggestionAndy Russell-18/+18
Include the kind of the binding that we're suggesting, and use a structured suggestion.
2018-12-26Fixed more tests.Alexander Regueiro-6/+10