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

Privacy, stability etc. are not respected in imports with empty braces #28388

Closed
petrochenkov opened this issue Sep 13, 2015 · 4 comments
Closed

Comments

@petrochenkov
Copy link
Contributor

use std::rt::{};

should warn that std::rt is unstable, but it doesn't.

mod m {
    mod n {}
}

use m::n::{};

should be caught by privacy checker, but it isn't.

See #28364 (comment) for some details.

@petrochenkov
Copy link
Contributor Author

In fact, almost no checks are performed on the prefix, even

use foo::bar::baz::{};
fn main() {}

compiles successfully.
I think, instead of trying to resolve the prefix we could just prohibit empty braces in imports - this construction is useless to the limit, it can't even be obtained as a result of macro expansion.

@alexispurslane
Copy link
Contributor

instead of trying to resolve the prefix we could just prohibit empty braces in imports - this construction is useless to the limit

I agree whole heartedly.

@alexispurslane
Copy link
Contributor

Should I try to make empty braces disallowed? But I think that would need an RFC or at least approval from someone else.

@nagisa
Copy link
Member

nagisa commented Sep 14, 2015

Needs RFC. There’s at least a few things impl-wise to be considered here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants