-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc diagnostic for incorrect return-pos bounds of Fn traits as function arguments suggests deleting until file start #140543
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
On another thought, I bisected the wrong thing. I should've looked at the commit where the error diagnostic started suggesting removing these lines, instead of looking where it became a hard error. In nightly-2022-05-01 (2021 edition), this diagnostic only had one suggestion: diagnostic in 2022-05-01
In nightly-2024-03-28, in #122120, it changed to include an additional suggestion, but it already did not look useful, as the line where it makes a suggestion is malformed. output in 2024-03-28, including bisector run
Later, in nightly-2025-02-12 it started suggesting removing all lines until the start of the file. output in 2025-02-12 (same as OP), and bisector run
searched nightlies: from nightly-2022-05-01 to nightly-2025-05-01 bisected with cargo-bisect-rustc v0.6.9Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start=2022-05-01 --end=2025-05-01 --script script.sh --preserve |
Code
Current output
Not sure what the desired output should be. The first suggestion makes sense, but in the second one it wants you to delete all the lines from the start of the file.
Rust Version
Anything else?
Sorry for a mouthful in the title. This bug manifests in 2024 and 2021 editions, but not in the 2018 edition, where it generates a warning instead.
output of rustc --edition 2018 file.rs (just a warning)
This is a bug in the latest nightly ("nightly-2025-05-01") and current stable (1.86.0).
Rust version of current stable
This could be due to the fact that it used to be an error in nightly-2018-01-01, but is not in nightly-2022-05-01 (both are using 2018 edition).
error in 1.24.0-nightly
Bisecting rustc from nightly-2018-01-01 to nightly-2022-05-01 to find where it stopped being an error reveals nightly-2020-10-07:
cargo bisect-rustc --regress=success --start=2018-01-01 --end=2022-05-01 --preserve
The PR that touches that code is #73905, but I am not sure how relevant this is. After all, it is an error in 2021 and 2024 editions on the current compiler.
I can try to implement the fix, but I am not sure what the compiler is even trying to suggest.
The text was updated successfully, but these errors were encountered: