rust-lang/rust-clippy

transmute_ptr_to_ref suggestion doesn't with some outer expression types

Open

#1,754 建立於 2017年5月12日

在 GitHub 查看
 (1 留言) (0 反應) (1 負責人)Rust (10,406 star) (1,391 fork)batch import
C-bugT-middlegood first issue

描述

clippy suggests the following replacement

-                mem::transmute::<*mut c_void, &mut Box<FnMut(&Button)>>(data)(&button)
+                &mut *(data as *mut Box<FnMut(&Button)>)(&button)

but we should suggest parens around the &mut *...

bonus points if the parens only appear if necessary

貢獻者指南

transmute_ptr_to_ref suggestion doesn't with some outer expression types · rust-lang/rust-clippy#1754 | Good First Issue