Skip to content

Regression on privacy field of struct used in ..some_struct syntax #70323

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
estebank opened this issue Mar 23, 2020 · 3 comments · Fixed by #70331
Closed

Regression on privacy field of struct used in ..some_struct syntax #70323

estebank opened this issue Mar 23, 2020 · 3 comments · Fixed by #70331
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

In a recent PR #69942 I made a change to unify the wording of multiple privacy errors, but accidentally regressed the following case:

error[E0451]: field `secret_uid` of struct `foo::S` is private
  --> $DIR/functional-struct-update-respects-privacy.rs:28:49
   |
LL |     let s_2 = foo::S { b: format!("ess two"), ..s_1 }; // FRU ...
   |                                                 ^^^ private field

used to be

error[E0451]: field `secret_uid` of struct `foo::S` is private
  --> $DIR/functional-struct-update-respects-privacy.rs:28:49
   |
LL |     let s_2 = foo::S { b: format!("ess two"), ..s_1 }; // FRU ...
   |                                                 ^^^ field `secret_uid` is private

This one change needs to be reversed while keeping the rest.

@estebank estebank added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. labels Mar 23, 2020
@mlodato517
Copy link
Contributor

Hi! Could I give this issue a shot?

@jeremystucki
Copy link
Contributor

I am sorry @mlodato517. I forgot to claim the issue

@mlodato517
Copy link
Contributor

No worries :-)

Centril added a commit to Centril/rust that referenced this issue Mar 25, 2020
Increase verbosity when using update syntax with private fields

Resolves rust-lang#70323
@bors bors closed this as completed in d03c02a Mar 25, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants