-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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-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
I tried this code:
pub use self::stuff::Trait1;
mod stuff {
pub trait Trait1 {
type Thing: Trait2;
}
// This triggers it:
// pub(crate) trait Trait2 {}
// This doesn't:
pub trait Trait2 {}
}Playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=3c1b275b4ccc88b9111b9780ee330916
I expected to see this happen: the private_bounds lint triggers
Instead, this happened: the lint does not trigger - to make it trigger I must mark the second trait pub(crate)
Meta
rustc --version --verbose:
rustc 1.87.0-nightly (f04bbc60f 2025-02-20)
binary: rustc
commit-hash: f04bbc60f8c353ee5ba0677bc583ac4a88b2c180
commit-date: 2025-02-20
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0
<backtrace>
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-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.