-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Continue to borrowck even if there were previous errors #120550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8a5847f
1fcd04e
e5461de
eab2adb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -655,7 +655,17 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | |
let drops = if destination.is_some() { | ||
&mut self.scopes.breakable_scopes[break_index].break_drops | ||
} else { | ||
self.scopes.breakable_scopes[break_index].continue_drops.as_mut().unwrap() | ||
let Some(drops) = self.scopes.breakable_scopes[break_index].continue_drops.as_mut() | ||
else { | ||
self.tcx.dcx().span_delayed_bug( | ||
source_info.span, | ||
"unlabelled `continue` within labelled block", | ||
); | ||
self.cfg.terminate(block, source_info, TerminatorKind::Unreachable); | ||
|
||
return self.cfg.start_new_block().unit(); | ||
}; | ||
drops | ||
Comment on lines
+658
to
+668
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also part of the |
||
}; | ||
|
||
let drop_idx = self.scopes.scopes[scope_index + 1..] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,7 @@ enum LiveNodeKind { | |
VarDefNode(Span, HirId), | ||
ClosureNode, | ||
ExitNode, | ||
ErrNode, | ||
} | ||
|
||
fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_>) -> String { | ||
|
@@ -133,6 +134,7 @@ fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_>) -> String { | |
VarDefNode(s, _) => format!("Var def node [{}]", sm.span_to_diagnostic_string(s)), | ||
ClosureNode => "Closure node".to_owned(), | ||
ExitNode => "Exit node".to_owned(), | ||
ErrNode => "Error node".to_owned(), | ||
} | ||
} | ||
|
||
|
@@ -967,10 +969,10 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { | |
|
||
// Now that we know the label we're going to, | ||
// look it up in the continue loop nodes table | ||
self.cont_ln | ||
.get(&sc) | ||
.cloned() | ||
.unwrap_or_else(|| span_bug!(expr.span, "continue to unknown label")) | ||
self.cont_ln.get(&sc).cloned().unwrap_or_else(|| { | ||
self.ir.tcx.dcx().span_delayed_bug(expr.span, "continue to unknown label"); | ||
self.ir.add_live_node(ErrNode) | ||
}) | ||
Comment on lines
-970
to
+975
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't (yet) know that we should not be doing liveness checks, because the error happens in check_mod_loops for which we have no path to forward a taint to here ("here" being There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fwiw this (at least used to?) fire here I believe: #113379 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh neat. More evidence that those ICEs I've caused are preexisting, but hard to trigger |
||
} | ||
|
||
hir::ExprKind::Assign(ref l, ref r, _) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the motivation of this PR. removing another
has_errors
that affects compilation progressThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍