8000 Clean up MIR drop generation by matthewjasper · Pull Request #61872 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Clean up MIR drop generation #61872

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 6 commits into from
Jun 26, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Avoid checking if references implement drop
  • Loading branch information
matthewjasper committed Jun 25, 2019
commit 82a1a89d55305351a428247a7ad90dee77d85f04
10 changes: 0 additions & 10 deletions src/librustc_mir/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1652,11 +1652,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
// 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());
Expand All @@ -1670,11 +1665,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
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
Expand Down
0