Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_hir_analysis/src/collect/item_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a good candidate for an exhaustive match

};

Expand Down
19 changes: 19 additions & 0 deletions tests/ui/traits/const-traits/imply-always-const.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Loading