-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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.A-visibilityArea: Visibility / privacyArea: Visibility / privacyL-private_boundsLint: private_boundsLint: private_boundsL-private_interfacesLint: private_interfacesLint: private_interfacesT-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
We currently have two lints as a part of #48054 - private_interfaces
and private_bounds
, the former being the stronger one.
struct A {}
struct B {}
pub fn leak() -> A // Warning: private_interfaces
where B: Sized // Warning: private_bounds
{
A {}
}
The detailed distinction is documented in the RFC, but the general idea is that with private_interfaces
we can get our hands on a value of the private type A
(which will result in a hard error), and with private_bounds
we cannot.
In the effective visibility table it is likely reasonable to make exactly the same distinction - items reachable through interfaces (higher level of reachability), and items that are only reachable through bounds (less reachable).
In particular, the unnameable_types
lint will only want to report types reachable through private interfaces, to reduce false positives.
This is a follow up to #48054.
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.A-visibilityArea: Visibility / privacyArea: Visibility / privacyL-private_boundsLint: private_boundsLint: private_boundsL-private_interfacesLint: private_interfacesLint: private_interfacesT-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.