rustc: remove unused MirSource::GeneratorDrop.
This commit is contained in:
parent
c5022f2f16
commit
c79e8f4d1d
6 changed files with 2 additions and 12 deletions
|
|
@ -31,9 +31,6 @@ pub enum MirSource {
|
|||
|
||||
/// Promoted rvalues within a function.
|
||||
Promoted(NodeId, Promoted),
|
||||
|
||||
/// Drop glue for a generator.
|
||||
GeneratorDrop(NodeId),
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> MirSource {
|
||||
|
|
@ -70,7 +67,6 @@ impl<'a, 'gcx, 'tcx> MirSource {
|
|||
match *self {
|
||||
MirSource::Fn(id) |
|
||||
MirSource::Const(id) |
|
||||
MirSource::GeneratorDrop(id) |
|
||||
MirSource::Static(id, _) |
|
||||
MirSource::Promoted(id, _) => id
|
||||
}
|
||||
|
|
|
|||
|
|
@ -603,8 +603,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
|
|||
None,
|
||||
MirSource::Fn(_) =>
|
||||
Some(self.topmost_scope()),
|
||||
MirSource::Promoted(..) |
|
||||
MirSource::GeneratorDrop(..) =>
|
||||
MirSource::Promoted(..) =>
|
||||
bug!(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
|
|||
let constness = match src {
|
||||
MirSource::Const(_) |
|
||||
MirSource::Static(..) => hir::Constness::Const,
|
||||
MirSource::GeneratorDrop(..) => hir::Constness::NotConst,
|
||||
MirSource::Fn(id) => {
|
||||
let fn_like = FnLikeNode::from_node(infcx.tcx.hir.get(id));
|
||||
fn_like.map_or(hir::Constness::NotConst, |f| f.constness())
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ impl MirPass for CopyPropagation {
|
|||
return
|
||||
}
|
||||
}
|
||||
MirSource::GeneratorDrop(_) => (),
|
||||
}
|
||||
|
||||
// We only run when the MIR optimization level is > 1.
|
||||
|
|
|
|||
|
|
@ -979,7 +979,6 @@ impl MirPass for QualifyAndPromoteConstants {
|
|||
}
|
||||
MirSource::Static(_, hir::MutImmutable) => Mode::Static,
|
||||
MirSource::Static(_, hir::MutMutable) => Mode::StaticMut,
|
||||
MirSource::GeneratorDrop(_) |
|
||||
MirSource::Promoted(..) => return
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ where
|
|||
{
|
||||
let promotion_id = match source {
|
||||
MirSource::Promoted(_, id) => format!("-{:?}", id),
|
||||
MirSource::GeneratorDrop(_) => format!("-drop"),
|
||||
_ => String::new()
|
||||
};
|
||||
|
||||
|
|
@ -374,7 +373,6 @@ fn write_mir_sig(tcx: TyCtxt, src: MirSource, mir: &Mir, w: &mut Write)
|
|||
MirSource::Static(_, hir::MutImmutable) => write!(w, "static")?,
|
||||
MirSource::Static(_, hir::MutMutable) => write!(w, "static mut")?,
|
||||
MirSource::Promoted(_, i) => write!(w, "{:?} in", i)?,
|
||||
MirSource::GeneratorDrop(_) => write!(w, "drop_glue")?,
|
||||
}
|
||||
|
||||
item_path::with_forced_impl_filename_line(|| { // see notes on #41697 elsewhere
|
||||
|
|
@ -382,7 +380,7 @@ fn write_mir_sig(tcx: TyCtxt, src: MirSource, mir: &Mir, w: &mut Write)
|
|||
})?;
|
||||
|
||||
match src {
|
||||
MirSource::Fn(_) | MirSource::GeneratorDrop(_) => {
|
||||
MirSource::Fn(_) => {
|
||||
write!(w, "(")?;
|
||||
|
||||
// fn argument types.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue