Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upInferred types should be checked for privacy violations #30476
Comments
petrochenkov
referenced this issue
Dec 20, 2015
Merged
privacy: Rewrite VisiblePrivateTypesVisitor #29973
petrochenkov
referenced
this issue
in jseyfried/rfcs
Feb 17, 2016
deadalusai
referenced this issue
May 7, 2016
Closed
"Private" impl functions can leak out of a module when defined on a public type #33479
steveklabnik
added
the
A-typesystem
label
Jun 6, 2016
petrochenkov
referenced this issue
Nov 10, 2016
Open
Tracking issue for `private_in_public` compatibility lint. #34537
jseyfried
self-assigned this
Dec 22, 2016
jseyfried
referenced this issue
Dec 22, 2016
Merged
Use `DefId`s instead of `NodeId`s for `pub(restricted)` visibilities #38490
petrochenkov
self-assigned this
Feb 19, 2017
jseyfried
referenced this issue
Mar 31, 2017
Merged
Initial implementation of declarative macros 2.0 #40847
bors
added a commit
that referenced
this issue
Jun 5, 2017
bors
added a commit
that referenced
this issue
Jun 19, 2017
bors
added a commit
that referenced
this issue
Jul 7, 2017
bors
closed this
in
#42125
Jul 7, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
petrochenkov commentedDec 19, 2015
In this example:
[]andNoneare inferred to be values of private types[Priv; 0]andOption<Priv>.(Some more examples can be found in https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919)
Privacy checker and "private-in-public" checker try hard to ensure the guarantee, that values of private types can't be obtained outside of their modules. If inferred types are checked for privacy, then this guarantee can actually be made strict.
One reason why this guarantee is useful, is because link time visibility is based on the language privacy, so it gives a way to reduce the number of methods visible from our libraries to outside.