Skip to content

Commit

Permalink
correctly construct _ as Ident rather than Punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Feb 21, 2025
1 parent 3b1ec86 commit 8665b8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c2rust-transpile/src/translator/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ impl<'c> Translation<'c> {
// Emit input and/or output expressions, separated by "=>" if both
push_expr(&mut tokens, mk().paren_expr(constraints_ident));
if let Some(in_expr) = in_expr {
let in_expr_span = in_expr.span();
push_expr(&mut tokens, in_expr);
if out_expr.is_some() {
tokens.push(TokenTree::Punct(Punct::new('=', Joint)));
Expand All @@ -923,7 +924,7 @@ impl<'c> Translation<'c> {
tokens.push(TokenTree::Punct(Punct::new('=', Joint)));
tokens.push(TokenTree::Punct(Punct::new('>', Alone)));

tokens.push(TokenTree::Punct(Punct::new('_', Alone)));
tokens.push(TokenTree::Ident(Ident::new("_", in_expr_span)));
}
}
}
Expand Down

0 comments on commit 8665b8c

Please sign in to comment.