Fix mis-constructed file_span when generating scraped examples#152664
Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom Feb 17, 2026
Merged
Fix mis-constructed file_span when generating scraped examples#152664rust-bors[bot] merged 3 commits intorust-lang:mainfrom
file_span when generating scraped examples#152664rust-bors[bot] merged 3 commits intorust-lang:mainfrom
Conversation
Collaborator
|
r? @camelid rustbot has assigned @camelid. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
approved these changes
Feb 16, 2026
Member
|
Thanks! @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 16, 2026
…uillaumeGomez Fix mis-constructed `file_span` when generating scraped examples Fixes rust-lang#152601. Seemingly relative with rust-lang#147399 but I could not reproduce the original ICE. This PR removes the `file_span` logic from scraped example generation. The original implementation did not read or write items using `file_span`; it only used it to locate a source file, `context.href_from_span`. However, the span was validated against the wrong file, which could trigger ICEs on inputs such as multibyte characters due to an incorrectly constructed span. Since scraped examples do not use the span and the `url` is already given, the safest and simplest fix is to remove it. Tested against the crate and MCVE documented in the original issue. P.S. there seems to be some bug when rendering call sites, but since fixing mis-behavior is a change rather than a bug-fix that would be implemented in another PR.
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Feb 16, 2026
…uillaumeGomez Fix mis-constructed `file_span` when generating scraped examples Fixes rust-lang#152601. Seemingly relative with rust-lang#147399 but I could not reproduce the original ICE. This PR removes the `file_span` logic from scraped example generation. The original implementation did not read or write items using `file_span`; it only used it to locate a source file, `context.href_from_span`. However, the span was validated against the wrong file, which could trigger ICEs on inputs such as multibyte characters due to an incorrectly constructed span. Since scraped examples do not use the span and the `url` is already given, the safest and simplest fix is to remove it. Tested against the crate and MCVE documented in the original issue. P.S. there seems to be some bug when rendering call sites, but since fixing mis-behavior is a change rather than a bug-fix that would be implemented in another PR.
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 16, 2026
…uwer Rollup of 6 pull requests Successful merges: - #152700 (miri subtree update) - #152715 (`rust-analyzer` subtree update) - #152609 (Install LLVM DLL in the right place on Windows) - #152206 (misc doc improvements) - #152664 (Fix mis-constructed `file_span` when generating scraped examples) - #152698 (Suppress unstable-trait notes under `-Zforce-unstable-if-unmarked`)
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 16, 2026
…uwer Rollup of 6 pull requests Successful merges: - #152700 (miri subtree update) - #152715 (`rust-analyzer` subtree update) - #152609 (Install LLVM DLL in the right place on Windows) - #152206 (misc doc improvements) - #152664 (Fix mis-constructed `file_span` when generating scraped examples) - #152698 (Suppress unstable-trait notes under `-Zforce-unstable-if-unmarked`)
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 17, 2026
Rollup of 11 pull requests Successful merges: - #152700 (miri subtree update) - #152715 (`rust-analyzer` subtree update) - #151783 (Implement RFC 3678: Final trait methods) - #152512 (core: Implement feature `float_exact_integer_constants`) - #152661 (Avoid ICE in From/TryFrom diagnostic under -Znext-solver) - #152703 (Remove `rustc_query_system`) - #152206 (misc doc improvements) - #152664 (Fix mis-constructed `file_span` when generating scraped examples) - #152698 (Suppress unstable-trait notes under `-Zforce-unstable-if-unmarked`) - #152727 (`probe_op` silence ambiguity errors if tainted) - #152728 (Port #![default_lib_allocator] to the new attribute parser)
rust-timer
added a commit
that referenced
this pull request
Feb 17, 2026
Rollup merge of #152664 - Embers-of-the-Fire:fix-152601, r=GuillaumeGomez Fix mis-constructed `file_span` when generating scraped examples Fixes #152601. Seemingly relative with #147399 but I could not reproduce the original ICE. This PR removes the `file_span` logic from scraped example generation. The original implementation did not read or write items using `file_span`; it only used it to locate a source file, `context.href_from_span`. However, the span was validated against the wrong file, which could trigger ICEs on inputs such as multibyte characters due to an incorrectly constructed span. Since scraped examples do not use the span and the `url` is already given, the safest and simplest fix is to remove it. Tested against the crate and MCVE documented in the original issue. P.S. there seems to be some bug when rendering call sites, but since fixing mis-behavior is a change rather than a bug-fix that would be implemented in another PR.
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Feb 18, 2026
Rollup of 11 pull requests Successful merges: - rust-lang/rust#152700 (miri subtree update) - rust-lang/rust#152715 (`rust-analyzer` subtree update) - rust-lang/rust#151783 (Implement RFC 3678: Final trait methods) - rust-lang/rust#152512 (core: Implement feature `float_exact_integer_constants`) - rust-lang/rust#152661 (Avoid ICE in From/TryFrom diagnostic under -Znext-solver) - rust-lang/rust#152703 (Remove `rustc_query_system`) - rust-lang/rust#152206 (misc doc improvements) - rust-lang/rust#152664 (Fix mis-constructed `file_span` when generating scraped examples) - rust-lang/rust#152698 (Suppress unstable-trait notes under `-Zforce-unstable-if-unmarked`) - rust-lang/rust#152727 (`probe_op` silence ambiguity errors if tainted) - rust-lang/rust#152728 (Port #![default_lib_allocator] to the new attribute parser)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #152601. Seemingly relative with #147399 but I could not reproduce the original ICE.
This PR removes the
file_spanlogic from scraped example generation. The original implementation did not read or write items usingfile_span; it only used it to locate a source file,context.href_from_span. However, the span was validated against the wrong file, which could trigger ICEs on inputs such as multibyte characters due to an incorrectly constructed span. Since scraped examples do not use the span and theurlis already given, the safest and simplest fix is to remove it.Tested against the crate and MCVE documented in the original issue.
P.S. there seems to be some bug when rendering call sites, but since fixing mis-behavior is a change rather than a bug-fix that would be implemented in another PR.