Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider checking constants in public interfaces for privacy #30475

Closed
petrochenkov opened this issue Dec 19, 2015 · 3 comments
Closed

Consider checking constants in public interfaces for privacy #30475

petrochenkov opened this issue Dec 19, 2015 · 3 comments
Labels
A-typesystem Area: The type system

Comments

@petrochenkov
Copy link
Contributor

I.e. making something like

const PRIV: usize = 10;
pub fn f() -> [u8; PRIV] { ... };

a privacy error/warning.

Some discussion in #29973 (comment) and below.
There are unresolved questions - what exactly should be checked - all signatures, all signatures except for constant initializers, const function bodies?

@petrochenkov
Copy link
Contributor Author

Personally, I don't think it's a good idea to make this a language rule, maybe a lint at best, due to leaky nature of this restriction (it gives no useful guarantees).

@steveklabnik steveklabnik added the A-typesystem Area: The type system label Jun 6, 2016
@petrochenkov
Copy link
Contributor Author

@nikomatsakis
I think this can be closed now as not fitting into the privacy model and too breaking to change.

@nikomatsakis
Copy link
Contributor

Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

3 participants