Update test after const_ptr functions are must_use now
This commit is contained in:
parent
b8098fe4cc
commit
da9b138ec7
@ -9,12 +9,12 @@ fn main() {
|
|||||||
let offset_isize = 1_isize;
|
let offset_isize = 1_isize;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
ptr.add(offset_usize);
|
let _ = ptr.add(offset_usize);
|
||||||
ptr.offset(offset_isize as isize);
|
let _ = ptr.offset(offset_isize as isize);
|
||||||
ptr.offset(offset_u8 as isize);
|
let _ = ptr.offset(offset_u8 as isize);
|
||||||
|
|
||||||
ptr.wrapping_add(offset_usize);
|
let _ = ptr.wrapping_add(offset_usize);
|
||||||
ptr.wrapping_offset(offset_isize as isize);
|
let _ = ptr.wrapping_offset(offset_isize as isize);
|
||||||
ptr.wrapping_offset(offset_u8 as isize);
|
let _ = ptr.wrapping_offset(offset_u8 as isize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,12 @@ fn main() {
|
|||||||
let offset_isize = 1_isize;
|
let offset_isize = 1_isize;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
ptr.offset(offset_usize as isize);
|
let _ = ptr.offset(offset_usize as isize);
|
||||||
ptr.offset(offset_isize as isize);
|
let _ = ptr.offset(offset_isize as isize);
|
||||||
ptr.offset(offset_u8 as isize);
|
let _ = ptr.offset(offset_u8 as isize);
|
||||||
|
|
||||||
ptr.wrapping_offset(offset_usize as isize);
|
let _ = ptr.wrapping_offset(offset_usize as isize);
|
||||||
ptr.wrapping_offset(offset_isize as isize);
|
let _ = ptr.wrapping_offset(offset_isize as isize);
|
||||||
ptr.wrapping_offset(offset_u8 as isize);
|
let _ = ptr.wrapping_offset(offset_u8 as isize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
error: use of `offset` with a `usize` casted to an `isize`
|
error: use of `offset` with a `usize` casted to an `isize`
|
||||||
--> $DIR/ptr_offset_with_cast.rs:12:9
|
--> $DIR/ptr_offset_with_cast.rs:12:17
|
||||||
|
|
|
|
||||||
LL | ptr.offset(offset_usize as isize);
|
LL | let _ = ptr.offset(offset_usize as isize);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr.add(offset_usize)`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr.add(offset_usize)`
|
||||||
|
|
|
|
||||||
= note: `-D clippy::ptr-offset-with-cast` implied by `-D warnings`
|
= note: `-D clippy::ptr-offset-with-cast` implied by `-D warnings`
|
||||||
|
|
||||||
error: use of `wrapping_offset` with a `usize` casted to an `isize`
|
error: use of `wrapping_offset` with a `usize` casted to an `isize`
|
||||||
--> $DIR/ptr_offset_with_cast.rs:16:9
|
--> $DIR/ptr_offset_with_cast.rs:16:17
|
||||||
|
|
|
|
||||||
LL | ptr.wrapping_offset(offset_usize as isize);
|
LL | let _ = ptr.wrapping_offset(offset_usize as isize);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr.wrapping_add(offset_usize)`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr.wrapping_add(offset_usize)`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user