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

Assert well-formedness of spans #47504

Open
estebank opened this issue Jan 16, 2018 · 7 comments
Open

Assert well-formedness of spans #47504

estebank opened this issue Jan 16, 2018 · 7 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

estebank commented Jan 16, 2018

rustc currently has peppered throughout the codebase some checks for "backwards spans", spans where their end is earlier than their start. I believe that the current approach of actively checking for this and not fail is very reasonable in beta and stable rustc, but in nightly builds I would like to have an assertion so that we expose this incorrectly formatted spans so that the underlying cause can be fixed.

This might take the form of a simple assert and ICEing (not my preference, but it would certainly bring attention to the problem) to generating a diagnostic error and emitting it, allowing the compiler to continue working, but making the problem visible to anyone using the nightly compiler, with text prompting a report in this issue tracker. If we go down the later route, it probably should be a warning, so that anyone using the nightly compiler in production isn't stopped from using it due to a rustc bug.

@estebank estebank added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 16, 2018
@Enselic Enselic added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Sep 24, 2023
@mfaqiri
Copy link

mfaqiri commented Oct 14, 2023

@rustbot claim

@ammarbinfaisal
Copy link

I would like to work on this.
Should the assertion be in functions returning a Span or even in functions accepting Spans as arguments?

@quinnwerks
Copy link

@rustbot claim

@Noratrieb
Copy link
Member

Also relevant: #106192

if someone wants to pick that up, that would be very welcome

@ariscript
Copy link

@rustbot claim

I want to work on this, but I'll need some pointers on how to approach it.

@Noratrieb
Copy link
Member

Noratrieb commented Mar 11, 2024

open a thread on zulip in t-compiler/help (link)

@nnethercote nnethercote removed the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Sep 24, 2024
@nnethercote
Copy link
Contributor

I remove the E-easy tag, because #122418 shows that this is harder than it first appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants