@@ -126,12 +126,10 @@ enum ResolutionError<'a> {
126126 TypeNotMemberOfTrait ( Name , & ' a str ) ,
127127 /// error E0438: const is not a member of trait
128128 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 ) ,
131131 /// error E0409: variable is bound with different mode in pattern #{} than in pattern #1
132132 VariableBoundWithDifferentMode ( Name , usize ) ,
133- /// error E0410: variable from pattern is not bound in pattern #1
134- VariableNotBoundInParentPattern ( Name , usize ) ,
135133 /// error E0411: use of `Self` outside of an impl or trait
136134 SelfUsedOutsideImplOrTrait ,
137135 /// error E0412: use of undeclared
@@ -272,13 +270,14 @@ fn resolve_struct_error<'b, 'a: 'b, 'tcx: 'a>(resolver: &'b Resolver<'a, 'tcx>,
272270 const_,
273271 trait_)
274272 }
275- ResolutionError :: VariableNotBoundInPattern ( variable_name, pattern_number ) => {
273+ ResolutionError :: VariableNotBoundInPattern ( variable_name, from , to ) => {
276274 struct_span_err ! ( resolver. session,
277275 span,
278276 E0408 ,
279- "variable `{}` from pattern #1 is not bound in pattern #{}" ,
277+ "variable `{}` from pattern #{} is not bound in pattern #{}" ,
280278 variable_name,
281- pattern_number)
279+ from,
280+ to)
282281 }
283282 ResolutionError :: VariableBoundWithDifferentMode ( variable_name, pattern_number) => {
284283 struct_span_err ! ( resolver. session,
@@ -289,14 +288,6 @@ fn resolve_struct_error<'b, 'a: 'b, 'tcx: 'a>(resolver: &'b Resolver<'a, 'tcx>,
289288 variable_name,
290289 pattern_number)
291290 }
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- }
300291 ResolutionError :: SelfUsedOutsideImplOrTrait => {
301292 struct_span_err ! ( resolver. session,
302293 span,
@@ -2038,7 +2029,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
20382029 None => {
20392030 resolve_error ( self ,
20402031 p. span ,
2041- ResolutionError :: VariableNotBoundInPattern ( key, i + 1 ) ) ;
2032+ ResolutionError :: VariableNotBoundInPattern ( key, 1 , i + 1 ) ) ;
20422033 }
20432034 Some ( binding_i) => {
20442035 if binding_0. binding_mode != binding_i. binding_mode {
@@ -2055,7 +2046,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
20552046 if !map_0. contains_key ( & key) {
20562047 resolve_error ( self ,
20572048 binding. span ,
2058- ResolutionError :: VariableNotBoundInParentPattern ( key, i + 1 ) ) ;
2049+ ResolutionError :: VariableNotBoundInPattern ( key, i + 1 , 1 ) ) ;
20592050 }
20602051 }
20612052 }
0 commit comments