nit: docs

This commit is contained in:
Michael Goulet 2022-12-06 03:30:58 +00:00
parent 4b19a2c119
commit 0f9e414092
1 changed files with 12 additions and 3 deletions

View File

@ -1148,14 +1148,23 @@ impl<'tcx, T: IntoIterator> Binder<'tcx, T> {
#[derive(HashStable, TypeFoldable, TypeVisitable, Lift)]
pub struct AliasTy<'tcx> {
/// The parameters of the associated or opaque item.
///
/// For a projection, these are the substitutions for the trait and the
/// GAT substitutions, if there are any.
///
/// For RPIT the substitutions are for the generics of the function,
/// while for TAIT it is used for the generic parameters of the alias.
pub substs: SubstsRef<'tcx>,
/// The `DefId` of the `TraitItem` for the associated type `N` if this is a projection,
/// or the `OpaqueType` item if this is an opaque.
///
/// Note that this is not the `DefId` of the `TraitRef` containing this
/// associated type, which is in `tcx.associated_item(item_def_id).container`,
/// aka. `tcx.parent(item_def_id).unwrap()`.
/// During codegen, `tcx.type_of(def_id)` can be used to get the type of the
/// underlying type if the type is an opaque.
///
/// Note that if this is an associated type, this is not the `DefId` of the
/// `TraitRef` containing this associated type, which is in `tcx.associated_item(def_id).container`,
/// aka. `tcx.parent(def_id)`.
pub def_id: DefId,
}