-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Sort lint_groups in no_lint_suggestion #106008
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @Nilstrieb (rustbot has picked a reviewer for you, use r? to override) |
Ah, the dangers of I think it makes more sense to just filter out deprecated lint groups, they are not what people should use so we shouldn't suggest them. |
The no_lint_suggestion routine passes a vector of lint group names to find_best_match_for_name. That routine depends on the sort order of its input vector, which matters in case multiple inputs are at the same Levenshtein distance to the target name. However, no_lint_suggestion currently just passes lint_groups.keys() as input vector - this is sorted in hash value order, which is not guaranteed to be stable, and in fact differs between big- and little-endian host platforms, causing test failures on s390x. To fix this, always sort the lint groups before using their names as input to find_best_match_for_name. In addition, deprecated lint groups should never be suggested, so filter those out. Fixes rust-lang#105379
e2c9528
to
30fbfd5
Compare
Agreed, patch updated accordingly. |
@bors r+ rollup |
Rollup of 8 pull requests Successful merges: - rust-lang#105584 (add assert messages if chunks/windows are length 0) - rust-lang#105602 (interpret: add read_machine_[ui]size convenience methods) - rust-lang#105824 (str.lines() docstring: clarify that line endings are not returned) - rust-lang#105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - rust-lang#105986 (Fix typo in reading_half_a_pointer.rs) - rust-lang#105995 (Add regression test for rust-lang#96530) - rust-lang#106008 (Sort lint_groups in no_lint_suggestion) - rust-lang#106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…Nilstrieb Sort lint_groups in no_lint_suggestion The no_lint_suggestion routine passes a vector of lint group names to find_best_match_for_name. That routine depends on the sort order of its input vector, which matters in case multiple inputs are at the same Levenshtein distance to the target name. However, no_lint_suggestion currently just passes lint_groups.keys() as input vector - this is sorted in hash value order, which is not guaranteed to be stable, and in fact differs between big- and little-endian host platforms, causing test failures on s390x. To fix this, always sort the lint groups before using their names as input to find_best_match_for_name. In doing so, prefer non- deprecated lint group names over deprecated ones, and then use alphabetical order. Fixes rust-lang#105379
Rollup of 8 pull requests Successful merges: - rust-lang#105584 (add assert messages if chunks/windows are length 0) - rust-lang#105602 (interpret: add read_machine_[ui]size convenience methods) - rust-lang#105824 (str.lines() docstring: clarify that line endings are not returned) - rust-lang#105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - rust-lang#105986 (Fix typo in reading_half_a_pointer.rs) - rust-lang#105995 (Add regression test for rust-lang#96530) - rust-lang#106008 (Sort lint_groups in no_lint_suggestion) - rust-lang#106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The no_lint_suggestion routine passes a vector of lint group names to find_best_match_for_name. That routine depends on the sort order of its input vector, which matters in case multiple inputs are at the same Levenshtein distance to the target name.
However, no_lint_suggestion currently just passes lint_groups.keys() as input vector - this is sorted in hash value order, which is not guaranteed to be stable, and in fact differs between big- and little-endian host platforms, causing test failures on s390x.
To fix this, always sort the lint groups before using their names as input to find_best_match_for_name. In doing so, prefer non- deprecated lint group names over deprecated ones, and then use alphabetical order.
Fixes #105379