@@ -126,12 +126,10 @@ enum ResolutionError<'a> {
126
126
TypeNotMemberOfTrait ( Name , & ' a str ) ,
127
127
/// error E0438: const is not a member of trait
128
128
ConstNotMemberOfTrait ( Name , & ' a str ) ,
129
- /// error E0408: variable `{}` from pattern #1 is not bound in pattern
130
- VariableNotBoundInPattern ( Name , usize ) ,
129
+ /// error E0408: variable `{}` from pattern #{} is not bound in pattern #{}
130
+ VariableNotBoundInPattern ( Name , usize , usize ) ,
131
131
/// error E0409: variable is bound with different mode in pattern #{} than in pattern #1
132
132
VariableBoundWithDifferentMode ( Name , usize ) ,
133
- /// error E0410: variable from pattern is not bound in pattern #1
134
- VariableNotBoundInParentPattern ( Name , usize ) ,
135
133
/// error E0411: use of `Self` outside of an impl or trait
136
134
SelfUsedOutsideImplOrTrait ,
137
135
/// error E0412: use of undeclared
@@ -272,13 +270,14 @@ fn resolve_struct_error<'b, 'a: 'b, 'tcx: 'a>(resolver: &'b Resolver<'a, 'tcx>,
272
270
const_,
273
271
trait_)
274
272
}
275
- ResolutionError :: VariableNotBoundInPattern ( variable_name, pattern_number ) => {
273
+ ResolutionError :: VariableNotBoundInPattern ( variable_name, from , to ) => {
276
274
struct_span_err ! ( resolver. session,
277
275
span,
278
276
E0408 ,
279
- "variable `{}` from pattern #1 is not bound in pattern #{}" ,
277
+ "variable `{}` from pattern #{} is not bound in pattern #{}" ,
280
278
variable_name,
281
- pattern_number)
279
+ from,
280
+ to)
282
281
}
283
282
ResolutionError :: VariableBoundWithDifferentMode ( variable_name, pattern_number) => {
284
283
struct_span_err ! ( resolver. session,
@@ -289,14 +288,6 @@ fn resolve_struct_error<'b, 'a: 'b, 'tcx: 'a>(resolver: &'b Resolver<'a, 'tcx>,
289
288
variable_name,
290
289
pattern_number)
291
290
}
292
- ResolutionError :: VariableNotBoundInParentPattern ( variable_name, pattern_number) => {
293
- struct_span_err ! ( resolver. session,
294
- span,
295
- E0410 ,
296
- "variable `{}` from pattern #{} is not bound in pattern #1" ,
297
- variable_name,
298
- pattern_number)
299
- }
300
291
ResolutionError :: SelfUsedOutsideImplOrTrait => {
301
292
struct_span_err ! ( resolver. session,
302
293
span,
@@ -2038,7 +2029,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2038
2029
None => {
2039
2030
resolve_error ( self ,
2040
2031
p. span ,
2041
- ResolutionError :: VariableNotBoundInPattern ( key, i + 1 ) ) ;
2032
+ ResolutionError :: VariableNotBoundInPattern ( key, 1 , i + 1 ) ) ;
2042
2033
}
2043
2034
Some ( binding_i) => {
2044
2035
if binding_0. binding_mode != binding_i. binding_mode {
@@ -2055,7 +2046,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2055
2046
if !map_0. contains_key ( & key) {
2056
2047
resolve_error ( self ,
2057
2048
binding. span ,
2058
- ResolutionError :: VariableNotBoundInParentPattern ( key, i + 1 ) ) ;
2049
+ ResolutionError :: VariableNotBoundInPattern ( key, i + 1 , 1 ) ) ;
2059
2050
}
2060
2051
}
2061
2052
}
0 commit comments