rust/tests/ui/borrow_and_ref_as_ptr.fixed
2024-12-26 15:15:54 +01:00

11 lines
222 B
Rust

// Make sure that `ref_as_ptr` is not emitted when `borrow_as_ptr` is.
#![warn(clippy::ref_as_ptr, clippy::borrow_as_ptr)]
fn f<T>(_: T) {}
fn main() {
let mut val = 0;
f(&raw const val);
f(&raw mut val);
}