Imply always-const host effects the same as any other item bound

This commit is contained in:
Michael Goulet
2025-07-13 16:26:13 +00:00
parent 549a5d8b28
commit 8daf98b623
2 changed files with 20 additions and 0 deletions

View File

@@ -124,6 +124,7 @@ fn remap_gat_vars_and_recurse_into_nested_projections<'tcx>(
ty::ClauseKind::Trait(tr) => tr.self_ty(),
ty::ClauseKind::Projection(proj) => proj.projection_term.self_ty(),
ty::ClauseKind::TypeOutlives(outlives) => outlives.0,
ty::ClauseKind::HostEffect(host) => host.self_ty(),
_ => return None,
};

View File

@@ -0,0 +1,19 @@
//@ check-pass
#![feature(const_trait_impl)]
#[const_trait]
trait A where Self::Assoc: const B {
type Assoc;
}
#[const_trait]
trait B {}
fn needs_b<T: const B>() {}
fn test<T: A>() {
needs_b::<T::Assoc>();
}
fn main() {}