Skip to content

Commit

Permalink
Merge pull request rust-lang#3540 from rchaser53/issue-3539
Browse files Browse the repository at this point in the history
correct to get wrong BytePos
  • Loading branch information
scampi committed May 6, 2019
2 parents 467c53f + 7a93a26 commit da1e3c9
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 da1e3c9

Please sign in to comment.