Open
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.