You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some suggestions for lines that end with ; do not currently end with a ;?
Just got this one in my rustfix demo:
Info: transmute from a pointer type (`*mut libc::c_void`) to a reference type (`&mut Box<for<'r, 'r> std::ops::FnMut(&'r menus::MenuItem, &'r windows::Window)>`)
#[warn(transmute_ptr_to_ref)] on by default
--> src/menus.rs:50:17-51:76
Suggestion - Replace:
mem::transmute::<*mut c_void,
&mut Box<FnMut(&MenuItem, &Window)>>(data)(&menu_item, &window);
with:
&mut *(data as *mut Box<for<'r, 'r> std::ops::FnMut(&'r menus::MenuItem, &'r windows::Window)>)
(note the missing semicolon in the suggestion).
The text was updated successfully, but these errors were encountered:
it suggests to replace transmute(x) with &mut *(data as *...), the function arguments are missing entirely, since they are outside the span that should be replaced.
The bug here is, that there are no parens around the &mut *(x) part, because that's needed so (&mut *(x))(args); works
IIRC, rustfix always displays only the changed part after “replace […] with:”, and always ignores the context (including the rest of the line), hence the missing (&menu_item, &window);.
Some suggestions for lines that end with
;
do not currently end with a;
?Just got this one in my rustfix demo:
(note the missing semicolon in the suggestion).
The text was updated successfully, but these errors were encountered: