diff options
| author | DrMeepster <19316085+DrMeepster@users.noreply.github.com> | 2022-09-11 00:37:49 -0700 |
|---|---|---|
| committer | DrMeepster <19316085+DrMeepster@users.noreply.github.com> | 2023-04-21 02:14:02 -0700 |
| commit | 511e457c4ba88097ee46ef07b7ef80ce4dd4a3c5 (patch) | |
| tree | 9aed1b0210cfd3c784a7c5cc89646b8d9dad5427 /src/tools/rustfmt | |
| parent | b92a41c6760801a7128ca0ec69ba4ba9c9194054 (diff) | |
| download | rust-511e457c4ba88097ee46ef07b7ef80ce4dd4a3c5.tar.gz rust-511e457c4ba88097ee46ef07b7ef80ce4dd4a3c5.zip | |
offset_of
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/expr.rs | 1 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/utils.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/rustfmt/src/expr.rs b/src/tools/rustfmt/src/expr.rs index ac96bedf2fe..b76e3a2a87c 100644 --- a/src/tools/rustfmt/src/expr.rs +++ b/src/tools/rustfmt/src/expr.rs @@ -345,6 +345,7 @@ pub(crate) fn format_expr( // Style Guide RFC for InlineAsm variant pending // https://github.com/rust-dev-tools/fmt-rfcs/issues/152 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) => { if let rw @ Some(_) = rewrite_single_line_block(context, "try ", block, Some(&expr.attrs), None, shape) diff --git a/src/tools/rustfmt/src/utils.rs b/src/tools/rustfmt/src/utils.rs index a26375ee643..ca171657407 100644 --- a/src/tools/rustfmt/src/utils.rs +++ b/src/tools/rustfmt/src/utils.rs @@ -499,6 +499,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr | ast::ExprKind::Field(..) | ast::ExprKind::IncludedBytes(..) | ast::ExprKind::InlineAsm(..) + | ast::ExprKind::OffsetOf(..) | ast::ExprKind::Let(..) | ast::ExprKind::Path(..) | ast::ExprKind::Range(..) |
