Skip to content

Commit c79e8f4

Browse files
committed
rustc: remove unused MirSource::GeneratorDrop.
1 parent c5022f2 commit c79e8f4

File tree

6 files changed

+2
-12
lines changed

6 files changed

+2
-12
lines changed

src/librustc/mir/transform.rs

-4
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ pub enum MirSource {
3131

3232
/// Promoted rvalues within a function.
3333
Promoted(NodeId, Promoted),
34-
35-
/// Drop glue for a generator.
36-
GeneratorDrop(NodeId),
3734
}
3835

3936
impl<'a, 'gcx, 'tcx> MirSource {
@@ -70,7 +67,6 @@ impl<'a, 'gcx, 'tcx> MirSource {
7067
match *self {
7168
MirSource::Fn(id) |
7269
MirSource::Const(id) |
73-
MirSource::GeneratorDrop(id) |
7470
MirSource::Static(id, _) |
7571
MirSource::Promoted(id, _) => id
7672
}

src/librustc_mir/build/scope.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
603603
None,
604604
MirSource::Fn(_) =>
605605
Some(self.topmost_scope()),
606-
MirSource::Promoted(..) |
607-
MirSource::GeneratorDrop(..) =>
606+
MirSource::Promoted(..) =>
608607
bug!(),
609608
}
610609
}

src/librustc_mir/hair/cx/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
6464
let constness = match src {
6565
MirSource::Const(_) |
6666
MirSource::Static(..) => hir::Constness::Const,
67-
MirSource::GeneratorDrop(..) => hir::Constness::NotConst,
6867
MirSource::Fn(id) => {
6968
let fn_like = FnLikeNode::from_node(infcx.tcx.hir.get(id));
7069
fn_like.map_or(hir::Constness::NotConst, |f| f.constness())

src/librustc_mir/transform/copy_prop.rs

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ impl MirPass for CopyPropagation {
6161
return
6262
}
6363
}
64-
MirSource::GeneratorDrop(_) => (),
6564
}
6665

6766
// We only run when the MIR optimization level is > 1.

src/librustc_mir/transform/qualify_consts.rs

-1
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,6 @@ impl MirPass for QualifyAndPromoteConstants {
979979
}
980980
MirSource::Static(_, hir::MutImmutable) => Mode::Static,
981981
MirSource::Static(_, hir::MutMutable) => Mode::StaticMut,
982-
MirSource::GeneratorDrop(_) |
983982
MirSource::Promoted(..) => return
984983
};
985984

src/librustc_mir/util/pretty.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ where
114114
{
115115
let promotion_id = match source {
116116
MirSource::Promoted(_, id) => format!("-{:?}", id),
117-
MirSource::GeneratorDrop(_) => format!("-drop"),
118117
_ => String::new()
119118
};
120119

@@ -374,15 +373,14 @@ fn write_mir_sig(tcx: TyCtxt, src: MirSource, mir: &Mir, w: &mut Write)
374373
MirSource::Static(_, hir::MutImmutable) => write!(w, "static")?,
375374
MirSource::Static(_, hir::MutMutable) => write!(w, "static mut")?,
376375
MirSource::Promoted(_, i) => write!(w, "{:?} in", i)?,
377-
MirSource::GeneratorDrop(_) => write!(w, "drop_glue")?,
378376
}
379377

380378
item_path::with_forced_impl_filename_line(|| { // see notes on #41697 elsewhere
381379
write!(w, " {}", tcx.node_path_str(src.item_id()))
382380
})?;
383381

384382
match src {
385-
MirSource::Fn(_) | MirSource::GeneratorDrop(_) => {
383+
MirSource::Fn(_) => {
386384
write!(w, "(")?;
387385

388386
// fn argument types.

0 commit comments

Comments
 (0)