diff --git a/src/librustc/ty/view.rs b/src/librustc/ty/view.rs index f2d62b42ad2ab..5df14efb0647f 100644 --- a/src/librustc/ty/view.rs +++ b/src/librustc/ty/view.rs @@ -16,6 +16,9 @@ use crate::{ pub use self::ViewKind::*; +/// `View<'tcx, T>` contains a value of `T` but stores the `Ty<'tcx>` ptr that contains the `T` +/// This allows for cheap access to the `Ty<'tcx>` without needing to ask the type interner or +/// losing the `T` type. #[derive(TypeFoldable, Lift)] pub struct View<'tcx, T> { ty: Ty<'tcx>,