]> git.lizzy.rs Git - rust.git/blob - tests/ui/ptr_offset_with_cast.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / ptr_offset_with_cast.rs
1 fn main() {
2     let vec = vec![b'a', b'b', b'c'];
3     let ptr = vec.as_ptr();
4
5     let offset_u8 = 1_u8;
6     let offset_usize = 1_usize;
7     let offset_isize = 1_isize;
8
9     unsafe {
10         ptr.offset(offset_usize as isize);
11         ptr.offset(offset_isize as isize);
12         ptr.offset(offset_u8 as isize);
13
14         ptr.wrapping_offset(offset_usize as isize);
15         ptr.wrapping_offset(offset_isize as isize);
16         ptr.wrapping_offset(offset_u8 as isize);
17     }
18 }