]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #76499 - guswynn:priv_des, r=petrochenkov
authorbors <bors@rust-lang.org>
Fri, 11 Sep 2020 20:01:31 +0000 (20:01 +0000)
committerbors <bors@rust-lang.org>
Fri, 11 Sep 2020 20:01:31 +0000 (20:01 +0000)
commitbc57bd8c7e3e28f8bed4fced3973bfe04949918f
tree372467744979f76c18d225ac97010656bd524875
parent141bb23be863f8bfe25ccac102c6e7b96b61d417
parentc63f634a4b0550a398d5bf08f8b036edaf67c48d
Auto merge of #76499 - guswynn:priv_des, r=petrochenkov

Give better diagnostic when using a private tuple struct constructor

Fixes #75907

Some notes:
1. This required some deep changes, including removing a Copy impl for PatKind. If some tests fail, I would still appreciate review on the overall approach
2. this only works with basic patterns (no wildcards for example), and fails if there is any problems getting the visibility of the fields (i am not sure what the failure that can happen in resolve_visibility_speculative, but we check the length of our fields in both cases against each other, so if anything goes wrong, we fall back to the worse error. This could be extended to more patterns
3. this does not yet deal with #75906, but I believe it will be similar
4. let me know if you want more tests
5. doesn't yet at the suggestion that `@yoshuawuyts` suggested at the end of their issue, but that could be added relatively easily (i believe)
compiler/rustc_resolve/src/build_reduced_graph.rs
compiler/rustc_resolve/src/late.rs
compiler/rustc_resolve/src/late/diagnostics.rs
compiler/rustc_resolve/src/lib.rs