fix off-by-one in parameter spans
This commit is contained in:
parent
7f58716810
commit
95daa068f1
4 changed files with 37 additions and 37 deletions
|
@ -1744,7 +1744,7 @@ impl<'a> Parser<'a> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let span = lo.to(self.token.span);
|
let span = lo.until(self.token.span);
|
||||||
|
|
||||||
Ok(Param {
|
Ok(Param {
|
||||||
attrs: attrs.into(),
|
attrs: attrs.into(),
|
||||||
|
|
|
@ -2,7 +2,7 @@ error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-no-fixed-args.rs:2:12
|
--> $DIR/variadic-ffi-no-fixed-args.rs:2:12
|
||||||
|
|
|
|
||||||
LL | fn foo(...);
|
LL | fn foo(...);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ error[E0308]: mismatched types
|
||||||
--> $DIR/issue-38371.rs:4:8
|
--> $DIR/issue-38371.rs:4:8
|
||||||
|
|
|
|
||||||
LL | fn foo(&foo: Foo) {
|
LL | fn foo(&foo: Foo) {
|
||||||
| ^^^^------
|
| ^^^^-----
|
||||||
| | |
|
| | |
|
||||||
| | expected due to this
|
| | expected due to this
|
||||||
| expected struct `Foo`, found reference
|
| expected struct `Foo`, found reference
|
||||||
|
|
|
@ -2,205 +2,205 @@ error: only foreign or `unsafe extern "C" functions may be C-variadic
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:5:19
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:5:19
|
||||||
|
|
|
|
||||||
LL | fn f1_1(x: isize, ...) {}
|
LL | fn f1_1(x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
|
||||||
|
|
|
|
||||||
LL | fn f1_2(...) {}
|
LL | fn f1_2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:8:9
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
|
||||||
|
|
|
|
||||||
LL | fn f1_2(...) {}
|
LL | fn f1_2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:12:30
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:12:30
|
||||||
|
|
|
|
||||||
LL | extern "C" fn f2_1(x: isize, ...) {}
|
LL | extern "C" fn f2_1(x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
|
||||||
|
|
|
|
||||||
LL | extern "C" fn f2_2(...) {}
|
LL | extern "C" fn f2_2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:15:20
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
|
||||||
|
|
|
|
||||||
LL | extern "C" fn f2_2(...) {}
|
LL | extern "C" fn f2_2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
|
||||||
|
|
|
|
||||||
LL | extern "C" fn f2_3(..., x: isize) {}
|
LL | extern "C" fn f2_3(..., x: isize) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:19:20
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
|
||||||
|
|
|
|
||||||
LL | extern "C" fn f2_3(..., x: isize) {}
|
LL | extern "C" fn f2_3(..., x: isize) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:23:26
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:23:26
|
||||||
|
|
|
|
||||||
LL | extern fn f3_1(x: isize, ...) {}
|
LL | extern fn f3_1(x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:26:16
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:26:16
|
||||||
|
|
|
|
||||||
LL | extern fn f3_2(...) {}
|
LL | extern fn f3_2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:26:16
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:26:16
|
||||||
|
|
|
|
||||||
LL | extern fn f3_2(...) {}
|
LL | extern fn f3_2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:16
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:16
|
||||||
|
|
|
|
||||||
LL | extern fn f3_3(..., x: isize) {}
|
LL | extern fn f3_3(..., x: isize) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:30:16
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:16
|
||||||
|
|
|
|
||||||
LL | extern fn f3_3(..., x: isize) {}
|
LL | extern fn f3_3(..., x: isize) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:35:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:35:13
|
||||||
|
|
|
|
||||||
LL | fn e_f1(...);
|
LL | fn e_f1(...);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:37:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:37:13
|
||||||
|
|
|
|
||||||
LL | fn e_f2(..., x: isize);
|
LL | fn e_f2(..., x: isize);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:44:23
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:44:23
|
||||||
|
|
|
|
||||||
LL | fn i_f1(x: isize, ...) {}
|
LL | fn i_f1(x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
|
||||||
|
|
|
|
||||||
LL | fn i_f2(...) {}
|
LL | fn i_f2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:46:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
|
||||||
|
|
|
|
||||||
LL | fn i_f2(...) {}
|
LL | fn i_f2(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
|
||||||
|
|
|
|
||||||
LL | fn i_f3(..., x: isize, ...) {}
|
LL | fn i_f3(..., x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:49:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
|
||||||
|
|
|
|
||||||
LL | fn i_f3(..., x: isize, ...) {}
|
LL | fn i_f3(..., x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:49:28
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:28
|
||||||
|
|
|
|
||||||
LL | fn i_f3(..., x: isize, ...) {}
|
LL | fn i_f3(..., x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
|
||||||
|
|
|
|
||||||
LL | fn i_f4(..., x: isize, ...) {}
|
LL | fn i_f4(..., x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:53:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
|
||||||
|
|
|
|
||||||
LL | fn i_f4(..., x: isize, ...) {}
|
LL | fn i_f4(..., x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:53:28
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:28
|
||||||
|
|
|
|
||||||
LL | fn i_f4(..., x: isize, ...) {}
|
LL | fn i_f4(..., x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:60:23
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:60:23
|
||||||
|
|
|
|
||||||
LL | fn t_f1(x: isize, ...) {}
|
LL | fn t_f1(x: isize, ...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:62:23
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:62:23
|
||||||
|
|
|
|
||||||
LL | fn t_f2(x: isize, ...);
|
LL | fn t_f2(x: isize, ...);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
|
||||||
|
|
|
|
||||||
LL | fn t_f3(...) {}
|
LL | fn t_f3(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:64:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
|
||||||
|
|
|
|
||||||
LL | fn t_f3(...) {}
|
LL | fn t_f3(...) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: C-variadic function must be declared with at least one named argument
|
error: C-variadic function must be declared with at least one named argument
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
|
||||||
|
|
|
|
||||||
LL | fn t_f4(...);
|
LL | fn t_f4(...);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:67:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
|
||||||
|
|
|
|
||||||
LL | fn t_f4(...);
|
LL | fn t_f4(...);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
|
||||||
|
|
|
|
||||||
LL | fn t_f5(..., x: isize) {}
|
LL | fn t_f5(..., x: isize) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:70:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
|
||||||
|
|
|
|
||||||
LL | fn t_f5(..., x: isize) {}
|
LL | fn t_f5(..., x: isize) {}
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: `...` must be the last argument of a C-variadic function
|
error: `...` must be the last argument of a C-variadic function
|
||||||
--> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
|
||||||
|
|
|
|
||||||
LL | fn t_f6(..., x: isize);
|
LL | fn t_f6(..., x: isize);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
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/variadic-ffi-semantic-restrictions.rs:73:13
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
|
||||||
|
|
|
|
||||||
LL | fn t_f6(..., x: isize);
|
LL | fn t_f6(..., x: isize);
|
||||||
| ^^^^
|
| ^^^
|
||||||
|
|
||||||
error: aborting due to 34 previous errors
|
error: aborting due to 34 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue