Skip to content

Commit 2f416e8

Browse files
committed
Remove has_late_bound_regions from Generics.
1 parent 4ed91e2 commit 2f416e8

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

compiler/rustc_hir_analysis/src/astconv/generics.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,15 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
628628
return ExplicitLateBound::No;
629629
}
630630

631-
if let Some(span_late) = def.has_late_bound_regions {
631+
let has_late_bound_regions = def
632+
.params
633+
.iter()
634+
.find(|param| {
635+
matches!(param.kind, ty::GenericParamDefKind::Lifetime { late_bound: true })
636+
})
637+
.map(|param| tcx.def_span(param.def_id));
638+
639+
if let Some(span_late) = has_late_bound_regions {
632640
let msg = "cannot specify lifetime arguments explicitly \
633641
if late bound lifetime parameters are present";
634642
let note = "the late bound lifetime parameter is introduced here";

compiler/rustc_hir_analysis/src/collect/generics_of.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
8989
params,
9090
param_def_id_to_index,
9191
has_self: generics.has_self,
92-
has_late_bound_regions: generics.has_late_bound_regions,
9392
};
9493
}
9594

@@ -371,18 +370,13 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
371370
}
372371

373372
let param_def_id_to_index = params.iter().map(|param| (param.def_id, param.index)).collect();
374-
let has_late_bound_regions = params
375-
.iter()
376-
.find(|param| matches!(param.kind, ty::GenericParamDefKind::Lifetime { late_bound: true }))
377-
.map(|param| tcx.def_span(param.def_id));
378373

379374
ty::Generics {
380375
parent: parent_def_id,
381376
parent_count,
382377
params,
383378
param_def_id_to_index,
384379
has_self: has_self || parent_has_self,
385-
has_late_bound_regions,
386380
}
387381
}
388382

compiler/rustc_middle/src/ty/generics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ pub struct Generics {
118118
pub param_def_id_to_index: FxHashMap<DefId, u32>,
119119

120120
pub has_self: bool,
121-
pub has_late_bound_regions: Option<Span>,
122121
}
123122

124123
impl<'tcx> Generics {

0 commit comments

Comments
 (0)