diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-16 11:47:50 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-17 22:24:31 +1100 |
| commit | bcf0ec019172ccb34e2f53c07cd3b76d506d249a (patch) | |
| tree | c4c34ce6df6c6c92827b71c0cac8e72756881229 /src | |
| parent | 9556b56dbdbd4238f0051e7230004b0aa488fa14 (diff) | |
| download | rust-bcf0ec019172ccb34e2f53c07cd3b76d506d249a.tar.gz rust-bcf0ec019172ccb34e2f53c07cd3b76d506d249a.zip | |
Replace `mk_foo` calls with `infer_foo` where possible.
There are several `mk_foo`/`intern_foo` pairs, where the former takes an iterator and the latter takes a slice. (This naming convention is bad, but that's a fix for another PR.) This commit changes several `mk_foo` occurrences into `intern_foo`, avoiding the need for some `.iter()`/`.into_iter()` calls. Affected cases: - mk_type_list - mk_tup - mk_substs - mk_const_list
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/methods/needless_collect.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs b/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs index 82d3b830d4f..8ddbacc3d7a 100644 --- a/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs +++ b/src/tools/clippy/clippy_lints/src/methods/needless_collect.rs @@ -173,7 +173,7 @@ fn is_contains_sig(cx: &LateContext<'_>, call_id: HirId, iter_expr: &Expr<'_>) - && let Some(iter_item) = cx.tcx .associated_items(iter_trait) .find_by_name_and_kind(cx.tcx, Ident::with_dummy_span(Symbol::intern("Item")), AssocKind::Type, iter_trait) - && let substs = cx.tcx.mk_substs([GenericArg::from(typeck.expr_ty_adjusted(iter_expr))].into_iter()) + && let substs = cx.tcx.intern_substs(&[GenericArg::from(typeck.expr_ty_adjusted(iter_expr))]) && let proj_ty = cx.tcx.mk_projection(iter_item.def_id, substs) && let Ok(item_ty) = cx.tcx.try_normalize_erasing_regions(cx.param_env, proj_ty) { |
