1
Fork 0

Adjust span of fn arguments

This commit is contained in:
Michael Goulet 2022-08-12 15:21:39 +00:00
parent 569788e47e
commit 9b0edd099d
5 changed files with 15 additions and 21 deletions

View file

@ -2289,7 +2289,7 @@ impl<'a> Parser<'a> {
} }
}; };
let span = lo.until(this.token.span); let span = lo.to(this.prev_token.span);
Ok(( Ok((
Param { Param {

View file

@ -8,7 +8,7 @@ note: function defined here
--> $DIR/complex.rs:11:4 --> $DIR/complex.rs:11:4
| |
LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {} LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {}
| ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- ------ | ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- -----
help: did you mean help: did you mean
| |
LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {}); LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {});

View file

@ -44,19 +44,19 @@ error: `...` must be the last argument of a C-variadic function
--> $DIR/issue-86053-1.rs:11:12 --> $DIR/issue-86053-1.rs:11:12
| |
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
| ^^^^ | ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic error: only foreign or `unsafe extern "C"` functions may be C-variadic
--> $DIR/issue-86053-1.rs:11:12 --> $DIR/issue-86053-1.rs:11:12
| |
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
| ^^^^ | ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic error: only foreign or `unsafe extern "C"` functions may be C-variadic
--> $DIR/issue-86053-1.rs:11:36 --> $DIR/issue-86053-1.rs:11:36
| |
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
| ^^^^ | ^^^
error[E0412]: cannot find type `F` in this scope error[E0412]: cannot find type `F` in this scope
--> $DIR/issue-86053-1.rs:11:48 --> $DIR/issue-86053-1.rs:11:48

View file

@ -11,13 +11,7 @@ note: function defined here
--> $DIR/suggest-ref-macro.rs:8:1 --> $DIR/suggest-ref-macro.rs:8:1
| |
LL | #[hello] LL | #[hello]
| _-^^^^^^^ | ^^^^^^^^
LL | | fn abc() {}
LL | |
LL | | fn x(_: &mut i32) {}
LL | |
LL | | macro_rules! bla {
| |_____________-
= note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types error[E0308]: mismatched types

View file

@ -1,13 +1,13 @@
error: function can not have more than 65535 arguments error: function can not have more than 65535 arguments
--> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:24 --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:22
| |
LL | fn _f($($t: ()),*) {} LL | fn _f($($t: ()),*) {}
| ________________________^ | ^
LL | | } ...
LL | | } LL | many_args!{[_]########## ######}
LL | | | -------------------------------- in this macro invocation
LL | | many_args!{[_]########## ######} |
| |____________^ = note: this error originates in the macro `many_args` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error