-
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
E0072 update error format #35576
E0072 update error format #35576
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonathandturner (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. |
Looks good! @bors r+ rollup |
📌 Commit c5f9feb has been approved by |
@@ -654,6 +654,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { | |||
let mut err = struct_span_err!(self.sess, span, E0072, | |||
"recursive type `{}` has infinite size", | |||
self.item_path_str(type_def_id)); | |||
err.span_label(span, &format!("recursive type has infinite size")); |
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.
Seems like the call to format!
is unnecessary?
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.
it's not technically required here, though harmless.
…t, r=jonathandturner E0072 update error format Part of rust-lang#35233 Fixes rust-lang#35506 r? @jonathandturner The bonus for this issue currently seems to be impossible to do reliably, as the compiler seems to lack span information for item names alone, like `Foo` in `struct Foo { ... }`. It would be possible to hack something together by computing span offsets, but that seems like a solution that would be begging for trouble. A proper solution to this would, of course, be to add span information to the right place (seems to be `rustc::hir::Item::name` but I may be wrong).
Part of #35233
Fixes #35506
r? @jonathandturner
The bonus for this issue currently seems to be impossible to do reliably, as the compiler seems to lack span information for item names alone, like
Foo
instruct Foo { ... }
. It would be possible to hack something together by computing span offsets, but that seems like a solution that would be begging for trouble.A proper solution to this would, of course, be to add span information to the right place (seems to be
rustc::hir::Item::name
but I may be wrong).