Skip to content

Commit ca56739

Browse files
Remove 3 more unused ObligationCauseCodes
1 parent 3e769c5 commit ca56739

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(hir::HirId),
424415

425416
ForLoopIterator,

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

-5
Original file line numberDiff line numberDiff line change
@@ -2592,11 +2592,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
25922592
| ObligationCauseCode::MethodReceiver
25932593
| ObligationCauseCode::ReturnNoExpression
25942594
| ObligationCauseCode::UnifyReceiver(..)
2595-
| ObligationCauseCode::OpaqueType
25962595
| ObligationCauseCode::MiscObligation
25972596
| ObligationCauseCode::WellFormed(..)
25982597
| ObligationCauseCode::MatchImpl(..)
2599-
| ObligationCauseCode::ReturnType
26002598
| ObligationCauseCode::ReturnValue(_)
26012599
| ObligationCauseCode::BlockTailExpression(..)
26022600
| ObligationCauseCode::AwaitableExpr(_)
@@ -2974,9 +2972,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
29742972
"all values live across `{what}` must have a statically known size"
29752973
));
29762974
}
2977-
ObligationCauseCode::ConstPatternStructural => {
2978-
err.note("constants used for pattern-matching must derive `PartialEq` and `Eq`");
2979-
}
29802975
ObligationCauseCode::SharedStatic => {
29812976
err.note("shared static variables must have a type that implements `Sync`");
29822977
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
14481448
| ObligationCauseCode::ExprItemObligation(..)
14491449
| ObligationCauseCode::ExprBindingObligation(..)
14501450
| ObligationCauseCode::Coercion { .. }
1451-
| ObligationCauseCode::OpaqueType
14521451
);
14531452

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

0 commit comments

Comments
 (0)