Skip to content

Commit

Permalink
correct to get wrong BytePos
Browse files Browse the repository at this point in the history
  • Loading branch information
rchaser53 committed May 5, 2019
1 parent 8c94e2b commit 7a93a26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ where
let list_lo = context.snippet_provider.span_after(span, "(");
let (list_str, tactic) = if inputs.len() == 0 {
let tactic = get_tactics(&[], &output, shape);
let list_hi = context.snippet_provider.span_before_last(span, ")");
let list_hi = context.snippet_provider.span_before(span, ")");
let comment = context
.snippet_provider
.span_to_snippet(mk_sp(list_lo, list_hi))?
Expand Down
8 changes: 8 additions & 0 deletions tests/target/issue-3539.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use std::io::Error;

fn main() {
let _read_num: fn() -> Result<(i32), Error> = || -> Result<(i32), Error> {
let a = 1;
Ok(a)
};
}

0 comments on commit 7a93a26

Please sign in to comment.