Skip to content

Commit f9f0ac2

Browse files
authored
Rollup merge of #134797 - spastorino:ergonomic-ref-counting-1, r=nikomatsakis
Ergonomic ref counting This is an experimental first version of ergonomic ref counting. This first version implements most of the RFC but doesn't implement any of the optimizations. This was left for following iterations. RFC: rust-lang/rfcs#3680 Tracking issue: rust-lang/rust#132290 Project goal: rust-lang/rust-project-goals#107 r? ```@nikomatsakis```
2 parents facc42a + ebd6372 commit f9f0ac2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/expr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ pub(crate) fn format_expr(
137137
ast::ExprKind::Tup(ref items) => {
138138
rewrite_tuple(context, items.iter(), expr.span, shape, items.len() == 1)
139139
}
140+
ast::ExprKind::Use(_, _) => {
141+
// FIXME: properly implement this
142+
Ok(context.snippet(expr.span()).to_owned())
143+
}
140144
ast::ExprKind::Let(ref pat, ref expr, _span, _) => rewrite_let(context, shape, pat, expr),
141145
ast::ExprKind::If(..)
142146
| ast::ExprKind::ForLoop { .. }

src/utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
513513
| ast::ExprKind::Become(..)
514514
| ast::ExprKind::Yeet(..)
515515
| ast::ExprKind::Tup(..)
516+
| ast::ExprKind::Use(..)
516517
| ast::ExprKind::Type(..)
517518
| ast::ExprKind::Yield(None)
518519
| ast::ExprKind::Underscore => false,

0 commit comments

Comments
 (0)