Rollup merge of #152664 - Embers-of-the-Fire:fix-152601, r=GuillaumeGomez

Fix mis-constructed `file_span` when generating scraped examples

Fixes rust-lang/rust#152601. Seemingly relative with rust-lang/rust#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.
This commit is contained in:
Stuart Cook 2026-02-17 13:02:24 +11:00 committed by GitHub
commit 85646c8488
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

Diff Content Not Available