rust-analyzer/crates/rust-analyzer
bors[bot] 5b5ca0bd17
Merge #11866
11866: fix: Prevent underflow in range conversion  r=Veykril a=skyfmmf

Previously, when line numbers of Rust spans were converted to LSP ranges, they could underflow resulting in very large line numbers. As an underflow is always wrong, prevent it and use 0 instead.

This was noticed when opening an empty file in `src/bin/` of a library crate. In this case rustc produces a span with `"line_start": 0, "line_end": 0` resulting in the underflow.

Co-authored-by: Felix Maurer <felix@felix-maurer.de>
2022-04-03 11:49:23 +00:00
..
src Merge #11866 2022-04-03 11:49:23 +00:00
tests/slow-tests Bump deps 2022-03-17 19:24:37 +02:00
build.rs Add semicolons for consistency 2021-10-03 23:39:43 +11:00
Cargo.toml minor: Bump dependencies 2022-03-22 17:42:24 +01:00