@@ -140,7 +140,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
140
140
span,
141
141
notes : reference_valid. into_iter ( ) . chain ( content_valid) . collect ( ) ,
142
142
}
143
- . into_diagnostic ( & self . tcx . sess . parse_sess . span_diagnostic )
143
+ . into_diagnostic ( self . tcx . sess . diagnostic ( ) )
144
144
}
145
145
infer:: RelateObjectBound ( span) => {
146
146
let object_valid = note_and_explain:: RegionExplanation :: new (
@@ -161,7 +161,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
161
161
span,
162
162
notes : object_valid. into_iter ( ) . chain ( pointer_valid) . collect ( ) ,
163
163
}
164
- . into_diagnostic ( & self . tcx . sess . parse_sess . span_diagnostic )
164
+ . into_diagnostic ( self . tcx . sess . diagnostic ( ) )
165
165
}
166
166
infer:: RelateParamBound ( span, ty, opt_span) => {
167
167
let prefix = match * sub {
@@ -177,7 +177,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
177
177
self . tcx , sub, opt_span, prefix, suffix,
178
178
) ;
179
179
FulfillReqLifetime { span, ty : self . resolve_vars_if_possible ( ty) , note }
180
- . into_diagnostic ( & self . tcx . sess . parse_sess . span_diagnostic )
180
+ . into_diagnostic ( self . tcx . sess . diagnostic ( ) )
181
181
}
182
182
infer:: RelateRegionParamBound ( span) => {
183
183
let param_instantiated = note_and_explain:: RegionExplanation :: new (
@@ -198,7 +198,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
198
198
span,
199
199
notes : param_instantiated. into_iter ( ) . chain ( param_must_outlive) . collect ( ) ,
200
200
}
201
- . into_diagnostic ( & self . tcx . sess . parse_sess . span_diagnostic )
201
+ . into_diagnostic ( self . tcx . sess . diagnostic ( ) )
202
202
}
203
203
infer:: ReferenceOutlivesReferent ( ty, span) => {
204
204
let pointer_valid = note_and_explain:: RegionExplanation :: new (
@@ -220,7 +220,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
220
220
ty : self . resolve_vars_if_possible ( ty) ,
221
221
notes : pointer_valid. into_iter ( ) . chain ( data_valid) . collect ( ) ,
222
222
}
223
- . into_diagnostic ( & self . tcx . sess . parse_sess . span_diagnostic )
223
+ . into_diagnostic ( self . tcx . sess . diagnostic ( ) )
224
224
}
225
225
infer:: CompareImplItemObligation { span, impl_item_def_id, trait_item_def_id } => {
226
226
let mut err = self . report_extra_impl_obligation (
@@ -281,7 +281,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
281
281
span,
282
282
notes : instantiated. into_iter ( ) . chain ( must_outlive) . collect ( ) ,
283
283
}
284
- . into_diagnostic ( & self . tcx . sess . parse_sess . span_diagnostic )
284
+ . into_diagnostic ( self . tcx . sess . diagnostic ( ) )
285
285
}
286
286
} ;
287
287
if sub. is_error ( ) || sup. is_error ( ) {
0 commit comments