@@ -117,7 +117,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
117
117
type BoundTy = ty:: BoundTy ;
118
118
type PlaceholderType = ty:: PlaceholderType ;
119
119
type InferTy = InferTy ;
120
- type DelaySpanBugEmitted = DelaySpanBugEmitted ;
120
+ type ErrorGuaranteed = ErrorGuaranteed ;
121
121
type PredicateKind = ty:: PredicateKind < ' tcx > ;
122
122
type AllocId = crate :: mir:: interpret:: AllocId ;
123
123
@@ -128,15 +128,6 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
128
128
type PlaceholderRegion = ty:: PlaceholderRegion ;
129
129
}
130
130
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
-
140
131
type InternedSet < ' tcx , T > = ShardedHashMap < InternedInSet < ' tcx , T > , ( ) > ;
141
132
142
133
pub struct CtxtInterners < ' tcx > {
@@ -1303,7 +1294,7 @@ impl<'tcx> TyCtxt<'tcx> {
1303
1294
#[ track_caller]
1304
1295
pub fn ty_error_with_message < S : Into < MultiSpan > > ( self , span : S , msg : & str ) -> Ty < ' tcx > {
1305
1296
let reported = self . sess . delay_span_bug ( span, msg) ;
1306
- self . mk_ty ( Error ( DelaySpanBugEmitted { reported, _priv : ( ) } ) )
1297
+ self . mk_ty ( Error ( reported) )
1307
1298
}
1308
1299
1309
1300
/// Like [TyCtxt::ty_error] but for constants.
@@ -1325,10 +1316,7 @@ impl<'tcx> TyCtxt<'tcx> {
1325
1316
msg : & str ,
1326
1317
) -> Const < ' tcx > {
1327
1318
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 } )
1332
1320
}
1333
1321
1334
1322
pub fn consider_optimizing < T : Fn ( ) -> String > ( self , msg : T ) -> bool {
0 commit comments