Skip to content

Commit 194f0e6

Browse files
committed
Vendor drop elaboration code which is now pub(crate)
1 parent 7cedecc commit 194f0e6

4 files changed

Lines changed: 1364 additions & 4 deletions

File tree

src/mir.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// SPDX-License-Identifier: MIT OR Apache-2.0
44

55
pub mod drop_shim;
6+
pub mod elaborate_drop;
7+
pub mod patch;
68

79
use std::sync::atomic::AtomicPtr;
810
use std::sync::atomic::Ordering;

src/mir/drop_shim.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
use rustc_abi::{FieldIdx, VariantIdx};
99
use rustc_hir::def_id::DefId;
1010
use rustc_index::{Idx, IndexVec};
11-
use rustc_middle::mir::patch::MirPatch;
1211
use rustc_middle::mir::*;
1312
use rustc_middle::ty::{self, EarlyBinder, Ty, TyCtxt, TypingEnv};
14-
use rustc_mir_dataflow::elaborate_drops::{self, *};
1513
use rustc_span::Span;
1614
use std::{fmt, iter};
1715

16+
use super::elaborate_drop::{self, *};
17+
use super::patch::MirPatch;
18+
1819
use crate::ctxt::AnalysisCtxt;
1920

2021
fn local_decls_for_sig<'tcx>(
@@ -87,13 +88,13 @@ pub fn build_drop_shim<'tcx>(
8788
};
8889
let dropee = cx.mk_place_deref(dropee_ptr);
8990
let resume_block = elaborator.patch.resume_block();
90-
elaborate_drops::elaborate_drop(
91+
elaborate_drop::elaborate_drop(
9192
&mut elaborator,
9293
source_info,
9394
dropee,
9495
(),
9596
return_block,
96-
elaborate_drops::Unwind::To(resume_block),
97+
elaborate_drop::Unwind::To(resume_block),
9798
START_BLOCK,
9899
);
99100
elaborator.patch

0 commit comments

Comments
 (0)