diff --git a/tests/pass/issues/issue-17877.rs b/tests/pass/issues/issue-17877.rs index a65c5513de004..64d397f91aeec 100644 --- a/tests/pass/issues/issue-17877.rs +++ b/tests/pass/issues/issue-17877.rs @@ -3,7 +3,7 @@ fn main() { match [0u8; 16 * 1024] { _ => 42_usize, }, - 42_usize + 42_usize, ); assert_eq!( @@ -12,6 +12,6 @@ fn main() { [0, ..] => 1_usize, _ => 2_usize, }, - 1_usize + 1_usize, ); } diff --git a/tests/pass/libc.rs b/tests/pass/libc.rs index 5991fae5bb1e6..f97b9dd2b9eaa 100644 --- a/tests/pass/libc.rs +++ b/tests/pass/libc.rs @@ -95,7 +95,7 @@ fn test_mutex_libc_init_recursive() { assert_eq!(libc::pthread_mutexattr_init(&mut attr as *mut _), 0); assert_eq!( libc::pthread_mutexattr_settype(&mut attr as *mut _, libc::PTHREAD_MUTEX_RECURSIVE), - 0 + 0, ); let mut mutex: libc::pthread_mutex_t = std::mem::zeroed(); assert_eq!(libc::pthread_mutex_init(&mut mutex as *mut _, &mut attr as *mut _), 0); @@ -118,11 +118,11 @@ fn test_mutex_libc_init_normal() { let mut mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed(); assert_eq!( libc::pthread_mutexattr_settype(&mut mutexattr as *mut _, 0x12345678), - libc::EINVAL + libc::EINVAL, ); assert_eq!( libc::pthread_mutexattr_settype(&mut mutexattr as *mut _, libc::PTHREAD_MUTEX_NORMAL), - 0 + 0, ); let mut mutex: libc::pthread_mutex_t = std::mem::zeroed(); assert_eq!(libc::pthread_mutex_init(&mut mutex as *mut _, &mutexattr as *const _), 0); @@ -141,9 +141,9 @@ fn test_mutex_libc_init_errorcheck() { assert_eq!( libc::pthread_mutexattr_settype( &mut mutexattr as *mut _, - libc::PTHREAD_MUTEX_ERRORCHECK + libc::PTHREAD_MUTEX_ERRORCHECK, ), - 0 + 0, ); let mut mutex: libc::pthread_mutex_t = std::mem::zeroed(); assert_eq!(libc::pthread_mutex_init(&mut mutex as *mut _, &mutexattr as *const _), 0); @@ -216,7 +216,7 @@ fn test_prctl_thread_name() { let mut buf = [255; 10]; assert_eq!( libc::prctl(libc::PR_GET_NAME, buf.as_mut_ptr(), 0 as c_long, 0 as c_long, 0 as c_long), - 0 + 0, ); assert_eq!(b"\0", &buf); let thread_name = CString::new("hello").expect("CString::new failed"); @@ -226,14 +226,14 @@ fn test_prctl_thread_name() { thread_name.as_ptr(), 0 as c_long, 0 as c_long, - 0 as c_long + 0 as c_long, ), - 0 + 0, ); let mut buf = [255; 6]; assert_eq!( libc::prctl(libc::PR_GET_NAME, buf.as_mut_ptr(), 0 as c_long, 0 as c_long, 0 as c_long), - 0 + 0, ); assert_eq!(b"hello\0", &buf); let long_thread_name = CString::new("01234567890123456789").expect("CString::new failed"); @@ -243,14 +243,14 @@ fn test_prctl_thread_name() { long_thread_name.as_ptr(), 0 as c_long, 0 as c_long, - 0 as c_long + 0 as c_long, ), - 0 + 0, ); let mut buf = [255; 16]; assert_eq!( libc::prctl(libc::PR_GET_NAME, buf.as_mut_ptr(), 0 as c_long, 0 as c_long, 0 as c_long), - 0 + 0, ); assert_eq!(b"012345678901234\0", &buf); } diff --git a/tests/pass/linux-getrandom-without-isolation.rs b/tests/pass/linux-getrandom-without-isolation.rs index a88db57cc09d5..ad1a1f27c7713 100644 --- a/tests/pass/linux-getrandom-without-isolation.rs +++ b/tests/pass/linux-getrandom-without-isolation.rs @@ -11,31 +11,31 @@ fn main() { libc::SYS_getrandom, 0 as *mut libc::c_void, 0 as libc::size_t, - 0 as libc::c_uint + 0 as libc::c_uint, ), - 0 + 0, ); assert_eq!( libc::syscall( libc::SYS_getrandom, buf.as_mut_ptr() as *mut libc::c_void, 5 as libc::size_t, - 0 as libc::c_uint + 0 as libc::c_uint, ), - 5 + 5, ); assert_eq!( libc::getrandom(0 as *mut libc::c_void, 0 as libc::size_t, 0 as libc::c_uint), - 0 + 0, ); assert_eq!( libc::getrandom( buf.as_mut_ptr() as *mut libc::c_void, 5 as libc::size_t, - 0 as libc::c_uint + 0 as libc::c_uint, ), - 5 + 5, ); } } diff --git a/tests/pass/linux-getrandom.rs b/tests/pass/linux-getrandom.rs index 6911176995354..7d3f899f4408a 100644 --- a/tests/pass/linux-getrandom.rs +++ b/tests/pass/linux-getrandom.rs @@ -10,31 +10,31 @@ fn main() { libc::SYS_getrandom, 0 as *mut libc::c_void, 0 as libc::size_t, - 0 as libc::c_uint + 0 as libc::c_uint, ), - 0 + 0, ); assert_eq!( libc::syscall( libc::SYS_getrandom, buf.as_mut_ptr() as *mut libc::c_void, 5 as libc::size_t, - 0 as libc::c_uint + 0 as libc::c_uint, ), - 5 + 5, ); assert_eq!( libc::getrandom(0 as *mut libc::c_void, 0 as libc::size_t, 0 as libc::c_uint), - 0 + 0, ); assert_eq!( libc::getrandom( buf.as_mut_ptr() as *mut libc::c_void, 5 as libc::size_t, - 0 as libc::c_uint + 0 as libc::c_uint, ), - 5 + 5, ); } } diff --git a/tests/pass/stacked-borrows/2phase.rs b/tests/pass/stacked-borrows/2phase.rs index 2a7588377feb4..345cb64ccf713 100644 --- a/tests/pass/stacked-borrows/2phase.rs +++ b/tests/pass/stacked-borrows/2phase.rs @@ -22,8 +22,8 @@ fn two_phase3(b: bool) { x.push(( { if b { - x = &mut y - }; + x = &mut y; + } 22 }, x.len(),