Skip to content

Commit a792fe3

Browse files
committed
implement 'CompressedTrait' clause kind
1 parent 65ce861 commit a792fe3

26 files changed

Lines changed: 96 additions & 3 deletions

File tree

‎compiler/rustc_hir_analysis/src/collect/clauses_of.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ pub(super) fn assert_only_contains_clauses_from<'tcx>(
780780
`{filter:?}` implied bounds: {clause:?}"
781781
);
782782
}
783+
ty::ClauseKind::CompressedTrait(_) => unreachable!(),
783784

784785
ty::ClauseKind::RegionOutlives(_)
785786
| ty::ClauseKind::ConstArgHasType(_, _)
@@ -805,6 +806,7 @@ pub(super) fn assert_only_contains_clauses_from<'tcx>(
805806
`{filter:?}` implied bounds: {clause:?}"
806807
);
807808
}
809+
ty::ClauseKind::CompressedTrait(_) => unreachable!(),
808810

809811
ty::ClauseKind::Projection(_)
810812
| ty::ClauseKind::TypeOutlives(_)

‎compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,5 +472,6 @@ fn trait_specialization_kind<'tcx>(
472472
| ty::ClauseKind::ConstEvaluatable(..)
473473
| ty::ClauseKind::UnstableFeature(_)
474474
| ty::ClauseKind::HostEffect(..) => None,
475+
ty::ClauseKind::CompressedTrait(..) => unreachable!(),
475476
}
476477
}

‎compiler/rustc_hir_analysis/src/outlives/explicit.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ impl<'tcx> ExplicitClausesMap<'tcx> {
4444
| ty::ClauseKind::ConstEvaluatable(_)
4545
| ty::ClauseKind::UnstableFeature(_)
4646
| ty::ClauseKind::HostEffect(..) => {}
47+
ty::ClauseKind::CompressedTrait(..) => unreachable!(),
4748
}
4849
}
4950

‎compiler/rustc_hir_typeck/src/fn_ctxt/inspect_obligations.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8080
| ty::PredicateKind::Clause(ty::ClauseKind::HostEffect(..))
8181
| ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(_))
8282
| ty::PredicateKind::Ambiguous => false,
83+
ty::PredicateKind::Clause(ty::ClauseKind::CompressedTrait(_)) => unreachable!(),
8384
}
8485
}
8586

‎compiler/rustc_lint/src/builtin.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
13301330
| ClauseKind::ConstEvaluatable(..)
13311331
// Users don't write this directly, only via another trait ref.
13321332
| ty::ClauseKind::HostEffect(..) => continue,
1333+
ty::ClauseKind::CompressedTrait(_) => unreachable!(),
13331334
};
13341335
if clause.is_global() {
13351336
cx.emit_span_lint(

‎compiler/rustc_middle/src/ty/generics.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ impl<'tcx> GenericClauses<'tcx> {
548548
| ClauseKind::ConstEvaluatable(_)
549549
| ClauseKind::HostEffect(_)
550550
| ClauseKind::UnstableFeature(_) => {}
551+
ClauseKind::CompressedTrait(_) => unreachable!(),
551552
}
552553
clause.visit_with(&mut ParamChecker).is_continue()
553554
})

‎compiler/rustc_middle/src/ty/print/pretty.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,6 +3273,7 @@ define_print! {
32733273
ty::ClauseKind::UnstableFeature(symbol) => {
32743274
write!(p, "feature({symbol}) is enabled")?;
32753275
}
3276+
ty::ClauseKind::CompressedTrait(_) => unreachable!(),
32763277
}
32773278
}
32783279

‎compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ where
111111
| ty::ClauseKind::WellFormed(..)
112112
| ty::ClauseKind::ConstEvaluatable(..)
113113
| ty::ClauseKind::HostEffect(..)
114-
| ty::ClauseKind::UnstableFeature(..) => {
114+
| ty::ClauseKind::UnstableFeature(..)
115+
| ty::ClauseKind::CompressedTrait(_) => {
115116
unreachable!("expected trait or projection predicate as an assumption")
116117
}
117118
});

‎compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ where
780780
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(_))
781781
| ty::PredicateKind::ConstEquate(_, _)
782782
| ty::PredicateKind::Ambiguous => LowerAvailableDepth::Yes,
783+
ty::PredicateKind::Clause(ty::ClauseKind::CompressedTrait(_)) => unreachable!(),
783784
};
784785
self.search_graph.evaluate_goal(
785786
self.cx(),
@@ -1049,6 +1050,9 @@ where
10491050
ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(symbol)) => {
10501051
ecx.compute_unstable_feature_goal(param_env, symbol)?
10511052
}
1053+
ty::PredicateKind::Clause(ty::ClauseKind::CompressedTrait(_)) => {
1054+
unreachable!();
1055+
}
10521056
ty::PredicateKind::Subtype(predicate) => {
10531057
ecx.compute_subtype_goal(Goal { param_env, predicate })?
10541058
}

‎compiler/rustc_privacy/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ where
155155
ty::ClauseKind::ConstEvaluatable(ct) => ct.visit_with(self),
156156
ty::ClauseKind::WellFormed(term) => term.visit_with(self),
157157
ty::ClauseKind::UnstableFeature(_) => V::Result::output(),
158+
ty::ClauseKind::CompressedTrait(_) => unreachable!(),
158159
}
159160
}
160161

0 commit comments

Comments
 (0)