suggest adding const param

This commit is contained in:
León Orell Valerian Liehr
2023-04-07 09:00:27 +02:00
parent 32ea4bb9e3
commit f2acafe9e2
4 changed files with 100 additions and 7 deletions

View File

@@ -3458,8 +3458,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
sugg.to_string(),
Applicability::MaybeIncorrect,
))
} else if res.is_none() && matches!(source, PathSource::Type) {
this.report_missing_type_error(path)
} else if res.is_none() && let PathSource::Type | PathSource::Expr(_) = source {
this.suggest_adding_generic_parameter(path, source)
} else {
None
};