Auto merge of #108700 - spastorino:new-rpitit-impl-side-2, r=compiler-errors
Make RPITITs simple cases work when using lower_impl_trait_in_trait_to_assoc_ty r? `@compiler-errors` It's probably best reviewed commit by commit.
This commit is contained in:
commit
9455a5591b
11 changed files with 164 additions and 35 deletions
|
@ -1333,6 +1333,7 @@ rustc_queries! {
|
|||
/// might want to use `reveal_all()` method to change modes.
|
||||
query param_env(def_id: DefId) -> ty::ParamEnv<'tcx> {
|
||||
desc { |tcx| "computing normalized predicates of `{}`", tcx.def_path_str(def_id) }
|
||||
feedable
|
||||
}
|
||||
|
||||
/// Like `param_env`, but returns the `ParamEnv` in `Reveal::All` mode.
|
||||
|
|
|
@ -2445,6 +2445,18 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
pub fn trait_solver_next(self) -> bool {
|
||||
self.sess.opts.unstable_opts.trait_solver == rustc_session::config::TraitSolver::Next
|
||||
}
|
||||
|
||||
pub fn lower_impl_trait_in_trait_to_assoc_ty(self) -> bool {
|
||||
self.sess.opts.unstable_opts.lower_impl_trait_in_trait_to_assoc_ty
|
||||
}
|
||||
|
||||
pub fn is_impl_trait_in_trait(self, def_id: DefId) -> bool {
|
||||
if self.lower_impl_trait_in_trait_to_assoc_ty() {
|
||||
self.def_kind(def_id) == DefKind::AssocTy && self.opt_rpitit_info(def_id).is_some()
|
||||
} else {
|
||||
self.def_kind(def_id) == DefKind::ImplTraitPlaceholder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> TyCtxtAt<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue