Skip to content

Commit 83fbcab

Browse files
committed
Fix warnings in tests
1 parent b0ab2bf commit 83fbcab

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

tests/run/asm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_asm:
1616
ret"
1717
);
1818

19+
#[cfg(target_arch = "x86_64")]
1920
extern "C" {
2021
fn add_asm(a: i64, b: i64) -> i64;
2122
}

tests/run/float.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// Run-time:
44
// status: 0
55

6-
#![feature(const_black_box)]
7-
86
fn main() {
97
use std::hint::black_box;
108

@@ -15,14 +13,14 @@ fn main() {
1513
}};
1614
}
1715

18-
check!(i32, (black_box(0.0f32) as i32));
16+
check!(i32, black_box(0.0f32) as i32);
1917

20-
check!(u64, (black_box(f32::NAN) as u64));
21-
check!(u128, (black_box(f32::NAN) as u128));
18+
check!(u64, black_box(f32::NAN) as u64);
19+
check!(u128, black_box(f32::NAN) as u128);
2220

23-
check!(i64, (black_box(f64::NAN) as i64));
24-
check!(u64, (black_box(f64::NAN) as u64));
21+
check!(i64, black_box(f64::NAN) as i64);
22+
check!(u64, black_box(f64::NAN) as u64);
2523

26-
check!(i16, (black_box(f32::MIN) as i16));
27-
check!(i16, (black_box(f32::MAX) as i16));
24+
check!(i16, black_box(f32::MIN) as i16);
25+
check!(i16, black_box(f32::MAX) as i16);
2826
}

tests/run/int.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// Run-time:
44
// status: 0
55

6-
#![feature(const_black_box)]
7-
86
fn main() {
97
use std::hint::black_box;
108

tests/run/volatile.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55

66
use std::mem::MaybeUninit;
77

8+
#[allow(dead_code)]
89
#[derive(Debug)]
910
struct Struct {
1011
pointer: *const (),
1112
func: unsafe fn(*const ()),
1213
}
1314

14-
fn func(ptr: *const ()) {
15+
fn func(_ptr: *const ()) {
1516
}
1617

1718
fn main() {

tests/run/volatile2.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
mod libc {
77
#[link(name = "c")]
88
extern "C" {
9-
pub fn puts(s: *const u8) -> i32;
10-
119
pub fn sigaction(signum: i32, act: *const sigaction, oldact: *mut sigaction) -> i32;
1210
pub fn mmap(addr: *mut (), len: usize, prot: i32, flags: i32, fd: i32, offset: i64) -> *mut ();
1311
pub fn mprotect(addr: *mut (), len: usize, prot: i32) -> i32;
@@ -61,7 +59,7 @@ fn main() {
6159
panic!("error: mmap failed");
6260
}
6361

64-
let p_count = (&mut COUNT) as *mut u32;
62+
let p_count = (&raw mut COUNT) as *mut u32;
6563
p_count.write_volatile(0);
6664

6765
// Trigger segfaults
@@ -94,7 +92,7 @@ fn main() {
9492
}
9593

9694
unsafe extern "C" fn segv_handler(_: i32, _: *mut (), _: *mut ()) {
97-
let p_count = (&mut COUNT) as *mut u32;
95+
let p_count = (&raw mut COUNT) as *mut u32;
9896
p_count.write_volatile(p_count.read_volatile() + 1);
9997
let count = p_count.read_volatile();
10098

0 commit comments

Comments
 (0)