rustc: Print out region errors involving a function scope properly
This commit is contained in:
parent
e5bf6d1afa
commit
01f26249bb
1 changed files with 4 additions and 0 deletions
|
@ -85,6 +85,10 @@ fn explain_region_and_span(cx: ctxt, region: ty::Region)
|
|||
Some(ast_map::node_stmt(stmt)) => {
|
||||
explain_span(cx, "statement", stmt.span)
|
||||
}
|
||||
Some(ast_map::node_item(it, _)) if (match it.node {
|
||||
ast::item_fn(*) => true, _ => false}) => {
|
||||
explain_span(cx, "function body", it.span)
|
||||
}
|
||||
Some(_) | None => {
|
||||
// this really should not happen
|
||||
(fmt!("unknown scope: %d. Please report a bug.", node_id),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue