Skip to content

Commit 6973fef

Browse files
committed
Remove MirSource::from_instance helper that is only used in one place
It used to be much more prevalent before I extracted shims as their own enum.
1 parent 95d68a6 commit 6973fef

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ impl<'tcx> MirSource<'tcx> {
127127
MirSource { instance: InstanceKind::Item(def_id), promoted: None }
128128
}
129129

130-
pub fn from_instance(instance: InstanceKind<'tcx>) -> Self {
131-
MirSource { instance, promoted: None }
132-
}
133-
134130
pub fn from_shim(shim: ShimKind<'tcx>) -> Self {
135131
MirSource { instance: InstanceKind::Shim(shim), promoted: None }
136132
}

compiler/rustc_mir_transform/src/coroutine/by_move_body.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,10 @@ pub(crate) fn coroutine_by_move_body_def_id<'tcx>(
223223
None,
224224
&mut PerParentDisambiguatorState::new(parent_def_id),
225225
);
226-
by_move_body.source =
227-
mir::MirSource::from_instance(InstanceKind::Item(body_def.def_id().to_def_id()));
226+
by_move_body.source = mir::MirSource {
227+
instance: InstanceKind::Item(body_def.def_id().to_def_id()),
228+
promoted: None,
229+
};
228230

229231
if let Some(dumper) = MirDumper::new(tcx, "built", &by_move_body) {
230232
dumper.set_disambiguator(&"after").dump_mir(&by_move_body);

0 commit comments

Comments
 (0)