This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed
compiler/rustc_hir_analysis/src/collect
tests/ui/traits/const-traits Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -711,12 +711,19 @@ pub(super) fn assert_only_contains_predicates_from<'tcx>(
711711 `{filter:?}` implied bounds: {clause:?}"
712712 ) ;
713713 }
714+ ty:: ClauseKind :: HostEffect ( host_effect_predicate) => {
715+ assert_eq ! (
716+ host_effect_predicate. self_ty( ) ,
717+ ty,
718+ "expected `Self` predicate when computing \
719+ `{filter:?}` implied bounds: {clause:?}"
720+ ) ;
721+ }
714722
715723 ty:: ClauseKind :: RegionOutlives ( _)
716724 | ty:: ClauseKind :: ConstArgHasType ( _, _)
717725 | ty:: ClauseKind :: WellFormed ( _)
718- | ty:: ClauseKind :: ConstEvaluatable ( _)
719- | ty:: ClauseKind :: HostEffect ( ..) => {
726+ | ty:: ClauseKind :: ConstEvaluatable ( _) => {
720727 bug ! (
721728 "unexpected non-`Self` predicate when computing \
722729 `{filter:?}` implied bounds: {clause:?}"
Original file line number Diff line number Diff line change 1+ // Regression test for <https://github.com/rust-lang/rust/issues/133526>.
2+
3+ // Ensures we don't ICE when we encounter a `HostEffectPredicate` when computing
4+ // the "item super predicates" for `Assoc`.
5+
6+ //@ compile-flags: -Znext-solver
7+ //@ check-pass
8+
9+ #![ feature( const_trait_impl) ]
10+
11+ #[ const_trait]
12+ trait Trait {
13+ type Assoc : const Trait ;
14+ }
15+
16+ const fn needs_trait < T : ~const Trait > ( ) { }
17+
18+ fn test < T : Trait > ( ) {
19+ const { needs_trait :: < T :: Assoc > ( ) } ;
20+ }
21+
22+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments