-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Inconsistent privacy of methods of orphan non-trait impls #16398
Labels
A-visibility
Area: Visibility / privacy
Comments
This is fixed by #17163, recommend close. |
Thanks @apoelstra! |
@apoelstra But the behaviour has not changed, if I cargo check it today:
Removing the two private calls makes the code compile. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 21, 2024
`cargo clippy --fix` This PR is the result of running `cargo clippy --fix && cargo fmt` in the root of the repository. I did not manually review all the changes, but just skimmed through a few of them. The tests still pass, so it seems fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compilation fails with
(Removing those two
.private
calls compiles fine.)This is inconsistent because:
private
is only accessible insidebar
, i.e. being private means it is being scoped with the modulepublic
is accessible everywhere despitebar
being private (if it were a freestanding function, one could only callfoo::bar::public
insidefoo
, not insidemain
); i.e. it appears to be being scoped with the typeI would expect both
pub
and non-pub
methods to have the same scoping either both with the type (sofoo
and any descendants can callprivate
, as well asmain
callingpublic
), or both with the module (somain
cannot callpublic
).The text was updated successfully, but these errors were encountered: