-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tweak short_ty_string
to reduce number of files
#118389
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
err.span_label( | ||
span, | ||
format!( | ||
"the trait `{}` is not implemented for `{}`", | ||
old_pred.print_modifiers_and_trait_path(), | ||
old_pred.self_ty().skip_binder(), | ||
self.tcx.short_ty_string(old_pred.self_ty().skip_binder(), &mut file), |
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.
Why introduce short_ty_string
here? I'm not sure that the lifetime bounds we get with this change are really preferable.
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.
Although I agree that the prior output is likely "better", if we let the full type leak anywhere we have the real risk of ending up with a "wall of text" in some case. We could as a follow up change it so short_ty_string
has the same output we had prior instead.
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.
But did you really handle all occurrences where types are printed in diagnostics in this PR? I would have expected many more changes in the diffs in the tests if that was the case. And if you haven't, I find this change kind of arbitrary.
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.
@b-naber I addressed all that I could find searching the codebase. There are many that we had already handled and this was an effort to find any stragglers.
2a5c5eb
to
5fb1782
Compare
Thanks for clarifying. This looks good to me. r=me |
When shortening types and writing them to disk, make `short_ty_string` capable of reusing the same file, instead of writing a file per shortened type.
5fb1782
to
9d846fc
Compare
@bors r=b-naber |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5f73b00): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.988s -> 673.133s (0.17%) |
When shortening types and writing them to disk, make
short_ty_string
capable of reusing the same file, instead of writing a file per shortened type.