7105: Fix `==` in in format causes mismatched-arg-count r=edwin0cheng a=edwin0cheng

Fixes #7085 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
This commit is contained in:
bors[bot] 2020-12-31 10:04:19 +00:00 committed by GitHub
commit 558206f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,7 +259,8 @@ fn format_args_expand(
}
for arg in &mut args {
// Remove `key =`.
if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=') {
if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=' && p.spacing != tt::Spacing::Joint)
{
arg.drain(..2);
}
}