Note type mismatch on ConstArgHasType
This commit is contained in:
parent
e55f73ae47
commit
6c6bd01421
4 changed files with 15 additions and 5 deletions
|
@ -1282,10 +1282,20 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
),
|
||||
|
||||
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => {
|
||||
self.tcx.sess.struct_span_err(
|
||||
let mut diag = self.tcx.sess.struct_span_err(
|
||||
span,
|
||||
&format!("the constant `{}` is not of type `{}`", ct, ty),
|
||||
)
|
||||
);
|
||||
self.note_type_err(
|
||||
&mut diag,
|
||||
&obligation.cause,
|
||||
None,
|
||||
None,
|
||||
TypeError::Sorts(ty::error::ExpectedFound::new(true, ty, ct.ty())),
|
||||
false,
|
||||
false,
|
||||
);
|
||||
diag
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue