Skip to content

Commit

Permalink
Support generic types that need multiple bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 8, 2024
1 parent fb8d3a7 commit 5948ee6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions impl/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ impl Display<'_> {
formatvar = IdentUnraw::new(format_ident!("_{}", formatvar.to_string()));
}
out += &formatvar.to_string();
if !macro_named_args.insert(member.clone()) {
// Already added to scope by a previous use.
continue;
}
let local = formatvar.to_local();
let mut binding_value = ToTokens::into_token_stream(match &member {
MemberUnraw::Unnamed(index) => format_ident!("_{}", index),
Expand Down Expand Up @@ -142,7 +138,11 @@ impl Display<'_> {
}
);
}
bindings.push((local, binding_value));
if macro_named_args.insert(member) {
bindings.push((local, binding_value));
} else {
// Already added to bindings by a previous use.
}
}

out += read;
Expand Down

0 comments on commit 5948ee6

Please sign in to comment.