-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Give better diagnostic when using a private tuple struct constructor #76499
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I'd be interested whether this affects perf. |
@jyn514 I think the clones are the same as the original Copy's, but not sure, is there a way to queue a perf check? |
Yes, but I'd prefer not to until someone familiar with this part of the compiler agrees this is the right approach (the perf server has a tendency to fall behind master if you queue too many builds). |
There's currently only one job in the perf queue, so I think it should be fine. Also, the total perf job running time was decreased last month in rust-lang/rustc-perf#740, and I haven't seen the perf queue growing out of control since them. @bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit b1075c6eae2da6f043d333bf99985120850efda0 with merge 1e1632e45f7c9ad03e2e1c4a32e81de6019cf26f... |
Oh nice, I didn't realize perf was no longer running script-servo :) |
☀️ Try build successful - checks-actions, checks-azure |
Queued 1e1632e45f7c9ad03e2e1c4a32e81de6019cf26f with parent 90782cb, future comparison URL. |
Finished benchmarking try commit (1e1632e45f7c9ad03e2e1c4a32e81de6019cf26f): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
Perf results look like noise, it says max-rss went down but since you added more fields here that can't be right. |
This PR hides the correct error that attempts to teach you the actual language rules ("private fields make the constructor private") and masks it with something plausibly looking, but not really correct. |
It would be better to keep the current primary message and add a note to it with a multi-span pointing to those private fields that it mentions. |
Genuinely astounded that adding 'a: 'ast bounds in 3 places resolved the errors i got, that said, i suppose nothing lives longer than the ast |
ba13651
to
433b50f
Compare
@estebank do you think it will be not too noisy to add a span_label for every private field? Other than question, your idea to make a multispan from the span's, label them, add a note, and set the span and then instead of set_primary_message, use span_note |
@@ -796,6 +796,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { | |||
vis | |||
}; | |||
|
|||
let mut ret_fields = vec![]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut ret_fields = vec![]; | |
let mut field_visibilities = Vec::with_capacity(vdata.fields().len()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not addressed yet.
This doesn't work cross-crate :((( I added a test that shows that Not sure what I should do to resolve that |
I'll try to check what can be done in the cross-crate case, but it's better done in a separate PR. |
@guswynn I think that the new output looks reasonable and informative.
+100 |
r=me after addressing the remaining nits (#76499 (comment), #76499 (comment)) and squashing commits. |
@petrochenkov thank you so much for the detailed review and help on the most complicated rust-lang/rust pr I have ever done! |
Thanks! |
📌 Commit c63f634 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Fixes #75907
Some notes: