Skip to content

Commit d3a1ecd

Browse files
committed
Pass HirId in librustc_typeck::check.
1 parent 312c2fb commit d3a1ecd

File tree

2 files changed

+76
-58
lines changed

2 files changed

+76
-58
lines changed

src/librustc_middle/ty/util.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ impl<'tcx> ty::TyS<'tcx> {
845845

846846
/// Check whether a type is representable. This means it cannot contain unboxed
847847
/// structural recursion. This check is needed for structs and enums.
848-
pub fn is_representable(&'tcx self, tcx: TyCtxt<'tcx>, sp: Span) -> Representability {
848+
pub fn is_representable(&'tcx self, tcx: TyCtxt<'tcx>, hir_id: hir::HirId) -> Representability {
849849
// Iterate until something non-representable is found
850850
fn fold_repr<It: Iterator<Item = Representability>>(iter: It) -> Representability {
851851
iter.fold(Representability::Representable, |r1, r2| match (r1, r2) {
@@ -1005,6 +1005,8 @@ impl<'tcx> ty::TyS<'tcx> {
10051005

10061006
debug!("is_type_representable: {:?}", self);
10071007

1008+
let sp = tcx.hir().span(hir_id);
1009+
10081010
// To avoid a stack overflow when checking an enum variant or struct that
10091011
// contains a different, structurally recursive type, maintain a stack
10101012
// of seen types and check recursion for each of them (issues #3008, #3779).

0 commit comments

Comments
 (0)