-
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
Diagnostic regression (1.47 -> 1.48): public enum fields incorrectly described as "inaccessible fields". #79593
Comments
I would also suspect #78077. |
I ran into this too, but I couldn't make a repro. Thanks eddyb! |
P-high: I've run into this a bunch of times and I imagine others have too. It's really annoying and confusing, likely even more so for newcomers! |
searched nightlies: from nightly-2020-08-01 to nightly-2020-10-15 bisected with cargo-bisect-rustc v0.6.0Host triple: x86_64-apple-darwin cargo bisect-rustc --preserve --prompt --start=2020-08-01 --end=2020-10-15 |
Update: I've been reading the source code and print-debugging and I think the issue was not introduced in either of those two PRs, but rather that they surfaced a pre-existing issue. |
Well, it took a while, but I think I fixed it! |
Does this necessitate a 1.48.1 release or shall I wait for 1.49? |
@Hussamt it will be in 1.50 unless backported: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#choo-choo-release-channels-and-riding-the-trains |
On Sun, 2020-12-13 at 11:04 -0800, Joshua Nelson wrote:
@Hussamt it will be in 1.50 unless backported:
https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#choo-choo-release-channels-and-riding-the-trains
Ok. Thank you for the quick reply.
|
Test example (try on playground):
Only
foo::Pub {}
in the top levelcorrect
should say "cannot construct ... due to inaccessible fields", the other 3 errors should be "missing field ... in initializer", but it seems like it's treating theenum
field as private (even though it inheritspub
from theenum
).The "cannot construct ... due to inaccessible fields" error seems to be new in 1.48, as part of #76524, and unmodified since.
It's using
field.vis.is_accessible_from(...)
which seems correct, but it's possibleenum
fields are incapable of giving the right result, if they don't track theenum
's own privacy (and they only know they inherit it, whatever it is).cc @davidtwco @estebank
The text was updated successfully, but these errors were encountered: