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
..
2022-03-22 17:42:24 +01:00
2022-03-22 17:42:24 +01:00
2022-04-02 01:42:21 +02:00
2022-04-02 22:12:59 +00:00
2022-04-02 22:12:59 +00:00
2022-03-22 17:42:24 +01:00
2022-03-22 17:42:24 +01:00
2022-03-25 15:30:52 +01:00
2022-03-22 17:42:24 +01:00
2022-03-22 17:42:24 +01:00
2022-04-03 11:49:23 +00:00
2022-03-22 17:42:24 +01:00
2022-04-02 22:12:59 +00:00
2022-03-23 20:20:09 +00:00
2022-03-22 17:42:24 +01:00
2022-03-22 17:42:24 +01:00
2022-03-22 17:42:24 +01:00
2022-03-22 17:42:24 +01:00