Skip to content

Commit

Permalink
Rollup merge of rust-lang#99987 - Alexendoo:parse-format-position-spa…
Browse files Browse the repository at this point in the history
…n, 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
  • Loading branch information
matthiaskrgr authored Aug 2, 2022
2 parents 119247a + cd13574 commit 4546f5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl SimpleFormatArgs {
};

match arg.position {
ArgumentIs(n, _) | ArgumentImplicitlyIs(n) => {
ArgumentIs(n) | ArgumentImplicitlyIs(n) => {
if self.unnamed.len() <= n {
// Use a dummy span to mark all unseen arguments.
self.unnamed.resize_with(n, || vec![DUMMY_SP]);
Expand All @@ -462,7 +462,7 @@ impl SimpleFormatArgs {
}
}
},
ArgumentNamed(n, _) => {
ArgumentNamed(n) => {
let n = Symbol::intern(n);
if let Some(x) = self.named.iter_mut().find(|x| x.0 == n) {
match x.1.as_slice() {
Expand Down

0 comments on commit 4546f5d

Please sign in to comment.