Skip to content
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

Merged
merged 1 commit into from Aug 12, 2016
Merged

Conversation

circuitfox
Copy link
Contributor

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 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).

@rust-highfive
Copy link
Collaborator

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.

@sophiajt
Copy link
Contributor

Looks good!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 10, 2016

📌 Commit c5f9feb has been approved by jonathandturner

@@ -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"));
Copy link
Contributor

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?

Copy link
Contributor

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.

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 11, 2016
…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).
bors added a commit that referenced this pull request Aug 11, 2016
@bors bors merged commit c5f9feb into rust-lang:master Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants