Skip to content

Commit 8daf98b

Browse files
Imply always-const host effects the same as any other item bound
1 parent 549a5d8 commit 8daf98b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ fn remap_gat_vars_and_recurse_into_nested_projections<'tcx>(
124124
ty::ClauseKind::Trait(tr) => tr.self_ty(),
125125
ty::ClauseKind::Projection(proj) => proj.projection_term.self_ty(),
126126
ty::ClauseKind::TypeOutlives(outlives) => outlives.0,
127+
ty::ClauseKind::HostEffect(host) => host.self_ty(),
127128
_ => return None,
128129
};
129130

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ check-pass
2+
3+
#![feature(const_trait_impl)]
4+
5+
#[const_trait]
6+
trait A where Self::Assoc: const B {
7+
type Assoc;
8+
}
9+
10+
#[const_trait]
11+
trait B {}
12+
13+
fn needs_b<T: const B>() {}
14+
15+
fn test<T: A>() {
16+
needs_b::<T::Assoc>();
17+
}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)