Skip to content

Avoid cat_expr Erred notes when already in error state. #22767

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

Merged
merged 1 commit into from
Feb 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/librustc_typeck/check/regionck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,12 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
expr.span);
}
Err(..) => {
rcx.fcx.tcx().sess.span_note(expr.span,
"cat_expr_unadjusted Errd during dtor check");
let tcx = rcx.fcx.tcx();
if tcx.sess.has_errors() {
// cannot run dropck; okay b/c in error state anyway.
} else {
tcx.sess.span_bug(expr.span, "cat_expr_unadjusted Errd");
}
}
}
}
Expand All @@ -571,8 +575,12 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
check_safety_of_rvalue_destructor_if_necessary(rcx, head_cmt, expr.span);
}
Err(..) => {
rcx.fcx.tcx().sess.span_note(expr.span,
"cat_expr Errd during dtor check");
let tcx = rcx.fcx.tcx();
if tcx.sess.has_errors() {
// cannot run dropck; okay b/c in error state anyway.
} else {
tcx.sess.span_bug(expr.span, "cat_expr Errd");
}
}
}

Expand Down