Skip to content

transmute_ptr_to_ref suggestion doesn't with some outer expression types #1754

Open
@oli-obk

Description

@oli-obk

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

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions