1
Fork 0

Rollup merge of #126724 - nnethercote:fix-parse_ty_bare_fn-span, r=compiler-errors

Fix a span in `parse_ty_bare_fn`.

It currently goes one token too far.

Example: line 259 of `tests/ui/abi/compatibility.rs`:
```
test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32);
```
This commit changes the span for the second element from `fn(),` to `fn()`, i.e. removes the extraneous comma.

This doesn't affect any tests. I found it while debugging some other code. Not a big deal but an easy fix so I figure it worth doing.

r? ``@spastorino``
This commit is contained in:
Matthias Krüger 2024-06-26 07:50:16 +02:00 committed by GitHub
commit dd6b04663e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View file

@ -2126,7 +2126,8 @@ pub struct BareFnTy {
pub ext: Extern,
pub generic_params: ThinVec<GenericParam>,
pub decl: P<FnDecl>,
/// Span of the `fn(...) -> ...` part.
/// Span of the `[unsafe] [extern] fn(...) -> ...` part, i.e. everything
/// after the generic params (if there are any, e.g. `for<'a>`).
pub decl_span: Span,
}