File tree Expand file tree Collapse file tree 2 files changed +76
-58
lines changed Expand file tree Collapse file tree 2 files changed +76
-58
lines changed Original file line number Diff line number Diff 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).
You can’t perform that action at this time.
0 commit comments