Skip to content

Commit bce77eb

Browse files
committed
Finish all todos
1 parent 9b3c0e2 commit bce77eb

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -639,11 +639,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
639639
}
640640
}
641641

642-
ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(symbol)) => {
643-
// TODO: write a test that can trigger this path.
644-
span_bug!(span, "unstable feature {:?} not enabled", symbol);
645-
}
646-
647642
// Errors for `ConstEvaluatable` predicates show up as
648643
// `SelectionError::ConstEvalFailure`,
649644
// not `Unimplemented`.
@@ -654,6 +649,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
654649
| ty::PredicateKind::ConstEquate { .. }
655650
// Ambiguous predicates should never error
656651
| ty::PredicateKind::Ambiguous
652+
// We never return Err when proving UnstableFeature goal.
653+
| ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature{ .. })
657654
| ty::PredicateKind::NormalizesTo { .. }
658655
| ty::PredicateKind::AliasRelate { .. }
659656
| ty::PredicateKind::Clause(ty::ClauseKind::ConstArgHasType { .. }) => {

compiler/rustc_type_ir/src/flags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ impl<I: Interner> FlagComputation<I> {
401401
self.add_const(expected);
402402
self.add_const(found);
403403
}
404-
ty::PredicateKind::Ambiguous => {}
405404
ty::PredicateKind::NormalizesTo(ty::NormalizesTo { alias, term }) => {
406405
self.add_alias_term(alias);
407406
self.add_term(term);
@@ -410,7 +409,8 @@ impl<I: Interner> FlagComputation<I> {
410409
self.add_term(t1);
411410
self.add_term(t2);
412411
}
413-
ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(_)) => todo!(),
412+
ty::PredicateKind::Clause(ty::ClauseKind::UnstableFeature(_))
413+
| ty::PredicateKind::Ambiguous => {},
414414
}
415415
}
416416

src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ pub(crate) fn clean_predicate<'tcx>(
397397
ty::ClauseKind::ConstEvaluatable(..)
398398
| ty::ClauseKind::WellFormed(..)
399399
| ty::ClauseKind::ConstArgHasType(..)
400+
| ty::ClauseKind::UnstableFeature(..)
400401
// FIXME(const_trait_impl): We can probably use this `HostEffect` pred to render `~const`.
401402
| ty::ClauseKind::HostEffect(_) => None,
402-
ty::ClauseKind::UnstableFeature(_) => todo!(),
403403
}
404404
}
405405

0 commit comments

Comments
 (0)