未验证 提交 f6fee2a4 编写于 作者: D David Wood

Fixed off-by-one spans in MIR borrowck errors.

上级 6d00c968
......@@ -695,10 +695,17 @@ pub fn schedule_drop(&mut self,
if let DropKind::Value { .. } = drop_kind {
scope.needs_cleanup = true;
}
let region_scope_span = region_scope.span(self.hir.tcx(),
&self.hir.region_scope_tree);
// Attribute scope exit drops to scope's closing brace
let scope_end = region_scope_span.with_lo(region_scope_span.hi());
// Attribute scope exit drops to scope's closing brace.
// Without this check when finding the endpoint, we'll run into an ICE.
let scope_end = if region_scope_span.hi().0 == 0 {
region_scope_span
} else {
region_scope_span.end_point()
};
scope.drops.push(DropData {
span: scope_end,
location: place.clone(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册