Point (again) to more expressions with their type, even if not fully resolved
This commit is contained in:
parent
c4d741fa16
commit
1c85987274
30 changed files with 125 additions and 31 deletions
|
@ -602,7 +602,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
match *cause.code() {
|
||||
ObligationCauseCode::Pattern { origin_expr: true, span: Some(span), root_ty } => {
|
||||
let ty = self.resolve_vars_if_possible(root_ty);
|
||||
if ty.is_suggestable() {
|
||||
if !matches!(ty.kind(), ty::Infer(ty::InferTy::TyVar(_) | ty::InferTy::FreshTy(_)))
|
||||
{
|
||||
// don't show type `_`
|
||||
err.span_label(span, format!("this expression has type `{}`", ty));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue