@@ -1148,14 +1148,23 @@ impl<'tcx, T: IntoIterator> Binder<'tcx, T> {
1148
1148
#[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
1149
1149
pub struct AliasTy < ' tcx > {
1150
1150
/// The parameters of the associated or opaque item.
1151
+ ///
1152
+ /// For a projection, these are the substitutions for the trait and the
1153
+ /// GAT substitutions, if there are any.
1154
+ ///
1155
+ /// For RPIT the substitutions are for the generics of the function,
1156
+ /// while for TAIT it is used for the generic parameters of the alias.
1151
1157
pub substs : SubstsRef < ' tcx > ,
1152
1158
1153
1159
/// The `DefId` of the `TraitItem` for the associated type `N` if this is a projection,
1154
1160
/// or the `OpaqueType` item if this is an opaque.
1155
1161
///
1156
- /// Note that this is not the `DefId` of the `TraitRef` containing this
1157
- /// associated type, which is in `tcx.associated_item(item_def_id).container`,
1158
- /// aka. `tcx.parent(item_def_id).unwrap()`.
1162
+ /// During codegen, `tcx.type_of(def_id)` can be used to get the type of the
1163
+ /// underlying type if the type is an opaque.
1164
+ ///
1165
+ /// Note that if this is an associated type, this is not the `DefId` of the
1166
+ /// `TraitRef` containing this associated type, which is in `tcx.associated_item(def_id).container`,
1167
+ /// aka. `tcx.parent(def_id)`.
1159
1168
pub def_id : DefId ,
1160
1169
}
1161
1170
0 commit comments