diff options
| author | Michael Goulet <michael@errs.io> | 2025-06-25 16:11:28 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-06-26 03:43:01 +0000 |
| commit | 59e1a3cbf589032f95eb1c9453025cca6eee2420 (patch) | |
| tree | 66ffe8abfee2d48f5794609359d2d031becff964 /compiler/rustc_middle/src/traits/mod.rs | |
| parent | bc4376fa73b636eb6f2c7d48b1f731d70f022c4b (diff) | |
| download | rust-59e1a3cbf589032f95eb1c9453025cca6eee2420.tar.gz rust-59e1a3cbf589032f95eb1c9453025cca6eee2420.zip | |
Simplify IfCause
Diffstat (limited to 'compiler/rustc_middle/src/traits/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/traits/mod.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs index d877bd5c626..1a5a9765ce7 100644 --- a/compiler/rustc_middle/src/traits/mod.rs +++ b/compiler/rustc_middle/src/traits/mod.rs @@ -332,7 +332,11 @@ pub enum ObligationCauseCode<'tcx> { }, /// Computing common supertype in an if expression - IfExpression(Box<IfExpressionCause<'tcx>>), + IfExpression { + expr_id: HirId, + // Is the expectation of this match expression an RPIT? + tail_defines_return_position_impl_trait: Option<LocalDefId>, + }, /// Computing common supertype of an if expression with no else counter-part IfExpressionWithNoElse, @@ -550,18 +554,6 @@ pub struct PatternOriginExpr { pub peeled_prefix_suggestion_parentheses: bool, } -#[derive(Copy, Clone, Debug, PartialEq, Eq)] -#[derive(TypeFoldable, TypeVisitable, HashStable, TyEncodable, TyDecodable)] -pub struct IfExpressionCause<'tcx> { - pub then_id: HirId, - pub else_id: HirId, - pub then_ty: Ty<'tcx>, - pub else_ty: Ty<'tcx>, - pub outer_span: Option<Span>, - // Is the expectation of this match expression an RPIT? - pub tail_defines_return_position_impl_trait: Option<LocalDefId>, -} - #[derive(Clone, Debug, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)] #[derive(TypeVisitable, TypeFoldable)] pub struct DerivedCause<'tcx> { |
