rust/compiler/rustc_middle/src
bors fdbc4329cb Auto merge of #108340 - eggyal:remove_traversal_trait_aliases, r=oli-obk
Remove type-traversal trait aliases

#107924 moved the type traversal (folding and visiting) traits into the type library, but created trait aliases in `rustc_middle` to minimise both the API churn for trait consumers and the arising boilerplate.  As mentioned in that PR, an alternative approach of defining subtraits with blanket implementations of the respective supertraits was also considered at that time but was ruled out as not adding much value.

Unfortunately, it has since emerged that rust-analyzer has difficulty with these trait aliases at present, resulting in a degraded contributor experience (see the recent [r-a has become useless](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/r-a.20has.20become.20useless) topic on the #t-compiler/help Zulip stream).

This PR removes the trait aliases, and accordingly the underlying type library traits are now used directly; they are parameterised by `TyCtxt<'tcx>` rather than just the `'tcx` lifetime, and imports have been updated to reflect the fact that the trait aliases' explicitly named traits are no longer automatically brought into scope.  These changes also roll-back the (no-longer required) workarounds to #107747 that were made in b409329c62.

Since this PR is just a find+replace together with the changes necessary for compilation & tidy to pass, it's currently just one mega-commit.  Let me know if you'd like it broken up.

r? `@oli-obk`
2023-02-22 18:26:51 +00:00
..
dep_graph Pass DepContext and QueryContext by value when practical 2023-02-14 17:21:18 +01:00
hir Add associated_items_for_impl_trait_in_trait query 2023-02-19 11:18:56 -03:00
infer Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
middle Remove IntoDefIdTree 2023-02-20 15:28:59 +00:00
mir Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
query Rollup merge of #108141 - spastorino:add_rpitit_queries, r=compiler-errors 2023-02-21 14:19:59 +05:30
thir address review 2023-01-27 22:13:55 +01:00
traits Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
ty Auto merge of #108340 - eggyal:remove_traversal_trait_aliases, r=oli-obk 2023-02-22 18:26:51 +00:00
util Add some docs to bug, span_bug and delay_span_bug 2022-12-30 16:47:56 +01:00
arena.rs Move the resolver into a query 2023-02-20 15:28:59 +00:00
error.rs Match crate and slug names 2022-11-21 15:24:50 +01:00
lib.rs errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
lint.rs create helper function for rustc_lint_defs::Level and remove it's duplicated code r=ozkanonur 2023-01-10 10:56:17 +03:00
macros.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
metadata.rs rustc: Parameterize ty::Visibility over used ID 2022-09-07 13:35:41 +04:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs output tree representation for thir-tree 2023-01-26 11:31:55 +01:00
values.rs Fix ICE on type alias in recursion 2023-02-17 16:20:38 +00:00