Fix #7903 by smoelius · Pull Request #7906 · rust-lang/rust-clippy · GitHub
source link: https://github.com/rust-lang/rust-clippy/pull/7906
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Outdated
if let Ok(i) = usize::try_from(position);
let arg = &self.args[i];
if let ExprKind::Call(_, [arg_name, _]) = arg.kind;
if let Some(j) = self.arg_names.iter().position(|pat| match_arg(pat, arg_name));
This should work
@@ -557,13 +559,15 @@ impl FormatArgsExpn<'tcx> {
_ => None,
})
.collect();
if let PatKind::Tuple(arg_names, None) = arm.pat.kind;
This is okay for now since it fixes an ICE, but note that we want to move away from depending on the exact HIR per #7843.
println!("error: something failed at {}", Somewhere.to_string());
println!("{} and again {0}", x.to_string());
See my other comment on this. Comments would be helpful here. One to separate // negative tests
and one to explain the intent behind this test since it isn't obvious.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK