Skip to content

cleanup: unnecessary clone during lower generics args #124224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading