2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2022-01-13 06:18:19 -06:00
|
|
|
#![warn(clippy::borrow_as_ptr)]
|
2023-07-02 07:35:19 -05:00
|
|
|
#![allow(clippy::useless_vec)]
|
|
|
|
|
|
|
|
fn a() -> i32 {
|
|
|
|
0
|
|
|
|
}
|
2022-01-13 06:18:19 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let val = 1;
|
|
|
|
let _p = std::ptr::addr_of!(val);
|
2023-07-02 07:35:19 -05:00
|
|
|
let _p = &0 as *const i32;
|
|
|
|
let _p = &a() as *const i32;
|
|
|
|
let vec = vec![1];
|
|
|
|
let _p = &vec.len() as *const usize;
|
2022-01-13 06:18:19 -06:00
|
|
|
|
|
|
|
let mut val_mut = 1;
|
|
|
|
let _p_mut = std::ptr::addr_of_mut!(val_mut);
|
|
|
|
}
|