提交 82a1a89d 编写于 作者: M Matthew Jasper

Avoid checking if references implement drop

上级 101a2f59
......@@ -1652,11 +1652,6 @@ fn bind_matched_candidate_for_guard(
// denotes *R.
let ref_for_guard =
self.storage_live_binding(block, binding.var_id, binding.span, RefWithinGuard);
// Question: Why schedule drops if bindings are all
// shared-&'s?
// Answer: Because schedule_drop_for_binding also emits
// StorageDead's for those locals.
self.schedule_drop_for_binding(binding.var_id, binding.span, RefWithinGuard);
match binding.binding_mode {
BindingMode::ByValue => {
let rvalue = Rvalue::Ref(re_erased, BorrowKind::Shared, binding.source.clone());
......@@ -1670,11 +1665,6 @@ fn bind_matched_candidate_for_guard(
binding.span,
OutsideGuard,
);
self.schedule_drop_for_binding(
binding.var_id,
binding.span,
OutsideGuard,
);
let rvalue = Rvalue::Ref(re_erased, borrow_kind, binding.source.clone());
self.cfg
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册