Skip to content

Commit

Permalink
Remove unused struct ClosureUpvar
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Jan 9, 2020
1 parent 7e393b5 commit dbcce10
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
7 changes: 0 additions & 7 deletions src/librustc/ty/mod.rs
Expand Up @@ -809,13 +809,6 @@ pub struct UpvarBorrow<'tcx> {
pub type UpvarListMap = FxHashMap<DefId, FxIndexMap<hir::HirId, UpvarId>>;
pub type UpvarCaptureMap<'tcx> = FxHashMap<UpvarId, UpvarCapture<'tcx>>;

#[derive(Copy, Clone, TypeFoldable)]
pub struct ClosureUpvar<'tcx> {
pub res: Res,
pub span: Span,
pub ty: Ty<'tcx>,
}

#[derive(Clone, Copy, PartialEq, Eq)]
pub enum IntVarValue {
IntType(ast::IntTy),
Expand Down
6 changes: 0 additions & 6 deletions src/librustc/ty/structural_impls.rs
Expand Up @@ -45,12 +45,6 @@ impl fmt::Debug for ty::AdtDef {
}
}

impl fmt::Debug for ty::ClosureUpvar<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "ClosureUpvar({:?},{:?})", self.res, self.ty)
}
}

impl fmt::Debug for ty::UpvarId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = ty::tls::with(|tcx| tcx.hir().name(self.var_path.hir_id));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/upvar.rs
Expand Up @@ -209,7 +209,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}

// Returns a list of `ClosureUpvar`s for each upvar.
// Returns a list of `Ty`s for each upvar.
fn final_upvar_tys(&self, closure_id: hir::HirId) -> Vec<Ty<'tcx>> {
// Presently an unboxed closure type cannot "escape" out of a
// function, so we will only encounter ones that originated in the
Expand Down

0 comments on commit dbcce10

Please sign in to comment.