Skip to content

Commit 237cbe9

Browse files
Adjust span of closure param
1 parent 262644d commit 237cbe9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ impl<'a> Parser<'a> {
22682268
attrs: attrs.into(),
22692269
ty,
22702270
pat,
2271-
span: lo.to(this.token.span),
2271+
span: lo.to(this.prev_token.span),
22722272
id: DUMMY_NODE_ID,
22732273
is_placeholder: false,
22742274
},

src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: closure parameter defined here
1010
--> $DIR/unboxed-closures-type-mismatch.rs:4:18
1111
|
1212
LL | let mut f = |x: isize, y: isize| -> isize { x + y };
13-
| ^^^^^^^^^
13+
| ^^^^^^^^
1414
help: change the type of the numeric literal from `usize` to `isize`
1515
|
1616
LL | let z = f(1_isize, 2);

0 commit comments

Comments
 (0)