We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d6ab20 commit 497cb89Copy full SHA for 497cb89
tests/ui-fulldeps/pprust-parenthesis-insertion.rs
@@ -154,7 +154,12 @@ struct Unparenthesize;
154
impl MutVisitor for Unparenthesize {
155
fn visit_expr(&mut self, e: &mut P<Expr>) {
156
while let ExprKind::Paren(paren) = &mut e.kind {
157
+ let paren_attrs = mem::take(&mut e.attrs);
158
*e = mem::replace(paren, Expr::dummy());
159
+ if !paren_attrs.is_empty() {
160
+ assert!(e.attrs.is_empty());
161
+ e.attrs = paren_attrs;
162
+ }
163
}
164
mut_visit::walk_expr(self, e);
165
0 commit comments