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 needs to be updated to new format #35506

Closed
sophiajt opened this issue Aug 8, 2016 · 2 comments
Closed

E0072 needs to be updated to new format #35506

sophiajt opened this issue Aug 8, 2016 · 2 comments

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 8, 2016

From: src/test/compile-fail/E0072.rs

Error E0072 needs a span_label, updating it from:

error[E0072]: recursive type `ListNode` has infinite size
  --> src/test/compile-fail/E0072.rs:11:1
   |
11 | struct ListNode { //~ ERROR E0072
   | ^
   |
   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable

error: aborting due to previous error

To:

error[E0072]: recursive type `ListNode` has infinite size
  --> src/test/compile-fail/E0072.rs:11:1
   |
11 | struct ListNode { //~ ERROR E0072
   | ^ recursive type has infinite size
   |
   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable

error: aborting due to previous error

Bonus: put the span on the name of the struct:

error[E0072]: recursive type `ListNode` has infinite size
  --> src/test/compile-fail/E0072.rs:11:1
   |
11 | struct ListNode { //~ ERROR E0072
   |        ^^^^^^^^ recursive type has infinite size
   |
   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable

error: aborting due to previous error
@creativcoder
Copy link
Contributor

I'd like to work on this.

@sophiajt
Copy link
Contributor Author

sophiajt commented Aug 9, 2016

@creativcoder - Looks like @circuitfox has already taken this one. There are some other free ones on the list if you're interested.

sophiajt pushed a commit to sophiajt/rust that referenced this issue 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).
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

No branches or pull requests

2 participants