Skip to content

non_exhaustive_omitted_patterns is missing span #109837

Closed
@Noratrieb

Description

@Noratrieb

Currently, I get the following error message:

error: some variants are not matched explicitly
   |
note: the lint level is defined here
  --> selene-lib/src/rules/high_cyclomatic_complexity.rs:77:14
   |
77 |         deny(non_exhaustive_omitted_patterns)
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: ensure that all variants are matched explicitly by adding the suggested match arms
   = note: the matched value is of type `full_moon::ast::Value` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
  |
  = help: ensure that all variants are matched explicitly by adding the suggested match arms
  = note: the matched value is of type `full_moon::ast::Expression` and the `non_exhaustive_omitted_patterns` attribute was found

error: some variants are not matched explicitly
    |
note: the lint level is defined here
   --> selene-lib/src/rules/high_cyclomatic_complexity.rs:180:18
    |
180 |             deny(non_exhaustive_omitted_patterns)
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: ensure that all variants are matched explicitly by adding the suggested match arms
    = note: the matched value is of type `full_moon::ast::Stmt` and the `non_exhaustive_omitted_patterns` attribute was found

error: could not compile `selene-lib` due to 3 previous errors

This error message is correct, but not helpful, and confused the person writing the pull request who hit this issue. It does not show what the variants are or where the match is. I would file a repro but I'm fairly sure non_exhaustive is ignored in the same crate, so it would not be doable on playground.

Originally posted by @Kampfkarren in #89554 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.F-non_exhaustive_omitted_patterns_lint`#![feature(non_exhaustive_omitted_patterns_lint)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions