Fix clippy::needless_borrow in the compiler

`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed
now.
This commit is contained in:
Nilstrieb
2023-11-21 20:07:32 +01:00
parent 0ff8610964
commit 21a870515b
304 changed files with 1101 additions and 1174 deletions

View File

@@ -1666,7 +1666,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
.copied()
.filter(|&(impl_, _)| {
infcx.probe(|_| {
let ocx = ObligationCtxt::new(&infcx);
let ocx = ObligationCtxt::new(infcx);
ocx.register_obligations(obligations.clone());
let impl_args = infcx.fresh_args_for_item(span, impl_);
@@ -1979,7 +1979,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
types_and_spans[..types_and_spans.len() - 1]
.iter()
.map(|(x, _)| x.as_str())
.intersperse(&", ")
.intersperse(", ")
.collect::<String>()
),
[(only, _)] => only.to_string(),