clippy = {version = "*", optional = true}
[features]
-default=[]
+default = []
```
And, in your `main.rs` or `lib.rs`:
let sugg = if from_pty.ty == to_rty.ty {
- format!("{}{}", deref, arg)
+ // Put things in parentheses if they are more complex
+ match args[0].node {
+ ExprPath(..) | ExprCall(..) | ExprMethodCall(..) | ExprBlock(..) => {
+ format!("{}{}", deref, arg)
+ }
+ _ => format!("{}({})", deref, arg)
+ }
} else {
format!("{}({} as {} {})", deref, arg, cast, to_rty.ty)
};
//~| SUGGESTION = &*m;
let _: &T = &*m;
+ let _: &mut T = std::mem::transmute(p as *mut T);
+ //~^ ERROR transmute from a pointer type (`*mut T`) to a reference type (`&mut T`)
+ //~| HELP try
+ //~| SUGGESTION = &mut *(p as *mut T);
+
let _: &T = std::mem::transmute(o);
//~^ ERROR transmute from a pointer type (`*const U`) to a reference type (`&T`)
//~| HELP try