common.rs - source
Description: Source of the Rust file `library/std/src/sys/pal/wasm/../unsupported/common.rs`.

#
std/sys/pal/unsupported/
common.rs

    1use crate::io as std_io;
    2
    3// SAFETY: must be called only once during runtime initialization.
    4// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
    5pub unsafe fn init(_argc: isize, _argv: *const *const u8, _sigpipe: u8) {}
    6
    7// SAFETY: must be called only once during runtime cleanup.
    8// NOTE: this is not guaranteed to run, for example when the program aborts.
    9pub unsafe fn cleanup() {}
    10
    11pub fn unsupported<T>() -> std_io::Result<T> {
    12    Err(unsupported_err())
    13}
    14
    15pub fn unsupported_err() -> std_io::Error {
    16    std_io::Error::UNSUPPORTED_PLATFORM
    17}
    18
    19pub fn abort_internal() -> ! {
    20    core::intrinsics::abort();
    21}