Rollup merge of #100458 - compiler-errors:fn-argument-span, r=estebank

Adjust span of fn argument declaration

Span of a fn argument declaration goes from:

```
fn foo(i : i32 , ...)
       ^^^^^^^^
```

to:

```
fn foo(i : i32 , ...)
       ^^^^^^^
```

That is, we don't include the extra spacing up to the trailing comma, which I think is more correct.

cc https://github.com/rust-lang/rust/pull/99646#discussion_r944568074
r? ``@estebank``

---

The two tests that had dramatic changes in their rendering I think actually are improved, though they are kinda poor spans both before and after the changes. 🤷 Thoughts?
This commit is contained in:
Matthias Krüger 2022-08-15 20:11:35 +02:00 committed by GitHub
commit e369ec871e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 21 deletions

View file

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