-
Notifications
You must be signed in to change notification settings - Fork 62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks great! How'd you find these?
@@ -160,7 +163,7 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err | |||
))?; | |||
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")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch :)
// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh? Is this a change that the newlines is not part of the text slice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Released as 0.5.1! |
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.
Fixes a few cases where rustfix will panic.