-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
I wrote some code for a rustc test which intentionally hits the recursion limit while trying to autoderef from &Top
to &Bottom
.
In nightly the error when autoderef hits the recursion limit is printed twice. The second time it is printed without a real span.
Stable and beta:
rustc 1.14.0 (e8a012324 2016-12-16)
error[E0055]: reached the recursion limit while auto-dereferencing I
--> <anon>:60:22
|
60 | let x: &Bottom = &t;
| ^^ deref recursion limit reached
error[E0308]: mismatched types
--> <anon>:60:22
|
60 | let x: &Bottom = &t;
| ^^ expected struct `Bottom`, found struct `Top`
|
= note: expected type `&Bottom`
= note: found type `&Top`
error: aborting due to 2 previous errors
Nightly:
error[E0055]: reached the recursion limit while auto-dereferencing I
--> xx.rs:60:22
|
60 | let x: &Bottom = &t;
| ^^ deref recursion limit reached
error[E0055]: reached the recursion limit while auto-dereferencing I
error[E0308]: mismatched types
--> xx.rs:60:22
|
60 | let x: &Bottom = &t;
| ^^ expected struct `Bottom`, found struct `Top`
|
= note: expected type `&Bottom`
= note: found type `&Top`
error: aborting due to 3 previous errors
It's clearer to see with --error-format=json
that the second error has a dummy span attached: https://gist.github.com/durka/04031f5701b5740f0f413267fc913e87
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.