rust-lang / rust-lang/rust-clippy
`enum_glob_use` suggestion doesn't match docs
Open
@Souradip121 is already working on this.
Since May 2, 2026.
C-bug
L-suggestion
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
Summary
The suggestion emitted by the enum_glob_use lint does not align with its documented guidance. The lint recommends importing enum variants into scope, whereas the documentation indicates that using fully qualified (prefixed) variant names is the preferred approach.
Context: https://github.com/pendulum-project/ntpd-rs/commit/48ea93ee39258c78310f9edcae2ef11f646322fe
Reproducer: https://rust.godbolt.org/z/9618T4s9v
Reproducer
I tried this code:
pub enum Foo {
A,
B,
}
use Foo::*;
pub fn main() {
let _ = A;
}
I expected to see this happen:
pub fn main() {
let _ = Foo::A;
}
Instead, this happened:
use Foo::A;
pub fn main() {
let _ = A;
}
Version
nightly
Additional Labels
@rustbot label +L-suggestion
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.