mirror of
https://github.com/bspeice/qadapt
synced 2025-08-27 09:46:47 -04:00
Rustfmt run
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
#![feature(asm)]
|
||||
extern crate qadapt;
|
||||
|
||||
use qadapt::QADAPT;
|
||||
use qadapt::enter_protected;
|
||||
use qadapt::exit_protected;
|
||||
use qadapt::QADAPT;
|
||||
|
||||
#[global_allocator]
|
||||
static Q: QADAPT = QADAPT;
|
||||
|
||||
pub fn black_box<T>(dummy: T) -> T {
|
||||
// Taken from test lib, need to mark the arg as non-introspectable
|
||||
unsafe {asm!("" : : "r"(&dummy))}
|
||||
unsafe { asm!("" : : "r"(&dummy)) }
|
||||
dummy
|
||||
}
|
||||
|
||||
@ -41,10 +41,14 @@ fn unit_result(b: bool) -> Result<(), ()> {
|
||||
fn test_unit_result() {
|
||||
enter_protected();
|
||||
#[allow(unused)]
|
||||
{ black_box(unit_result(true)); }
|
||||
{
|
||||
black_box(unit_result(true));
|
||||
}
|
||||
black_box(unit_result(true)).unwrap();
|
||||
#[allow(unused)]
|
||||
{ black_box(unit_result(false)); }
|
||||
{
|
||||
black_box(unit_result(false));
|
||||
}
|
||||
black_box(unit_result(false)).unwrap_err();
|
||||
exit_protected();
|
||||
}
|
||||
@ -94,4 +98,4 @@ fn exit_too_often() {
|
||||
enter_protected();
|
||||
exit_protected();
|
||||
exit_protected();
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ extern crate qadapt;
|
||||
|
||||
use qadapt::allocate_panic;
|
||||
|
||||
|
||||
#[allocate_panic]
|
||||
fn allocates() {
|
||||
let _v: Vec<()> = Vec::with_capacity(1);
|
||||
@ -24,4 +23,4 @@ fn test_no_allocate() {
|
||||
fn test_allocates() {
|
||||
allocates();
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
Reference in New Issue
Block a user