@@ -117,7 +117,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
117117 type BoundTy = ty:: BoundTy ;
118118 type PlaceholderType = ty:: PlaceholderType ;
119119 type InferTy = InferTy ;
120- type DelaySpanBugEmitted = DelaySpanBugEmitted ;
120+ type ErrorGuaranteed = ErrorGuaranteed ;
121121 type PredicateKind = ty:: PredicateKind < ' tcx > ;
122122 type AllocId = crate :: mir:: interpret:: AllocId ;
123123
@@ -128,15 +128,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
128128 type PlaceholderRegion = ty:: PlaceholderRegion ;
129129}
130130
131- /// A type that is not publicly constructable. This prevents people from making [`TyKind::Error`]s
132- /// except through the error-reporting functions on a [`tcx`][TyCtxt].
133- #[ derive( Copy , Clone , Debug , Eq , Hash , PartialEq , PartialOrd , Ord ) ]
134- #[ derive( TyEncodable , TyDecodable , HashStable ) ]
135- pub struct DelaySpanBugEmitted {
136- pub reported : ErrorGuaranteed ,
137- _priv : ( ) ,
138- }
139-
140131type InternedSet < ' tcx , T > = ShardedHashMap < InternedInSet < ' tcx , T > , ( ) > ;
141132
142133pub struct CtxtInterners < ' tcx > {
@@ -1303,7 +1294,7 @@ impl<'tcx> TyCtxt<'tcx> {
13031294 #[ track_caller]
13041295 pub fn ty_error_with_message < S : Into < MultiSpan > > ( self , span : S , msg : & str ) -> Ty < ' tcx > {
13051296 let reported = self . sess . delay_span_bug ( span, msg) ;
1306- self . mk_ty ( Error ( DelaySpanBugEmitted { reported, _priv : ( ) } ) )
1297+ self . mk_ty ( Error ( reported) )
13071298 }
13081299
13091300 /// Like [TyCtxt::ty_error] but for constants.
@@ -1325,10 +1316,7 @@ impl<'tcx> TyCtxt<'tcx> {
13251316 msg : & str ,
13261317 ) -> Const < ' tcx > {
13271318 let reported = self . sess . delay_span_bug ( span, msg) ;
1328- self . mk_const ( ty:: ConstS {
1329- kind : ty:: ConstKind :: Error ( DelaySpanBugEmitted { reported, _priv : ( ) } ) ,
1330- ty,
1331- } )
1319+ self . mk_const ( ty:: ConstS { kind : ty:: ConstKind :: Error ( reported) , ty } )
13321320 }
13331321
13341322 pub fn consider_optimizing < T : Fn ( ) -> String > ( self , msg : T ) -> bool {
0 commit comments