Remove Session
methods that duplicate DiagCtxt
methods.
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
This commit is contained in:
parent
d51db05d7e
commit
99472c7049
298 changed files with 1806 additions and 2064 deletions
|
@ -28,7 +28,7 @@ impl<'tcx> StructuredDiagnostic<'tcx> for MissingCastForVariadicArg<'tcx, '_> {
|
|||
(None, "".to_string(), Some(()))
|
||||
};
|
||||
|
||||
let mut err = self.sess.create_err(errors::PassToVariadicFunction {
|
||||
let mut err = self.sess.dcx().create_err(errors::PassToVariadicFunction {
|
||||
span: self.span,
|
||||
ty: self.ty,
|
||||
cast_ty: self.cast_ty,
|
||||
|
|
|
@ -21,7 +21,7 @@ impl<'tcx> StructuredDiagnostic<'tcx> for SizedUnsizedCast<'tcx> {
|
|||
}
|
||||
|
||||
fn diagnostic_common(&self) -> DiagnosticBuilder<'tcx> {
|
||||
let mut err = self.sess.create_err(errors::CastThinPointerToFatPointer {
|
||||
let mut err = self.sess.dcx().create_err(errors::CastThinPointerToFatPointer {
|
||||
span: self.span,
|
||||
expr_ty: self.expr_ty,
|
||||
cast_ty: self.cast_ty.to_owned(),
|
||||
|
|
|
@ -524,7 +524,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
|
|||
let span = self.path_segment.ident.span;
|
||||
let msg = self.create_error_message();
|
||||
|
||||
self.tcx.sess.struct_span_err_with_code(span, msg, self.code())
|
||||
self.tcx.dcx().struct_span_err_with_code(span, msg, self.code())
|
||||
}
|
||||
|
||||
/// Builds the `expected 1 type argument / supplied 2 type arguments` message.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue