-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Note message after error recommends using inaccessible private fields. #27654
Comments
That's unfortunate. We should be able filter out fields that aren't accessible due to privacy though. |
@Nashenas88 IIRC, the privacy check is really simple, but the privacy checker pass needs to be ported to use the parent IDs found in the |
@eddyb, I didn't have too much time to play around with the privacy checker pass this weekend, but I did try to port it to use the parent IDs in the |
@Nashenas88 the ast_map is a forest, with the roots being either the local crate, or inlined items. |
I guess the doc comment on |
Triage; no change |
Do not recommend private fields called as method ```rust error: no method named `dog_age` found for type `animal::Dog` in the current scope --> $DIR/private-field.rs:26:23 | 26 | let dog_age = dog.dog_age(); | ^^^^^^^ private field, not a method ``` Fix rust-lang#27654.
Do not recommend private fields called as method ```rust error: no method named `dog_age` found for type `animal::Dog` in the current scope --> $DIR/private-field.rs:26:23 | 26 | let dog_age = dog.dog_age(); | ^^^^^^^ private field, not a method ``` Fix rust-lang#27654.
Do not recommend private fields called as method ```rust error: no method named `dog_age` found for type `animal::Dog` in the current scope --> $DIR/private-field.rs:26:23 | 26 | let dog_age = dog.dog_age(); | ^^^^^^^ private field, not a method ``` Fix rust-lang#27654.
The following code:
Outputs the following message:
However, correcting the code by following the note message causes the following output:
I would expect the private field to not be recommended.
The text was updated successfully, but these errors were encountered: