Function std::flags::set_flags

pub fn set_flags(new_flags: u64) 
Expand description

Sets the flag register to the given value.

Arguments

  • new_flags: [u64] - Binary encoded 64 bit value representing the flags to set.

Examples

use std::flags::{disable_panic_on_overflow_preserving, set_flags};

fn foo() {
    let prior_flags = disable_panic_on_overflow_preserving();

    // Adding 1 to the max value of a u64 is considered an overflow.
    let bar = u64::max() + 1;

    set_flags(prior_flags);
}