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

Fix a couple NLL TLS spans #136477

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Fix a couple NLL TLS spans #136477

merged 2 commits into from
Feb 4, 2025

Conversation

lqd
Copy link
Member

@lqd lqd commented Feb 3, 2025

Some NLL TLS tests show incorrect spans for the end of function. It seems that the TerminatorKind::Return source info span can sometimes point at the single character after the end of the function.

Completely changing the span where the terminator is built also changes a bunch of diagnostics: small functions have more code shown unrelated to the errors at hand, wrapping symbols appear and weird-looking arrows point to the end of function, etc. So it seems this is somehow unexpectedly relied upon in making diagnostics look better and their heuristics.

So I just changed it where it matters for these few tests: the diagnostics specialized to conflict errors with thread locals.

r? @matthewjasper

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 3, 2025
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 4, 2025

📌 Commit d2a30f7 has been approved by matthewjasper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 4, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#136242 (Remove `LateContext::match_def_path()`)
 - rust-lang#136274 (Check Sizedness of return type in WF)
 - rust-lang#136284 (Allow using named consts in pattern types)
 - rust-lang#136477 (Fix a couple NLL TLS spans )
 - rust-lang#136497 (Report generic mismatches when calling bodyless trait functions)
 - rust-lang#136520 (Remove unnecessary layout assertions for object-safe receivers)
 - rust-lang#136526 (mir_build: Rename `thir::cx::Cx` to `ThirBuildCx` and remove `UserAnnotatedTyHelpers`)

Failed merges:

 - rust-lang#136304 (Reject negative literals for unsigned or char types in pattern ranges and literals)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 46b18a9 into rust-lang:master Feb 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup merge of rust-lang#136477 - lqd:nll-tls-spans, r=matthewjasper

Fix a couple NLL TLS spans

Some NLL TLS tests show incorrect spans for the end of function. It seems that the `TerminatorKind::Return` source info span can sometimes point at the single character after the end of the function.

Completely changing the span where the terminator is built also changes a bunch of diagnostics: small functions have more code shown unrelated to the errors at hand, wrapping symbols appear and weird-looking arrows point to the end of function, etc. So it seems this is somehow unexpectedly relied upon in making diagnostics look better and their heuristics.

So I just changed it where it matters for these few tests: the diagnostics specialized to conflict errors with thread locals.

r? `@matthewjasper`
@lqd lqd deleted the nll-tls-spans branch February 5, 2025 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants