Skip to content

Commit b55bab2

Browse files
committed
Add doc to ty::View
1 parent db2359b commit b55bab2

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
@@ -16,6 +16,9 @@ use crate::{
1616

1717
pub use self::ViewKind::*;
1818

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

0 commit comments

Comments
 (0)