6

Fix #7903 by smoelius · Pull Request #7906 · rust-lang/rust-clippy · GitHub

 2 years ago
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.
neoserver,ios ssh client

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));

Copy link

Collaborator

@camsteffen camsteffen 18 days ago

This should work

Suggested change
if let Some(j) = self.arg_names.iter().position(|pat| match_arg(pat, arg_name)); if let Some(j) = self.arg_names.iter().position(|pat| path_to_local_id(arg_name, pat.hir_id));

@@ -557,13 +559,15 @@ impl FormatArgsExpn<'tcx> {

_ => None,

})

.collect();

if let PatKind::Tuple(arg_names, None) = arm.pat.kind;

Copy link

Collaborator

@camsteffen camsteffen 18 days ago

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());

Copy link

Collaborator

@camsteffen camsteffen 18 days ago

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK