Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3d4d913

Browse files
committed
fix: Make span_to_lines return at least one line
1 parent e8ac439 commit 3d4d913

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

‎src/renderer/source_map.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'a> SourceMap<'a> {
124124
if start >= line_info.end_byte {
125125
continue;
126126
}
127-
if end <= line_info.start_byte {
127+
if end < line_info.start_byte {
128128
break;
129129
}
130130
lines.push(line_info);

‎tests/rustc_tests.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,6 @@ LL | /// This is a long line that contains a <http://link.com>
29662966
}
29672967

29682968
#[test]
2969-
#[should_panic = "attempt to subtract with overflow"]
29702969
fn array_into_iter() {
29712970
let source1 = r#"#![allow(unused)]
29722971
fn main() {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /