From d0358ebf560373bc996a1d9878755c06b06dec05 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 15 Jan 2025 18:40:48 +0000 Subject: [PATCH] Remove unsafe --- tasks/coverage/src/driver.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/coverage/src/driver.rs b/tasks/coverage/src/driver.rs index 017353ea4cb26..b3bd1e4e76ca1 100644 --- a/tasks/coverage/src/driver.rs +++ b/tasks/coverage/src/driver.rs @@ -1,4 +1,4 @@ -use std::{hint::unreachable_unchecked, ops::ControlFlow, path::PathBuf}; +use std::{ops::ControlFlow, path::PathBuf}; use rustc_hash::FxHashSet; @@ -86,8 +86,7 @@ impl CompilerInterface for Driver { return ControlFlow::Break(()); }; let AstKind::Program(program) = root_node.kind() else { - // SAFETY: root_node is guaranteed to be Program - unsafe { unreachable_unchecked() }; + return ControlFlow::Break(()); }; if let Some(errors) = check_semantic_ids(program) { self.errors.extend(errors);