Skip to content

fix drop_location_span ICE - #161548

Open
malezjaa wants to merge 1 commit into
rust-lang:mainfrom
malezjaa:fix-drop-location-span-ice
Open

fix drop_location_span ICE#161548
malezjaa wants to merge 1 commit into
rust-lang:mainfrom
malezjaa:fix-drop-location-span-ice

Conversation

@malezjaa

@malezjaa malezjaa commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Resolves #156288.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 22, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 22, 2026
@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

r? @Enselic

rustbot has assigned @Enselic.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 20 candidates

Comment thread compiler/rustc_hir_typeck/src/upvar.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 25, 2026
@rustbot

rustbot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@malezjaa
malezjaa force-pushed the fix-drop-location-span-ice branch 2 times, most recently from d1439d4 to 21060d4 Compare August 26, 2026 21:32
@malezjaa

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 26, 2026
@rust-log-analyzer

This comment has been minimized.

@malezjaa
malezjaa force-pushed the fix-drop-location-span-ice branch from 21060d4 to 5280e63 Compare August 26, 2026 22:33
@rustbot

rustbot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@rustbot

rustbot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2026
@malezjaa
malezjaa force-pushed the fix-drop-location-span-ice branch from 5280e63 to 623f6f7 Compare August 27, 2026 09:19
@malezjaa

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 27, 2026

@Enselic Enselic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more comments. I'd also like to ask you to have a more descriptive commit title. My suggestion is something along the lines of:

hir_typeck: Don't ICE on closures without drop location in closure capture lint

View changes since this review

Comment thread compiler/rustc_hir_typeck/src/upvar.rs Outdated
Comment thread compiler/rustc_hir_typeck/src/upvar.rs Outdated
lint.span_label(
drop_location_span,
format!(
"in Rust 2018, `{var_name}` is dropped here along with \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: Why did you stop using v = this.tcx.hir_name(*var_hir_id),?

It doesn't matter much by itself, but for review it matters, because in general it is nice to minimize diffs. It makes it easier to review code. I have noticed that you shorten the long string, which is fine. Just curious why you didn't keep the other code the same.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because I never use the x = ... syntax in format macros, so It looked weird to me. I updated the first branch to also use {var_name}.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 31, 2026
@malezjaa
malezjaa force-pushed the fix-drop-location-span-ice branch from 623f6f7 to 158a310 Compare August 31, 2026 21:07
@malezjaa

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: Drop location span error: need to handle more ItemKind

4 participants