offset_of

This commit is contained in:
DrMeepster 2022-09-11 00:37:49 -07:00
parent f533800225
commit 84385bff42
2 changed files with 2 additions and 0 deletions

View File

@ -345,6 +345,7 @@ pub(crate) fn format_expr(
// Style Guide RFC for InlineAsm variant pending // Style Guide RFC for InlineAsm variant pending
// https://github.com/rust-dev-tools/fmt-rfcs/issues/152 // https://github.com/rust-dev-tools/fmt-rfcs/issues/152
ast::ExprKind::InlineAsm(..) => Some(context.snippet(expr.span).to_owned()), ast::ExprKind::InlineAsm(..) => Some(context.snippet(expr.span).to_owned()),
ast::ExprKind::OffsetOf(..) => Some(context.snippet(expr.span).to_owned()),
ast::ExprKind::TryBlock(ref block) => { ast::ExprKind::TryBlock(ref block) => {
if let rw @ Some(_) = if let rw @ Some(_) =
rewrite_single_line_block(context, "try ", block, Some(&expr.attrs), None, shape) rewrite_single_line_block(context, "try ", block, Some(&expr.attrs), None, shape)

View File

@ -499,6 +499,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
| ast::ExprKind::Field(..) | ast::ExprKind::Field(..)
| ast::ExprKind::IncludedBytes(..) | ast::ExprKind::IncludedBytes(..)
| ast::ExprKind::InlineAsm(..) | ast::ExprKind::InlineAsm(..)
| ast::ExprKind::OffsetOf(..)
| ast::ExprKind::Let(..) | ast::ExprKind::Let(..)
| ast::ExprKind::Path(..) | ast::ExprKind::Path(..)
| ast::ExprKind::Range(..) | ast::ExprKind::Range(..)