Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit da1e3c9

Browse files
authored
Merge pull request rust-lang#3540 from rchaser53/issue-3539
correct to get wrong BytePos
2 parents 467c53f + 7a93a26 commit da1e3c9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ where
320320
let list_lo = context.snippet_provider.span_after(span, "(");
321321
let (list_str, tactic) = if inputs.len() == 0 {
322322
let tactic = get_tactics(&[], &output, shape);
323-
let list_hi = context.snippet_provider.span_before_last(span, ")");
323+
let list_hi = context.snippet_provider.span_before(span, ")");
324324
let comment = context
325325
.snippet_provider
326326
.span_to_snippet(mk_sp(list_lo, list_hi))?

tests/target/issue-3539.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use std::io::Error;
2+
3+
fn main() {
4+
let _read_num: fn() -> Result<(i32), Error> = || -> Result<(i32), Error> {
5+
let a = 1;
6+
Ok(a)
7+
};
8+
}

0 commit comments

Comments
 (0)