-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #122527 - fmease:clean-up-hir-ty-lowering, r=compiler…
…-errors Clean up AstConv Split off from #120926 to make it only contain the renaming & (doc) comment updates. Any changes other than that which have accumulated over time are now part of this PR. Let's be disciplined ;) Inspired by #120926 (comment). --- * Remove `hir_trait_to_predicates` * Unused since #113671 * Inline `create_args_for_ast_trait_ref` * Only had a single call site * Having it as a separate method didn't gain us anything * Use an if-let guard somewhere to avoid unwrapping * Avoid explicit trait object lifetimes * More legible, stylistic-only (the updated code is 100% semantically identical) * Use explicitly elided lifetimes in impl headers, they get elaborated to distinct lifetimes * Make use of [object lifetime defaulting](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) for a trait object type inside of a reference type somewhere * Use preexisting dedicated method `ItemCtxt::to_ty` over `<dyn AstConv<'_>>::ast_ty_to_ty` * Use preexisting dedicated method `AstConv::astconv` over explicit coercions * Simplify the function signature of `create_args_for_ast_path` and of `check_generic_arg_count` * In both cases redundant information was passed rendering the call sites verbose and confusing * No perf impact (tested in [#120926](#120926)) * Move diagnostic method `report_ambiguous_associated_type` from `astconv` to `astconv::errors` * The submodule `errors` exists specifically for that purpose * Use it to keep the main module clean & short
- Loading branch information
Showing
8 changed files
with
142 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.