Skip to content

fix!: Panic if Patch span is beyond the end of buffer #250

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

Merged
merged 2 commits into from
Jul 3, 2025

Conversation

Muscraft
Copy link
Member

@Muscraft Muscraft commented Jul 3, 2025

When given a patch span beyond the end of the source, we silently allow it to work. Conversely, when we are given an annotation span beyond the end of the source, we panic. This PR makes it so that we consistently panic when given spans beyond the end of a source.

Note: This PR is only meant to make annotate-snippets behave consistently and does not intend to delve into what the correct response should be.

@Muscraft Muscraft force-pushed the sugg-span-beyond-buffer branch from 32ca293 to 83d2cbb Compare July 3, 2025 20:50
@Muscraft Muscraft merged commit ca9f5e5 into rust-lang:master Jul 3, 2025
15 checks passed
@Muscraft Muscraft deleted the sugg-span-beyond-buffer branch July 3, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants