]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.rs
Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se
[rust.git] / src / tools / clippy / tests / ui / transmutes_expressible_as_ptr_casts.rs
index d8e4421d4c18e2a3743100bc15e037d3b8525e24..e7360f3f9dcbaacc48e1607b95e6bfaa8982f939 100644 (file)
@@ -51,6 +51,8 @@ fn foo(_: usize) -> u8 {
     // e is a function pointer type and U is an integer; fptr-addr-cast
     let _usize_from_fn_ptr_transmute = unsafe { transmute::<fn(usize) -> u8, usize>(foo) };
     let _usize_from_fn_ptr = foo as *const usize;
+
+    let _usize_from_ref = unsafe { transmute::<*const u32, usize>(&1u32) };
 }
 
 // If a ref-to-ptr cast of this form where the pointer type points to a type other