Skip to content

Commit 7e26fd6

Browse files
committed
Pass HirId in rustc_typeck::check.
1 parent 125796b commit 7e26fd6

File tree

3 files changed

+84
-71
lines changed

3 files changed

+84
-71
lines changed

compiler/rustc_middle/src/ty/util.rs

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

837837
/// Check whether a type is representable. This means it cannot contain unboxed
838838
/// structural recursion. This check is needed for structs and enums.
839-
pub fn is_representable(&'tcx self, tcx: TyCtxt<'tcx>, sp: Span) -> Representability {
839+
pub fn is_representable(&'tcx self, tcx: TyCtxt<'tcx>, hir_id: hir::HirId) -> Representability {
840840
// Iterate until something non-representable is found
841841
fn fold_repr<It: Iterator<Item = Representability>>(iter: It) -> Representability {
842842
iter.fold(Representability::Representable, |r1, r2| match (r1, r2) {
@@ -995,6 +995,7 @@ impl<'tcx> ty::TyS<'tcx> {
995995
}
996996

997997
debug!("is_type_representable: {:?}", self);
998+
let sp = tcx.hir().span(hir_id);
998999

9991000
// To avoid a stack overflow when checking an enum variant or struct that
10001001
// contains a different, structurally recursive type, maintain a stack

0 commit comments

Comments
 (0)