Skip to content

rustc doesn't forbid unnecessary visibility specifiers on view items #9957

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

Closed
sfackler opened this issue Oct 19, 2013 · 2 comments · Fixed by #11607
Closed

rustc doesn't forbid unnecessary visibility specifiers on view items #9957

sfackler opened this issue Oct 19, 2013 · 2 comments · Fixed by #11607
Milestone

Comments

@sfackler
Copy link
Member

Things like this are not rejected by the compiler, though the probably should be

priv extern mod foo;
pub extern mod foo;

priv use foo;

pub extern mod foo could make sense if it exported foo, but it doesn't currently.

@alexcrichton
Copy link
Member

Nominating. Is pub extern mod a thing which is supported? I personally do not know the answer to that question.

The priv variants should certainly get denied.

@catamorphism
Copy link
Contributor

1.0 backcompat

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 16, 2014
For `use` statements, this means disallowing qualifiers when in functions and
disallowing `priv` outside of functions.

For `extern mod` statements, this means disallowing everything everywhere. It
may have been envisioned for `pub extern mod foo` to be a thing, but it
currently doesn't do anything (resolve doesn't pick it up), so better to err on
the side of forwards-compatibility and forbid it entirely for now.

Closes rust-lang#9957
bors added a commit that referenced this issue Jan 18, 2014
For `use` statements, this means disallowing qualifiers when in functions and
disallowing `priv` outside of functions.

For `extern mod` statements, this means disallowing everything everywhere. It
may have been envisioned for `pub extern mod foo` to be a thing, but it
currently doesn't do anything (resolve doesn't pick it up), so better to err on
the side of forwards-compatibility and forbid it entirely for now.

Closes #9957
bors added a commit that referenced this issue Jan 18, 2014
For `use` statements, this means disallowing qualifiers when in functions and
disallowing `priv` outside of functions.

For `extern mod` statements, this means disallowing everything everywhere. It
may have been envisioned for `pub extern mod foo` to be a thing, but it
currently doesn't do anything (resolve doesn't pick it up), so better to err on
the side of forwards-compatibility and forbid it entirely for now.

Closes #9957
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 1, 2022
Don't cross contexts while building the suggestion for `redundant_closure_call`

fixes rust-lang#9957

changelog: `redundant_closure_call`: Don't cross macro contexts while building the suggestion
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

Successfully merging a pull request may close this issue.

3 participants