Skip to content

Commit

Permalink
refactor(pal/hermit): return ! to satisfy rust-analyzer
Browse files Browse the repository at this point in the history
This silences this rust-analyzer-specific error: `expected !, found ()`

Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Jul 31, 2024
1 parent ddff2b6 commit c337019
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions std/src/sys/pal/hermit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ pub fn unsupported_err() -> crate::io::Error {
}

pub fn abort_internal() -> ! {
unsafe {
hermit_abi::abort();
}
unsafe { hermit_abi::abort() }
}

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

crate::sys::thread_local::destructors::run();
hermit_abi::exit(result);
hermit_abi::exit(result)
}

#[inline]
Expand Down
4 changes: 1 addition & 3 deletions std/src/sys/pal/hermit/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ pub fn home_dir() -> Option<PathBuf> {
}

pub fn exit(code: i32) -> ! {
unsafe {
hermit_abi::exit(code);
}
unsafe { hermit_abi::exit(code) }
}

pub fn getpid() -> u32 {
Expand Down

0 comments on commit c337019

Please sign in to comment.