diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-21 21:56:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-21 21:56:32 +0200 |
| commit | cd92422180915c866107e403a2c6cf56011432b4 (patch) | |
| tree | 47362dabd3dce2d2fcca23c7a2dc0b9e7c4a58aa | |
| parent | 67872e740eb608b0c5bae7021e106285398c9bc4 (diff) | |
| parent | 2d5a226f8f5a36c10c7863026f39d9d10bd38fa4 (diff) | |
| download | rust-cd92422180915c866107e403a2c6cf56011432b4.tar.gz rust-cd92422180915c866107e403a2c6cf56011432b4.zip | |
Rollup merge of #124224 - bvanjoi:cleanup, r=fmease
cleanup: unnecessary clone during lower generics args
| -rw-r--r-- | compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs index d340a08ee79..dd76862451c 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs @@ -228,8 +228,8 @@ pub fn lower_generic_args<'tcx: 'a, 'a>( // Check whether this segment takes generic arguments and the user has provided any. let (generic_args, infer_args) = ctx.args_for_def_id(def_id); - let args_iter = generic_args.iter().flat_map(|generic_args| generic_args.args.iter()); - let mut args_iter = args_iter.clone().peekable(); + let mut args_iter = + generic_args.iter().flat_map(|generic_args| generic_args.args.iter()).peekable(); // If we encounter a type or const when we expect a lifetime, we infer the lifetimes. // If we later encounter a lifetime, we know that the arguments were provided in the |
