From bccf77f26cd504de14f7d7d03f9f2a85d0fabb3d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 13 Jun 2021 20:00:27 +0300 Subject: internal: refactor missing unsafe diagnostic --- crates/hir/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'crates/hir/src/lib.rs') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 2f507b83b..16f862707 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1090,9 +1090,7 @@ impl Function { for expr in hir_ty::diagnostics::missing_unsafe(db, self.id.into()) { match source_map.expr_syntax(expr) { - Ok(in_file) => { - sink.push(MissingUnsafe { file: in_file.file_id, expr: in_file.value }) - } + Ok(expr) => acc.push(MissingUnsafe { expr }.into()), Err(SyntheticSyntax) => { // FIXME: Here and eslwhere in this file, the `expr` was // desugared, report or assert that this doesn't happen. -- cgit v1.2.3