1
Fork 0

Detect duplicates

This commit is contained in:
Michael Goulet 2024-06-05 16:43:25 -04:00
parent f66558d2bf
commit 2e03130e11
7 changed files with 78 additions and 8 deletions

View file

@ -1531,10 +1531,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let opaque_ty_span = self.mark_span_with_reason(DesugaringKind::OpaqueTy, span, None);
let captured_lifetimes_to_duplicate = if let Some(args) =
bounds.iter().find_map(|bound| match bound {
ast::GenericBound::Use(a, _) => Some(a),
_ => None,
}) {
// We only look for one `use<...>` syntax since we syntactially reject more than one.
bounds.iter().find_map(
|bound| match bound {
ast::GenericBound::Use(a, _) => Some(a),
_ => None,
},
) {
// We'll actually validate these later on; all we need is the list of
// lifetimes to duplicate during this portion of lowering.
args.iter()