-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
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.L-false-negativeLint: False negative (should have fired but didn't).Lint: False negative (should have fired but didn't).L-private_boundsLint: private_boundsLint: private_boundsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
#![allow(unused)]
struct Type<T>(T);
trait PubTrait {}
mod a {
trait PrivTrait {}
impl<T: PrivTrait> super::PubTrait for super::Type<T> {}
}
Current output
None
Desired output
private_bounds warning
Rationale and extra context
The T: PrivTrait
bound is more private than both PubTrait
and Type
, so that should give a warning.
Other cases
Rust Version
rustc 1.88.0-nightly (1799887bb 2025-03-29)
binary: rustc
commit-hash: 1799887bb281d1ab49287750f1950b8c738c6b77
commit-date: 2025-03-29
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.1
Anything else?
No response
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.L-false-negativeLint: False negative (should have fired but didn't).Lint: False negative (should have fired but didn't).L-private_boundsLint: private_boundsLint: private_boundsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.