Point at return type when it influences non-first match
arm
When encountering code like ```rust fn foo() -> i32 { match 0 { 1 => return 0, 2 => "", _ => 1, } } ``` Point at the return type and not at the prior arm, as that arm has type `!` which isn't influencing the arm corresponding to arm `2`. Fix #78124.
This commit is contained in:
parent
4cea2bc339
commit
55f8c66a60
12 changed files with 129 additions and 21 deletions
|
@ -402,7 +402,7 @@ pub enum ObligationCauseCode<'tcx> {
|
|||
OpaqueReturnType(Option<(Ty<'tcx>, Span)>),
|
||||
|
||||
/// Block implicit return
|
||||
BlockTailExpression(hir::HirId),
|
||||
BlockTailExpression(hir::HirId, hir::HirId, hir::MatchSource),
|
||||
|
||||
/// #[feature(trivial_bounds)] is not enabled
|
||||
TrivialBound,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue