This repository was archived by the owner on Nov 24, 2023. It is now read-only.
Fix some panics in edge cases.#185
Merged
killercup merged 4 commits intorust-lang:masterfrom Apr 2, 2020
Merged
Conversation
killercup
approved these changes
Apr 2, 2020
Contributor
killercup
left a comment
There was a problem hiding this comment.
Thanks! This looks great! How'd you find these?
| let expected_suggestions = | ||
| rustfix::get_suggestions_from_json(&expected_json, &HashSet::new(), filter_suggestions) | ||
| .context("could not load expected suggesitons")?; | ||
| .context("could not load expected suggestions")?; |
| // the span points to the "end" of the line. For example, a line of | ||
| // "foo\n" with a highlight_start of 5 is intended to highlight *after* | ||
| // the line. This needs to compensate since the newline has been removed | ||
| // from the text slice. |
Contributor
There was a problem hiding this comment.
Oh? Is this a change that the newlines is not part of the text slice?
Collaborator
Author
There was a problem hiding this comment.
AFAIK, rustc has never included line endings in the "text" lines.
It is somewhat unusual for spans to point past the end of the line. no_main is one of the few ways to do it. The unclosed delimiter error is the only other way I know of.
Contributor
|
Released as 0.5.1! |
bors
added a commit
to rust-lang/cargo
that referenced
this pull request
Jun 10, 2021
Update rustfix. This updates rustfix to 0.6.0. There are a few changes since 0.5.0, the following are noticeable changes: * rust-lang/rustfix#185 — Fix some panics in edge cases. * rust-lang/rustfix#195 — Revert revert multiple suggestions fix The important one is rust-lang/rustfix#195 which is necessary to handle some 2021 edition migration support. I have added a test to check that it works correctly.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 a few cases where rustfix will panic.