]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/zero_offset.rs
Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisa
[rust.git] / src / tools / clippy / tests / ui / zero_offset.rs
1 #[allow(clippy::borrow_as_ptr)]
2 fn main() {
3     unsafe {
4         let m = &mut () as *mut ();
5         m.offset(0);
6         m.wrapping_add(0);
7         m.sub(0);
8         m.wrapping_sub(0);
9
10         let c = &() as *const ();
11         c.offset(0);
12         c.wrapping_add(0);
13         c.sub(0);
14         c.wrapping_sub(0);
15
16         let sized = &1 as *const i32;
17         sized.offset(0);
18     }
19 }