Skip to content

Commit 5c716bd

Browse files
committed
add comment
1 parent a95a2ac commit 5c716bd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
687687
return;
688688
};
689689

690+
// Look for the where-bound which introduces the placeholder.
691+
// As we're using the HIR, we need to handle both `for<'a> T: Trait<'a>`
692+
// and `T: for<'a> Trait`<'a>.
690693
for pred in generics.predicates {
691694
let WherePredicateKind::BoundPredicate(WhereBoundPredicate {
692695
bound_generic_params,

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
236236
.collect::<Vec<_>>();
237237
debug!(?gat_id_and_generics);
238238

239-
// find higher-ranked trait bounds bounded to the generic associated types
239+
// Look for the where-bound which introduces the placeholder.
240+
// As we're using the HIR, we need to handle both `for<'a> T: Trait<'a>`
241+
// and `T: for<'a> Trait`<'a>.
240242
let mut hrtb_bounds = vec![];
241243
gat_id_and_generics.iter().flatten().for_each(|&(gat_hir_id, generics)| {
242244
for pred in generics.predicates {

0 commit comments

Comments
 (0)