Always include a position span in rustc_parse_format::Argument

This commit is contained in:
Alex Macleod 2022-07-31 15:11:00 +00:00
parent 3641b0ca30
commit cd13574992

View File

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