rust-lang/rust-clippy
View on GitHubtransmute_ptr_to_ref suggestion doesn't with some outer expression types
Open
#1754 opened on May 12, 2017
C-bugT-middlegood first issue
Description
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