-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Panic in source_span_for_markdown_range
#141665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I see the problem, this is a case where treating utf-8 as bytes will give you the correct result due to its self-synchronizing nature, but rust still doesn't let us split a codepoint. |
annoyingly, the fix would be a lot easier if we had either ByteStr::contains or |
For everyone's information, the repro steps are:
|
Manually minimized (still requires Clippy tho):
#![doc = "⚠️"]
#![doc = ""]
|
…or_markdown_range-bug-141665, r=GuillaumeGomez source_span_for_markdown_range: fix utf8 violation it is non-trivial to reproduce this bug through rustdoc, which uses this function less than clippy, so the regression test was added as a unit test instead of an integration test. fixes rust-lang#141665 r? `@GuillaumeGomez`
Rollup merge of #141666 - lolbinarycat:rustdoc-source_span_for_markdown_range-bug-141665, r=GuillaumeGomez source_span_for_markdown_range: fix utf8 violation it is non-trivial to reproduce this bug through rustdoc, which uses this function less than clippy, so the regression test was added as a unit test instead of an integration test. fixes #141665 r? ``@GuillaumeGomez``
…wn_range-bug-141665, r=GuillaumeGomez source_span_for_markdown_range: fix utf8 violation it is non-trivial to reproduce this bug through rustdoc, which uses this function less than clippy, so the regression test was added as a unit test instead of an integration test. fixes rust-lang/rust#141665 r? ``@GuillaumeGomez``
Seems like we do something wrong with strings indexing.
I'll try to write a small reproducer.
The text was updated successfully, but these errors were encountered: