Skip to content

Commit 0ca62cc

Browse files
committed
Add doc to ty::View
1 parent 130e2b7 commit 0ca62cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc/ty/view.rs

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ use rustc_hir::{self as hir, def_id::DefId};
1414

1515
pub use self::ViewKind::*;
1616

17+
/// `View<'tcx, T>` contains a value of `T` but stores the `Ty<'tcx>` ptr that contains the `T`
18+
/// This allows for cheap access to the `Ty<'tcx>` without needing to ask the type interner or
19+
/// losing the `T` type.
1720
#[derive(TypeFoldable, Lift)]
1821
pub struct View<'tcx, T> {
1922
ty: Ty<'tcx>,

0 commit comments

Comments
 (0)