1
Fork 0

TypeError can be Copy

This commit is contained in:
Michael Goulet 2022-08-13 20:43:31 +00:00
parent 801821d156
commit 75dfe55a5d
8 changed files with 37 additions and 38 deletions

View file

@ -1527,8 +1527,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
actual: Ty<'tcx>,
err: TypeError<'tcx>,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
let trace = TypeTrace::types(cause, true, expected, actual);
self.report_and_explain_type_error(trace, &err)
self.report_and_explain_type_error(TypeTrace::types(cause, true, expected, actual), err)
}
pub fn report_mismatched_consts(
@ -1538,8 +1537,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
actual: ty::Const<'tcx>,
err: TypeError<'tcx>,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
let trace = TypeTrace::consts(cause, true, expected, actual);
self.report_and_explain_type_error(trace, &err)
self.report_and_explain_type_error(TypeTrace::consts(cause, true, expected, actual), err)
}
pub fn replace_bound_vars_with_fresh_vars<T>(