We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da7f678 commit a1fabbfCopy full SHA for a1fabbf
src/expr.rs
@@ -1453,7 +1453,7 @@ pub(crate) fn rewrite_paren(
1453
let remove_nested_parens = context.config.remove_nested_parens();
1454
loop {
1455
// 1 = "(" or ")"
1456
- pre_span = mk_sp(span.lo() + BytePos(1), subexpr.span.lo());
+ pre_span = mk_sp(span.lo() + BytePos(1), subexpr.span().lo());
1457
post_span = mk_sp(subexpr.span.hi(), span.hi() - BytePos(1));
1458
pre_comment = rewrite_missing_comment(pre_span, shape, context)?;
1459
post_comment = rewrite_missing_comment(post_span, shape, context)?;
tests/target/issue-5871.rs
@@ -0,0 +1,8 @@
1
+#![feature(stmt_expr_attributes)]
2
+fn okay() -> u32 {
3
+ (
4
+ // Comments in parentheses-expressions caused attributes to be duplicated.
5
+ #[allow(unused_variables)]
6
+ 0
7
+ )
8
+}
0 commit comments