1
Fork 0

Fix diagnostic suggests adding type [type error]

Fixes #79040

Unresolved questions:

Why does this change output the diagnostic twice?

Why does the CI fail when the errors are pointed out (UI tests)?
This commit is contained in:
Henry Boisdequin 2021-03-03 16:50:07 +05:30
parent 1279b3b923
commit d9d69212c3
5 changed files with 27 additions and 21 deletions

View file

@ -659,7 +659,7 @@ fn infer_placeholder_type(
format!("{}: {}", item_ident, ty),
Applicability::MachineApplicable,
)
.emit();
.emit_unless(matches!(ty.kind(), ty::Error(_)));
}
None => {
let mut diag = bad_placeholder_type(tcx, vec![span]);