-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ra_cargo_watch: unsigned integer unferflow panic on empty main.rs file #2973
Comments
I am unable to reproduce. With a completely empty file, I don't get a diagnostic due to |
On my laptop it continues to reproduce stably on the latest version of |
This is very very weird. I've entirely copied the project |
I see that when I copy the project for extension host, |
we can probably just make it a saturating sub and call it good, will do that tomorrow, just to avoid crashes in debug on bad input :) |
Hmm... I see I used 1.42 nightly there ... |
I don't know why when I copy the project and open it in the extension host
to this
But when I open the original project |
@matklad, do you have any ideas on why |
Can |
@SomeoneToIgnore yes, you are right, I see |
It means what whatever rust tooling related thing (including |
Okay, I think I should forward this as a regression report to |
@kiljacken I think you should not add a saturation here, an |
Beware, I've seen stuff break when renaming a project directory without a follow-up |
@lnicola thank you for the precaution. For anyone curious, I've created a repo with the reproduction. |
I'll close the issue since this is a regression of |
Reproduction
Tested on the following version (last commit): 12ac379
Note: the reproduction was built with debug symbols, i.e. with
debug = 2
:https://github.com/rust-analyzer/rust-analyzer/blob/3f499489f79d05f8cc31b72055155e91bc78fddc/Cargo.toml#L7
Link to youtube
Shallow investigation
Underflow itself happens at this line:
https://github.com/rust-analyzer/rust-analyzer/blob/eba599d9863553d0f7d9d93f4c9050943da171cc/crates/ra_cargo_watch/src/conv.rs#L72
It seems that
cargo check
sends some invalid event data, becausecargo_metadata
docs claim thatspan.line_count
is 1-based:Maybe this is their bug, however, I am not entirely sure, because I didn't work with
ra_cargo_watch
crate at all.@kiljacken, can you take a look, please ?
The text was updated successfully, but these errors were encountered: