Skip to content

Commit 54082f2

Browse files
committed
Update tests
1 parent 6dd37dc commit 54082f2

9 files changed

Lines changed: 9 additions & 6 deletions

tests/unit/out/refcount/reinterpret_cast_oob_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ fn main_0() -> i32 {
1515
let x: Value<u8> = Rc::new(RefCell::new(
1616
((*bytes.borrow()).offset((4) as isize).read()),
1717
));
18-
let _ = (*x.borrow_mut()).clone();
18+
(*x.borrow_mut());
1919
return 0;
2020
}

tests/unit/out/refcount/reinterpret_cast_undersize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ fn main_0() -> i32 {
1313
let b: Value<u8> = Rc::new(RefCell::new(66_u8));
1414
let p: Value<Ptr<u32>> = Rc::new(RefCell::new((b.as_pointer()).reinterpret_cast::<u32>()));
1515
let val: Value<u32> = Rc::new(RefCell::new(((*p.borrow()).read())));
16-
let _ = (*val.borrow_mut()).clone();
16+
(*val.borrow_mut());
1717
return 0;
1818
}

tests/unit/out/refcount/va_arg_printf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::rc::{Rc, Weak};
99
pub fn logf_impl_0(fmt: Ptr<u8>, ap: VaList) -> i32 {
1010
let fmt: Value<Ptr<u8>> = Rc::new(RefCell::new(fmt));
1111
let ap: Value<VaList> = Rc::new(RefCell::new(ap));
12-
let _ = (*fmt.borrow());
12+
(*fmt.borrow()).clone();
1313
return {
1414
let _lhs = ((*ap.borrow_mut()).arg::<i32>()).clone();
1515
_lhs + ((*ap.borrow_mut()).arg::<i32>()).clone()

tests/unit/out/refcount/void_cast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ fn main_0() -> i32 {
8484
let storage: Value<i32> = Rc::new(RefCell::new(11));
8585
let p: Value<Ptr<i32>> = Rc::new(RefCell::new((storage.as_pointer())));
8686
((*p.borrow()).read());
87+
(*p.borrow_mut()).clone();
8788
let arr: Value<Box<[i32]>> = Rc::new(RefCell::new(Box::new([1, 2, 3])));
8889
((*arr.borrow_mut())[(1) as usize]);
8990
let h: Value<Holder> = Rc::new(RefCell::new(Holder {

tests/unit/out/unsafe/reinterpret_cast_oob_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ unsafe fn main_0() -> i32 {
1515
let mut val: u32 = 67305985_u32;
1616
let mut bytes: *mut u8 = ((&mut val as *mut u32) as *mut u8);
1717
let mut x: u8 = (*bytes.offset((4) as isize));
18-
let _ = x.clone();
18+
x;
1919
return 0;
2020
}

tests/unit/out/unsafe/reinterpret_cast_undersize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ unsafe fn main_0() -> i32 {
1515
let mut b: u8 = 66_u8;
1616
let mut p: *mut u32 = ((&mut b as *mut u8) as *mut u32);
1717
let mut val: u32 = (*p);
18-
let _ = val.clone();
18+
val;
1919
return 0;
2020
}

tests/unit/out/unsafe/va_arg_printf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::io::{Read, Seek, Write};
77
use std::os::fd::{AsFd, FromRawFd, IntoRawFd};
88
use std::rc::Rc;
99
pub unsafe fn logf_impl_0(mut fmt: *const u8, mut ap: VaList) -> i32 {
10-
let _ = fmt;
10+
fmt;
1111
return ((ap.arg::<i32>()) + (ap.arg::<i32>()));
1212
}
1313
pub unsafe fn logf_1(mut fmt: *const u8, args: &[VaArg]) -> i32 {

tests/unit/out/unsafe/void_cast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ unsafe fn main_0() -> i32 {
7777
let mut storage: i32 = 11;
7878
let mut p: *mut i32 = (&mut storage as *mut i32);
7979
(*p);
80+
(p);
8081
let mut arr: [i32; 3] = [1, 2, 3];
8182
(arr[(1) as usize]);
8283
let mut h: Holder = Holder { field: 17 };

tests/unit/void_cast.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ int main() {
6161
int storage = 11;
6262
int *p = &storage;
6363
(void)(*p);
64+
(void)(p);
6465

6566
int arr[] = {1, 2, 3};
6667
(void)(arr[1]);

0 commit comments

Comments
 (0)