pub fn type_error_message_str<M>(&self,
                                     sp: Span,
                                     mk_msg: M,
                                     actual_ty: String,
                                     err: Option<&ty::TypeError<'tcx>>) where
        M: FnOnce(Option<String>, String) -> String,
    {
        self.type_error_message_str_with_expected(sp, mk_msg, None, actual_ty, err)
    }
// [Note-Type-error-reporting]
// An invariant is that anytime the expected or actual type is TyError (the special
// error type, meaning that an error occurred when typechecking this expression),
// this is a derived error. The error cascaded from another error (that was already
// reported), so it's not useful to display it to the user.
// The following four methods -- type_error_message_str, type_error_message_str_with_expected,
// type_error_message, and report_mismatched_types -- implement this logic.
// They check if either the actual or expected type is TyError, and don't print the error
// in this case. The typechecker should only ever report type errors involving mismatched
// types using one of these four methods, and should not call span_err directly for such
// errors.
[Note-Type-error-reporting]
An invariant is that anytime the expected or actual type is TyError (the special
error type, meaning that an error occurred when typechecking this expression),
this is a derived error. The error cascaded from another error (that was already
reported), so it's not useful to display it to the user.
The following four methods -- type_error_message_str, type_error_message_str_with_expected,
type_error_message, and report_mismatched_types -- implement this logic.
They check if either the actual or expected type is TyError, and don't print the error
in this case. The typechecker should only ever report type errors involving mismatched
types using one of these four methods, and should not call span_err directly for such
errors.
[ Note - Type - error - reporting ] An invariant is that anytime the expected or actual type is TyError ( the special error type meaning that an error occurred when typechecking this expression ) this is a derived error . The error cascaded from another error ( that was already reported ) so it ' s not useful to display it to the user . The following four methods -- type_error_message_str type_error_message_str_with_expected type_error_message and report_mismatched_types -- implement this logic . They check if either the actual or expected type is TyError and don ' t print the error in this case . The typechecker should only ever report type errors involving mismatched types using one of these four methods and should not call span_err directly for such errors .
pub fn type_error_message_str<M>(&self,
                                     sp: Span,
                                     mk_msg: M,
                                     actual_ty: String,
                                     err: Option<&ty::TypeError<'tcx>>) where
        M: FnOnce(Option<String>, String) -> String,
    {
        self.type_error_message_str_with_expected(sp, mk_msg, None, actual_ty, err)
    }
pub fn type_error_message_str < M > ( & self , sp : Span , mk_msg : M , actual_ty : String , err : Option < & ty :: TypeError < ' tcx > > ) where M : FnOnce ( Option < String > , String ) -> String , { self . type_error_message_str_with_expected ( sp , mk_msg , None , actual_ty , err ) }
[Note-Type-error-reporting]
An invariant is that anytime the expected or actual type is TyError (the special
error type, meaning that an error occurred when typechecking this expression),
this is a derived error.
[ Note - Type - error - reporting ] An invariant is that anytime the expected or actual type is TyError ( the special error type meaning that an error occurred when typechecking this expression ) this is a derived error .
&self
sp
Span
mk_msg
M
actual_ty
String
err
Option<&ty::TypeError<'tcx>>
&self
sp
Span
mk_msg
M
actual_ty
String
err
Option<&ty::TypeError<'tcx>>