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 (1,391 fork)batch import
C-bugT-middlegood first issue

仓库指标

Star
 (10,406 star)
PR 合并指标
 (平均合并 19天 22小时) (30 天内合并 113 个 PR)

描述

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

贡献者指南