Skip to content

Commit 9e18b2d

Browse files
Remove 3 more unused ObligationCauseCodes
1 parent 3018167 commit 9e18b2d

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

compiler/rustc_middle/src/traits/mod.rs

-9
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,6 @@ pub enum ObligationCauseCode<'tcx> {
370370
origin_expr: bool,
371371
},
372372

373-
/// Constants in patterns must have `Structural` type.
374-
ConstPatternStructural,
375-
376373
/// Computing common supertype in an if expression
377374
IfExpression(Box<IfExpressionCause<'tcx>>),
378375

@@ -405,9 +402,6 @@ pub enum ObligationCauseCode<'tcx> {
405402
/// `return` with an expression
406403
ReturnValue(hir::HirId),
407404

408-
/// Return type of this function
409-
ReturnType,
410-
411405
/// Opaque return type of this function
412406
OpaqueReturnType(Option<(Ty<'tcx>, Span)>),
413407

@@ -417,9 +411,6 @@ pub enum ObligationCauseCode<'tcx> {
417411
/// #[feature(trivial_bounds)] is not enabled
418412
TrivialBound,
419413

420-
/// If `X` is the concrete type of an opaque type `impl Y`, then `X` must implement `Y`
421-
OpaqueType,
422-
423414
AwaitableExpr(Option<hir::HirId>),
424415

425416
ForLoopIterator,

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

-5
Original file line numberDiff line numberDiff line change
@@ -2593,11 +2593,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
25932593
| ObligationCauseCode::MethodReceiver
25942594
| ObligationCauseCode::ReturnNoExpression
25952595
| ObligationCauseCode::UnifyReceiver(..)
2596-
| ObligationCauseCode::OpaqueType
25972596
| ObligationCauseCode::MiscObligation
25982597
| ObligationCauseCode::WellFormed(..)
25992598
| ObligationCauseCode::MatchImpl(..)
2600-
| ObligationCauseCode::ReturnType
26012599
| ObligationCauseCode::ReturnValue(_)
26022600
| ObligationCauseCode::BlockTailExpression(..)
26032601
| ObligationCauseCode::AwaitableExpr(_)
@@ -2975,9 +2973,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
29752973
"all values live across `{what}` must have a statically known size"
29762974
));
29772975
}
2978-
ObligationCauseCode::ConstPatternStructural => {
2979-
err.note("constants used for pattern-matching must derive `PartialEq` and `Eq`");
2980-
}
29812976
ObligationCauseCode::SharedStatic => {
29822977
err.note("shared static variables must have a type that implements `Sync`");
29832978
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
14111411
| ObligationCauseCode::ExprItemObligation(..)
14121412
| ObligationCauseCode::ExprBindingObligation(..)
14131413
| ObligationCauseCode::Coercion { .. }
1414-
| ObligationCauseCode::OpaqueType
14151414
);
14161415

14171416
// constrain inference variables a bit more to nested obligations from normalize so

0 commit comments

Comments
 (0)