]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #97778 - compiler-errors:misc-diagnostics-tidy, r=cjgillot
authorbors <bors@rust-lang.org>
Sun, 12 Jun 2022 00:47:54 +0000 (00:47 +0000)
committerbors <bors@rust-lang.org>
Sun, 12 Jun 2022 00:47:54 +0000 (00:47 +0000)
Tidy up miscellaneous bounds suggestions

Just some small fixes to suggestions

- Generalizes `Ty::is_suggestable` into a `TypeVisitor`, so that it can be called on things other than `Ty`
- Makes `impl Trait` in arg position no longer suggestible (generalizing the fix in #97640)
- Fixes `impl Trait` not being replaced with fresh type param when it's deeply nested in function signature (fixes #97760)
- Fixes some poor handling of `where` clauses with no predicates (also #97760)
- Uses `InferCtxt::resolve_numeric_literals_with_default` so we suggest `i32` instead of `{integer}` (fixes #97677)

Sorry there aren't many tests the fixes. Most of them would just be duplicates of other tests with empty `where` clauses or `impl Trait` in arg position instead of generic params. Let me know if you'd want more test coverage.


Trivial merge