-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-non_exhaustive_omitted_patterns_lint`#![feature(non_exhaustive_omitted_patterns_lint)]``#![feature(non_exhaustive_omitted_patterns_lint)]`T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
I tried this code:
#![feature(non_exhaustive_omitted_patterns_lint)]
#![warn(non_exhaustive_omitted_patterns)]
use std::sync::atomic::Ordering; // #[non_exhaustive] enum
pub fn is_seqcst(order: Ordering) -> bool {
matches!(order, Ordering::SeqCst)
}
I expected to see this happen: no warning
Instead, this happened:
warning: some variants are not matched explicitly
--> src/lib.rs:7:14
|
7 | matches!(order, Ordering::SeqCst)
| ^^^^^ patterns `std::sync::atomic::Ordering::Relaxed`, `std::sync::atomic::Ordering::Release`, `std::sync::atomic::Ordering::Acquire` and 1 more not covered
|
= help: ensure that all variants are matched explicitly by adding the suggested match arms
= note: the matched value is of type `std::sync::atomic::Ordering` and the `non_exhaustive_omitted_patterns` attribute was found
Meta
rustc --version --verbose
:
rustc 1.75.0-nightly (2f1bd0729 2023-10-27)
binary: rustc
commit-hash: 2f1bd0729b74787f55d4cbc7818cfd787cd43a99
commit-date: 2023-10-27
host: aarch64-apple-darwin
release: 1.75.0-nightly
LLVM version: 17.0.3
@rustbot label +F-non_exhaustive_omitted_patterns_lint
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-non_exhaustive_omitted_patterns_lint`#![feature(non_exhaustive_omitted_patterns_lint)]``#![feature(non_exhaustive_omitted_patterns_lint)]`T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.