@@ -33,7 +33,7 @@ pub struct FuncDefDiagAccumulator(pub(super) TyDiagCollection);
33
33
#[ salsa:: accumulator]
34
34
pub struct TypeAliasDefDiagAccumulator ( pub ( super ) TyDiagCollection ) ;
35
35
#[ salsa:: accumulator]
36
- pub struct RecursiveAdtConstituentAccumulator ( pub ( super ) AdtRecursionConstituent ) ;
36
+ pub struct AdtRecursionConstituentAccumulator ( pub ( super ) AdtRecursionConstituent ) ;
37
37
38
38
#[ derive( Debug , PartialEq , Eq , Hash , Clone , derive_more:: From ) ]
39
39
pub enum TyDiagCollection {
@@ -58,7 +58,7 @@ impl TyDiagCollection {
58
58
pub enum TyLowerDiag {
59
59
NotFullyAppliedType ( DynLazySpan ) ,
60
60
InvalidTypeArgKind ( DynLazySpan , String ) ,
61
- RecursiveType ( Vec < AdtRecursionConstituent > ) ,
61
+ AdtRecursion ( Vec < AdtRecursionConstituent > ) ,
62
62
63
63
UnboundTypeAliasParam {
64
64
span : DynLazySpan ,
@@ -117,8 +117,8 @@ impl TyLowerDiag {
117
117
Self :: InvalidTypeArgKind ( span, msg)
118
118
}
119
119
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)
122
122
}
123
123
124
124
pub ( super ) fn unbound_type_alias_param (
@@ -181,7 +181,7 @@ impl TyLowerDiag {
181
181
match self {
182
182
Self :: NotFullyAppliedType ( _) => 0 ,
183
183
Self :: InvalidTypeArgKind ( _, _) => 1 ,
184
- Self :: RecursiveType { .. } => 2 ,
184
+ Self :: AdtRecursion { .. } => 2 ,
185
185
Self :: UnboundTypeAliasParam { .. } => 3 ,
186
186
Self :: TypeAliasCycle { .. } => 4 ,
187
187
Self :: InconsistentKindBound ( _, _) => 5 ,
@@ -196,7 +196,7 @@ impl TyLowerDiag {
196
196
match self {
197
197
Self :: NotFullyAppliedType ( _) => "expected fully applied type" . to_string ( ) ,
198
198
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 ( ) ,
200
200
201
201
Self :: UnboundTypeAliasParam { .. } => {
202
202
"all type parameters of type alias must be given" . to_string ( )
@@ -232,7 +232,7 @@ impl TyLowerDiag {
232
232
span. resolve( db) ,
233
233
) ] ,
234
234
235
- Self :: RecursiveType ( constituents) => {
235
+ Self :: AdtRecursion ( constituents) => {
236
236
let mut diags = vec ! [ ] ;
237
237
238
238
for AdtRecursionConstituent { from, to } in constituents {
@@ -1109,7 +1109,7 @@ pub fn adt_recursion_diags(constituents: &[AdtRecursionConstituent]) -> Vec<TyDi
1109
1109
// Constituents in this set cannot be used to construct other recursions.
1110
1110
let mut unified_constituents = indexset ! { } ;
1111
1111
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.
1113
1113
while let Some ( mut cur) =
1114
1114
( 0 ..constituents. len ( ) ) . find ( |index| !unified_constituents. contains ( index) )
1115
1115
{
@@ -1132,7 +1132,7 @@ pub fn adt_recursion_diags(constituents: &[AdtRecursionConstituent]) -> Vec<TyDi
1132
1132
}
1133
1133
1134
1134
diags. push (
1135
- TyLowerDiag :: recursive_type (
1135
+ TyLowerDiag :: adt_recursion (
1136
1136
recursion
1137
1137
. iter ( )
1138
1138
. map ( |index| constituents[ * index] . to_owned ( ) )
@@ -1147,7 +1147,7 @@ pub fn adt_recursion_diags(constituents: &[AdtRecursionConstituent]) -> Vec<TyDi
1147
1147
1148
1148
/// Constituent of an ADT recursion.
1149
1149
///
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 .
1151
1151
#[ derive( Clone , Debug , Eq , PartialEq , Hash ) ]
1152
1152
pub struct AdtRecursionConstituent {
1153
1153
/// The ADT definition from which the constituent originates and its name span.
0 commit comments