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 8de4c72 commit 1ed0cbfCopy full SHA for 1ed0cbf
tests/ui-fulldeps/pprust-parenthesis-insertion.rs
@@ -158,7 +158,12 @@ struct Unparenthesize;
158
impl MutVisitor for Unparenthesize {
159
fn visit_expr(&mut self, e: &mut Expr) {
160
while let ExprKind::Paren(paren) = &mut e.kind {
161
+ let paren_attrs = mem::take(&mut e.attrs);
162
*e = mem::replace(paren, Expr::dummy());
163
+ if !paren_attrs.is_empty() {
164
+ assert!(e.attrs.is_empty());
165
+ e.attrs = paren_attrs;
166
+ }
167
}
168
mut_visit::walk_expr(self, e);
169
0 commit comments