Skip to content

Fix ICE when parsing frontmatter without newline#151889

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-151882-frontmatter-ice
Jan 31, 2026
Merged

Fix ICE when parsing frontmatter without newline#151889
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-151882-frontmatter-ice

Conversation

@chenyukang
Copy link
Member

@chenyukang chenyukang commented Jan 31, 2026

Fixes #151882

we can not add a normal test case for it:

  • no newline at the end of file, we can bypass this with change test file name with ignore-tidy
  • multiple errors in stderr, this conflicts with the previous bypass, seems we can not add multiple error annotations in one line

anyway, I added a run-make test for it.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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 Jan 31, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2026

r? @mati865

rustbot has assigned @mati865.
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

@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-151882-frontmatter-ice branch from e478028 to bf7a2a3 Compare January 31, 2026 05:08
@chenyukang
Copy link
Member Author

======== tests/rustdoc-gui/globals.goml ========

[ERROR] line 14: Error: The window properties still all match: for command wait-for-window-property-false: {"searchIndex": null}
at file:///checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/test_docs/index.html?search=Foo

======== tests/rustdoc-gui/search-result-display.goml ========

[WARNING] line 39: Delta is 0 for "x", maybe try to use compare-elements-position instead?

flaky test

@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2026

Some changes occurred in GUI tests.

cc @GuillaumeGomez

@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Jan 31, 2026
@chenyukang chenyukang force-pushed the yukang-fix-151882-frontmatter-ice branch from c9cb678 to bf7a2a3 Compare January 31, 2026 05:16
@chenyukang
Copy link
Member Author

seems PR not working?
#151856
@GuillaumeGomez

@Kivooeo Kivooeo assigned Kivooeo and unassigned mati865 Jan 31, 2026
@Kivooeo
Copy link
Member

Kivooeo commented Jan 31, 2026

would be

- let last_line_start = real_s.rfind('\n').map_or(0, |i| i + 1);
+ let last_line_start = real_s.rfind('\n').map_or(line_end, |i| i + 1);

enough to fix it?

@chenyukang chenyukang force-pushed the yukang-fix-151882-frontmatter-ice branch from bf7a2a3 to dc48704 Compare January 31, 2026 08:52
@chenyukang
Copy link
Member Author

would be

- let last_line_start = real_s.rfind('\n').map_or(0, |i| i + 1);
+ let last_line_start = real_s.rfind('\n').map_or(line_end, |i| i + 1);

enough to fix it?

yeah, simpler.

@Kivooeo
Copy link
Member

Kivooeo commented Jan 31, 2026

r=me with ci green

@Kivooeo
Copy link
Member

Kivooeo commented Jan 31, 2026

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 31, 2026

📌 Commit dc48704 has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Jan 31, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 31, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #151908 (Remove unused method `DroplessArena::contains_slice`)
 - #151850 (refactor: add an `enum DerefAdjustKind` in favor of `Option<OverloadedDeref>`)
 - #151889 (Fix ICE when parsing frontmatter without newline)
@rust-bors rust-bors bot merged commit 874c5d2 into rust-lang:main Jan 31, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Jan 31, 2026
Rollup merge of #151889 - chenyukang:yukang-fix-151882-frontmatter-ice, r=Kivooeo

Fix ICE when parsing frontmatter without newline

Fixes #151882

we can not add a normal test case for it:
- no newline at the end of file, we can bypass this with change test file name with `ignore-tidy`
- multiple errors in stderr, this conflicts with the previous bypass, seems we can not add multiple error annotations in one line

anyway, I added a `run-make` test for it.
@rustbot rustbot added this to the 1.95.0 milestone Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: frontmatter: begin <= end (4 <= 0) when slicing ----

5 participants