Skip to content

Conversation

@chenyukang
Copy link
Member

@chenyukang chenyukang commented Nov 9, 2025

Fixes #148732

There are two issues in this function:

  1. the original issue is caused by a typo error, which is fixed in the first commit
  2. another different ice(Patch span 7..7 is beyond the end of buffer 0) will be reported after fixing the first one, is caused by spans cross file boundaries due to macro expansion. It is fixed in the second commit.

r? @nnethercote

edited: also fixes #148684, added a new testcase for it in the last commit.

@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2025

rustc_errors::annotate_snippet_emitter_writer was changed

cc @Muscraft

@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 Nov 9, 2025
Comment on lines +1 to +3
WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#4), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "$SRC_DIR/std/src/macros.rs" }) }
WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#4), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "$SRC_DIR/std/src/macros.rs" }) }
WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#4), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "$SRC_DIR/std/src/macros.rs" }) }
Copy link
Member

Choose a reason for hiding this comment

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

I have worries that this will not pass aarch64-msvc-1 the same way it was in my PR

cc: #general > Windows path normalization in tests

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, it do have the same issue.

Copy link
Member Author

@chenyukang chenyukang Nov 10, 2025

Choose a reason for hiding this comment

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

so, I read the discussion on zulip, seems there is another standalone bug. so is it a temprary way we skip Windows for this testcase(and add it back after that bug is fixed)?

@Kivooeo
Copy link
Member

Kivooeo commented Nov 9, 2025

@bors try jobs=aarch64-msvc-1

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 9, 2025
Fix ICE caused by invalid spans for shrink_file

try-job: aarch64-msvc-1
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Nov 9, 2025

💔 Test for eca91bd failed: CI. Failed jobs:

@nnethercote
Copy link
Contributor

r=me once the comments are addressed.

@rustbot author

@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 Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 assertion failed: line_index < lines.len() ICE line_index < lines.len()

6 participants