1
Fork 0

Adjust span of closure param

This commit is contained in:
Michael Goulet 2022-07-23 17:46:20 +00:00
parent 262644d94a
commit 237cbe91a8
2 changed files with 2 additions and 2 deletions

View file

@ -2268,7 +2268,7 @@ impl<'a> Parser<'a> {
attrs: attrs.into(), attrs: attrs.into(),
ty, ty,
pat, pat,
span: lo.to(this.token.span), span: lo.to(this.prev_token.span),
id: DUMMY_NODE_ID, id: DUMMY_NODE_ID,
is_placeholder: false, is_placeholder: false,
}, },

View file

@ -10,7 +10,7 @@ note: closure parameter defined here
--> $DIR/unboxed-closures-type-mismatch.rs:4:18 --> $DIR/unboxed-closures-type-mismatch.rs:4:18
| |
LL | let mut f = |x: isize, y: isize| -> isize { x + y }; LL | let mut f = |x: isize, y: isize| -> isize { x + y };
| ^^^^^^^^^ | ^^^^^^^^
help: change the type of the numeric literal from `usize` to `isize` help: change the type of the numeric literal from `usize` to `isize`
| |
LL | let z = f(1_isize, 2); LL | let z = f(1_isize, 2);