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> {
845
845
846
846
/// Check whether a type is representable. This means it cannot contain unboxed
847
847
/// 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 {
849
849
// Iterate until something non-representable is found
850
850
fn fold_repr < It : Iterator < Item = Representability > > ( iter : It ) -> Representability {
851
851
iter. fold ( Representability :: Representable , |r1, r2| match ( r1, r2) {
@@ -1005,6 +1005,8 @@ impl<'tcx> ty::TyS<'tcx> {
1005
1005
1006
1006
debug ! ( "is_type_representable: {:?}" , self ) ;
1007
1007
1008
+ let sp = tcx. hir ( ) . span ( hir_id) ;
1009
+
1008
1010
// To avoid a stack overflow when checking an enum variant or struct that
1009
1011
// contains a different, structurally recursive type, maintain a stack
1010
1012
// 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