Rollup merge of #99987 - Alexendoo:parse-format-position-span, r=fee1-dead

Always include a position span in `rustc_parse_format::Argument`

Moves the spans from the `Position` enum to always be included in the `Argument` struct. Doesn't make any changes to use it in rustc, but it will be useful for some upcoming Clippy lints
This commit is contained in:
Matthias Krüger 2022-08-02 17:17:30 +02:00 committed by GitHub
commit a0991b8ba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 96 additions and 41 deletions

View file

@ -300,7 +300,7 @@ impl<'tcx> OnUnimplementedFormatString {
match token {
Piece::String(_) => (), // Normal string, no need to check it
Piece::NextArgument(a) => match a.position {
Position::ArgumentNamed(s, _) => {
Position::ArgumentNamed(s) => {
match Symbol::intern(s) {
// `{Self}` is allowed
kw::SelfUpper => (),
@ -386,7 +386,7 @@ impl<'tcx> OnUnimplementedFormatString {
.map(|p| match p {
Piece::String(s) => s,
Piece::NextArgument(a) => match a.position {
Position::ArgumentNamed(s, _) => {
Position::ArgumentNamed(s) => {
let s = Symbol::intern(s);
match generic_map.get(&s) {
Some(val) => val,