Move a span_bug under a condition that cx is tainted
Fixes an ICE caused when a with expression is not a struct
This commit is contained in:
parent
5c08cc765a
commit
9da3638c6a
4 changed files with 27 additions and 10 deletions
|
@ -734,7 +734,9 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
|
|||
// struct; however, when EUV is run during typeck, it
|
||||
// may not. This will generate an error earlier in typeck,
|
||||
// so we can just ignore it.
|
||||
span_bug!(with_expr.span, "with expression doesn't evaluate to a struct");
|
||||
if self.cx.tainted_by_errors().is_ok() {
|
||||
span_bug!(with_expr.span, "with expression doesn't evaluate to a struct");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue