-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: error messages could do better at telling me why something is private #13641
Comments
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Apr 20, 2014
This gives a better NOTE error message when a privacy error is encountered with a static method. Previously no note was emitted (due to lack of support), but now a note is emitted indicating that the struct/enum itself is private. Closes rust-lang#13641
bors
added a commit
that referenced
this issue
Apr 20, 2014
This gives a better NOTE error message when a privacy error is encountered with a static method. Previously no note was emitted (due to lack of support), but now a note is emitted indicating that the struct/enum itself is private. Closes #13641
I was probably thinking of #13422 when I wrote that. (There are probably many places where it is hard to tell what the source of non-pubness is...) |
It's true that there's a bunch of cases, but I'd love to know about missing ones like this! |
Manishearth
pushed a commit
to Manishearth/rust
that referenced
this issue
Nov 23, 2022
…ring, r=Veykril fix: format expression parsing edge-cases - Handle positional arguments with formatting options (i.e. `{:b}`). Previously copied `:b` as an argument, producing broken code. - Handle indexed positional arguments (`{0}`) ([reference](https://doc.rust-lang.org/std/fmt/#positional-parameters)). Previously copied over `0` as an argument. Note: the assist also breaks when named arguments are used (`"{name}$0", name = 2 + 2` is converted to `"{}"$0, name`. I'm working on fix for that as well.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Nov 7, 2024
…ntri3 needless_continue: check labels consistency before warning changelog: [`needless_continue`]: check labels before warning about `continue` as the last statement in a loop body Fix rust-lang#13641
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this code:
When I run rustc today:
The reason that
new
is inaccessible, AFAICT, is becauseFoo
is private. However, this is not really relayed in the error message; my first instinct is to look at the definition ofnew
itself, which has been declaredpub
.(I had thought there was a related bug filed somewhere about saying that if something is private due to an intermediate non-pub mod along a chain, we could do a better job of pointing the user at one or more of the non-pub mods that would need to be made
pub
. Obviously that's not perfect since an item may be accessible via more than one path, and so any such suggestion coukd be misleading. But I could not find that related bug. Anyway, the situation today is not ideal.)The text was updated successfully, but these errors were encountered: