You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
…t, r=jonathandturner
E0072 update error format
Part of rust-lang#35233Fixesrust-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).
Uh oh!
There was an error while loading. Please reload this page.
From: src/test/compile-fail/E0072.rs
Error E0072 needs a span_label, updating it from:
To:
Bonus: put the span on the name of the struct:
The text was updated successfully, but these errors were encountered: