diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 7cca12308e65f..0aacc5feec374 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -809,13 +809,6 @@ pub struct UpvarBorrow<'tcx> { pub type UpvarListMap = FxHashMap>; pub type UpvarCaptureMap<'tcx> = FxHashMap>; -#[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), diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index d87296c03dd2f..5e24c843025bf 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -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)); diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index be912b6bcafc0..a1922166fe265 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -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> { // Presently an unboxed closure type cannot "escape" out of a // function, so we will only encounter ones that originated in the