Skip to content

Commit 30fa6a8

Browse files
committed
Rename DropTreeBuilder::add_entry to link_entry_point
1 parent 8039906 commit 30fa6a8

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_mir_build/src/build

1 file changed

+5
-5
lines changed

compiler/rustc_mir_build/src/build/scope.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ trait DropTreeBuilder<'tcx> {
247247

248248
/// Links a block outside the drop tree, `from`, to the block `to` inside
249249
/// the drop tree.
250-
fn add_entry(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock);
250+
fn link_entry_point(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock);
251251
}
252252

253253
impl DropTree {
@@ -332,7 +332,7 @@ impl DropTree {
332332
needs_block[drop_idx] = Block::Own;
333333
while entry_points.last().is_some_and(|entry_point| entry_point.0 == drop_idx) {
334334
let entry_block = entry_points.pop().unwrap().1;
335-
T::add_entry(cfg, entry_block, block);
335+
T::link_entry_point(cfg, entry_block, block);
336336
}
337337
}
338338
match needs_block[drop_idx] {
@@ -1439,7 +1439,7 @@ impl<'tcx> DropTreeBuilder<'tcx> for ExitScopes {
14391439
fn make_block(cfg: &mut CFG<'tcx>) -> BasicBlock {
14401440
cfg.start_new_block()
14411441
}
1442-
fn add_entry(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock) {
1442+
fn link_entry_point(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock) {
14431443
cfg.block_data_mut(from).terminator_mut().kind = TerminatorKind::Goto { target: to };
14441444
}
14451445
}
@@ -1450,7 +1450,7 @@ impl<'tcx> DropTreeBuilder<'tcx> for CoroutineDrop {
14501450
fn make_block(cfg: &mut CFG<'tcx>) -> BasicBlock {
14511451
cfg.start_new_block()
14521452
}
1453-
fn add_entry(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock) {
1453+
fn link_entry_point(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock) {
14541454
let term = cfg.block_data_mut(from).terminator_mut();
14551455
if let TerminatorKind::Yield { ref mut drop, .. } = term.kind {
14561456
*drop = Some(to);
@@ -1470,7 +1470,7 @@ impl<'tcx> DropTreeBuilder<'tcx> for Unwind {
14701470
fn make_block(cfg: &mut CFG<'tcx>) -> BasicBlock {
14711471
cfg.start_new_cleanup_block()
14721472
}
1473-
fn add_entry(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock) {
1473+
fn link_entry_point(cfg: &mut CFG<'tcx>, from: BasicBlock, to: BasicBlock) {
14741474
let term = &mut cfg.block_data_mut(from).terminator_mut();
14751475
match &mut term.kind {
14761476
TerminatorKind::Drop { unwind, .. } => {

0 commit comments

Comments
 (0)