@@ -7,5 +7,29 @@ LL | let _: Option<&mut i32> = std::mem::transmute(Some(&5i32));
77 = note: `-D clippy::mutable-adt-argument-transmute` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::mutable_adt_argument_transmute)]`
99
10- error: aborting due to 1 previous error
10+ error: transmute of type argument &i32 to &i32
11+ --> tests/ui/mutable_adt_argument_transmute.rs:7:39
12+ |
13+ LL | let _: Result<&mut i32, ()> = std::mem::transmute(Result::<&i32, ()>::Ok(&5i32));
14+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
16+ error: transmute of type argument &std::string::String to &std::string::String
17+ --> tests/ui/mutable_adt_argument_transmute.rs:10:13
18+ |
19+ LL | std::mem::transmute(Result::<Option<&String>, ()>::Ok(Some(&"foo".to_string())));
20+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
22+ error: transmute of type argument &f32 to &f32
23+ --> tests/ui/mutable_adt_argument_transmute.rs:12:43
24+ |
25+ LL | let _: Result<&mut f32, &usize> = std::mem::transmute(Result::<&f32, &usize>::Ok(&2f32));
26+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27+
28+ error: transmute of type argument &usize to &usize
29+ --> tests/ui/mutable_adt_argument_transmute.rs:14:41
30+ |
31+ LL | let _: Result<(), &mut usize> = std::mem::transmute(Result::<(), &usize>::Ok(()));
32+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
34+ error: aborting due to 5 previous errors
1135
0 commit comments