We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b77674d commit 9423406Copy full SHA for 9423406
compiler/rustc_middle/src/ty/mod.rs
@@ -1332,6 +1332,10 @@ impl<'tcx> OpaqueHiddenType<'tcx> {
1332
let id_substs = InternalSubsts::identity_for_item(tcx, def_id.to_def_id());
1333
debug!(?id_substs);
1334
1335
+ // This zip may have several times the same lifetime in `substs` paired with a different
1336
+ // lifetime from `id_substs`. In that case, we actually want to pick the last one, as it
1337
+ // is the one we introduced in the impl-trait desugaring to be meaningful. The other ones
1338
+ // are redundant.
1339
let map = substs.iter().zip(id_substs);
1340
1341
let map: FxHashMap<GenericArg<'tcx>, GenericArg<'tcx>> = match origin {
0 commit comments