diff options
| author | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2024-06-17 15:47:07 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-17 15:47:07 -0500 |
| commit | 3ffd7d46a998b0e8d0a0a15213df2f264c5bc3be (patch) | |
| tree | 2c2e4e3b34f64ec4c33d52be00d665339d73b443 /src/utils.rs | |
| parent | 55a70266e27a85ecc0876d786480e6ec464d038f (diff) | |
| parent | 306ddabe0a4e08d6692aaa35736939c4613dd095 (diff) | |
Merge pull request #6193 from ytmimi/subtree-push-nightly-2024-06-13
subtree-push nightly-2024-06-13
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/utils.rs b/src/utils.rs index 642b6603b1e..fd59aedadfe 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -108,10 +108,11 @@ pub(crate) fn format_defaultness(defaultness: ast::Defaultness) -> &'static str } #[inline] -pub(crate) fn format_unsafety(unsafety: ast::Unsafe) -> &'static str { +pub(crate) fn format_safety(unsafety: ast::Safety) -> &'static str { match unsafety { - ast::Unsafe::Yes(..) => "unsafe ", - ast::Unsafe::No => "", + ast::Safety::Unsafe(..) => "unsafe ", + ast::Safety::Safe(..) => "safe ", + ast::Safety::Default => "", } } @@ -362,7 +363,7 @@ macro_rules! out_of_file_lines_range { && !$self .config .file_lines() - .intersects(&$self.parse_sess.lookup_line_range($span)) + .intersects(&$self.psess.lookup_line_range($span)) }; } @@ -497,7 +498,8 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr | ast::ExprKind::Break(..) | ast::ExprKind::Cast(..) | ast::ExprKind::Continue(..) - | ast::ExprKind::Err + | ast::ExprKind::Dummy + | ast::ExprKind::Err(_) | ast::ExprKind::Field(..) | ast::ExprKind::IncludedBytes(..) | ast::ExprKind::InlineAsm(..) |
