leading operand comment

This commit is contained in:
Brent Westbrook
2025-11-12 14:46:33 -05:00
parent 6eebc35eec
commit a303d1aa49
3 changed files with 51 additions and 27 deletions

View File

@@ -1865,7 +1865,7 @@ fn handle_unary_op_comment<'a>(
.find(|token| token.kind == SimpleTokenKind::LParen)
.map_or(unary_op.operand.start(), |lparen| lparen.start());
if comment.end() < up_to {
CommentPlacement::leading(unary_op, comment)
CommentPlacement::leading(&*unary_op.operand, comment)
} else {
CommentPlacement::Default(comment)
}