mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
a3baebcb31
Author: Marcin Serwin <marcin.serwin0@protonmail.com>
19 lines
387 B
Rust
19 lines
387 B
Rust
#![warn(clippy::borrow_as_ptr)]
|
|
#![allow(clippy::useless_vec)]
|
|
|
|
fn a() -> i32 {
|
|
0
|
|
}
|
|
|
|
#[clippy::msrv = "1.75"]
|
|
fn main() {
|
|
let val = 1;
|
|
let _p = std::ptr::addr_of!(val);
|
|
let _p = &0 as *const i32;
|
|
let _p = &a() as *const i32;
|
|
let vec = vec![1];
|
|
let _p = &vec.len() as *const usize;
|
|
|
|
let mut val_mut = 1;
|
|
let _p_mut = std::ptr::addr_of_mut!(val_mut);
|
|
}
|