@@ -33,7 +33,7 @@ pub struct FuncDefDiagAccumulator(pub(super) TyDiagCollection);
3333#[ salsa:: accumulator]
3434pub struct TypeAliasDefDiagAccumulator ( pub ( super ) TyDiagCollection ) ;
3535#[ salsa:: accumulator]
36- pub struct RecursiveAdtConstituentAccumulator ( pub ( super ) AdtRecursionConstituent ) ;
36+ pub struct AdtRecursionConstituentAccumulator ( pub ( super ) AdtRecursionConstituent ) ;
3737
3838#[ derive( Debug , PartialEq , Eq , Hash , Clone , derive_more:: From ) ]
3939pub enum TyDiagCollection {
@@ -58,7 +58,7 @@ impl TyDiagCollection {
5858pub enum TyLowerDiag {
5959 NotFullyAppliedType ( DynLazySpan ) ,
6060 InvalidTypeArgKind ( DynLazySpan , String ) ,
61- RecursiveType ( Vec < AdtRecursionConstituent > ) ,
61+ AdtRecursion ( Vec < AdtRecursionConstituent > ) ,
6262
6363 UnboundTypeAliasParam {
6464 span : DynLazySpan ,
@@ -117,8 +117,8 @@ impl TyLowerDiag {
117117 Self :: InvalidTypeArgKind ( span, msg)
118118 }
119119
120- pub ( super ) fn recursive_type ( constituents : Vec < AdtRecursionConstituent > ) -> Self {
121- Self :: RecursiveType ( constituents)
120+ pub ( super ) fn adt_recursion ( constituents : Vec < AdtRecursionConstituent > ) -> Self {
121+ Self :: AdtRecursion ( constituents)
122122 }
123123
124124 pub ( super ) fn unbound_type_alias_param (
@@ -181,7 +181,7 @@ impl TyLowerDiag {
181181 match self {
182182 Self :: NotFullyAppliedType ( _) => 0 ,
183183 Self :: InvalidTypeArgKind ( _, _) => 1 ,
184- Self :: RecursiveType { .. } => 2 ,
184+ Self :: AdtRecursion { .. } => 2 ,
185185 Self :: UnboundTypeAliasParam { .. } => 3 ,
186186 Self :: TypeAliasCycle { .. } => 4 ,
187187 Self :: InconsistentKindBound ( _, _) => 5 ,
@@ -196,7 +196,7 @@ impl TyLowerDiag {
196196 match self {
197197 Self :: NotFullyAppliedType ( _) => "expected fully applied type" . to_string ( ) ,
198198 Self :: InvalidTypeArgKind ( _, _) => "invalid type argument kind" . to_string ( ) ,
199- Self :: RecursiveType { .. } => "recursive type is not allowed" . to_string ( ) ,
199+ Self :: AdtRecursion { .. } => "recursive type is not allowed" . to_string ( ) ,
200200
201201 Self :: UnboundTypeAliasParam { .. } => {
202202 "all type parameters of type alias must be given" . to_string ( )
@@ -232,7 +232,7 @@ impl TyLowerDiag {
232232 span. resolve( db) ,
233233 ) ] ,
234234
235- Self :: RecursiveType ( constituents) => {
235+ Self :: AdtRecursion ( constituents) => {
236236 let mut diags = vec ! [ ] ;
237237
238238 for AdtRecursionConstituent { from, to } in constituents {
@@ -1109,7 +1109,7 @@ pub fn adt_recursion_diags(constituents: &[AdtRecursionConstituent]) -> Vec<TyDi
11091109 // Constituents in this set cannot be used to construct other recursions.
11101110 let mut unified_constituents = indexset ! { } ;
11111111
1112- // `cur` is initially set to the first item in `constituents` that has not been included in another recursion.
1112+ // `cur` is set to the first item in `constituents` that has not been included in another recursion.
11131113 while let Some ( mut cur) =
11141114 ( 0 ..constituents. len ( ) ) . find ( |index| !unified_constituents. contains ( index) )
11151115 {
@@ -1132,7 +1132,7 @@ pub fn adt_recursion_diags(constituents: &[AdtRecursionConstituent]) -> Vec<TyDi
11321132 }
11331133
11341134 diags. push (
1135- TyLowerDiag :: recursive_type (
1135+ TyLowerDiag :: adt_recursion (
11361136 recursion
11371137 . iter ( )
11381138 . map ( |index| constituents[ * index] . to_owned ( ) )
@@ -1147,7 +1147,7 @@ pub fn adt_recursion_diags(constituents: &[AdtRecursionConstituent]) -> Vec<TyDi
11471147
11481148/// Constituent of an ADT recursion.
11491149///
1150- /// A full ADT recursion can be represented using a list of `AdtRecursionConstituents` .
1150+ /// A full ADT recursion can be represented using a list of `AdtRecursionConstituent`s .
11511151#[ derive( Clone , Debug , Eq , PartialEq , Hash ) ]
11521152pub struct AdtRecursionConstituent {
11531153 /// The ADT definition from which the constituent originates and its name span.
0 commit comments