Skip to content

Commit c337019

Browse files
committed
refactor(pal/hermit): return ! to satisfy rust-analyzer
This silences this rust-analyzer-specific error: `expected !, found ()` Signed-off-by: Martin Kröning <[email protected]>
1 parent ddff2b6 commit c337019

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

std/src/sys/pal/hermit/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ pub fn unsupported_err() -> crate::io::Error {
4949
}
5050

5151
pub fn abort_internal() -> ! {
52-
unsafe {
53-
hermit_abi::abort();
54-
}
52+
unsafe { hermit_abi::abort() }
5553
}
5654

5755
pub fn hashmap_random_keys() -> (u64, u64) {
@@ -104,7 +102,7 @@ pub unsafe extern "C" fn runtime_entry(
104102
let result = main(argc as isize, argv);
105103

106104
crate::sys::thread_local::destructors::run();
107-
hermit_abi::exit(result);
105+
hermit_abi::exit(result)
108106
}
109107

110108
#[inline]

std/src/sys/pal/hermit/os.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ pub fn home_dir() -> Option<PathBuf> {
190190
}
191191

192192
pub fn exit(code: i32) -> ! {
193-
unsafe {
194-
hermit_abi::exit(code);
195-
}
193+
unsafe { hermit_abi::exit(code) }
196194
}
197195

198196
pub fn getpid() -> u32 {

0 commit comments

Comments
 (0)