@@ -184,7 +184,7 @@ crate enum PathSource<'a> {
184
184
// Paths in struct expressions and patterns `Path { .. }`.
185
185
Struct ,
186
186
// Paths in tuple struct patterns `Path(..)`.
187
- TupleStruct ,
187
+ TupleStruct ( Span ) ,
188
188
// `m::A::B` in `<T as m::A>::B::C`.
189
189
TraitItem ( Namespace ) ,
190
190
}
@@ -193,7 +193,7 @@ impl<'a> PathSource<'a> {
193
193
fn namespace ( self ) -> Namespace {
194
194
match self {
195
195
PathSource :: Type | PathSource :: Trait ( _) | PathSource :: Struct => TypeNS ,
196
- PathSource :: Expr ( ..) | PathSource :: Pat | PathSource :: TupleStruct => ValueNS ,
196
+ PathSource :: Expr ( ..) | PathSource :: Pat | PathSource :: TupleStruct ( _ ) => ValueNS ,
197
197
PathSource :: TraitItem ( ns) => ns,
198
198
}
199
199
}
@@ -204,7 +204,7 @@ impl<'a> PathSource<'a> {
204
204
| PathSource :: Expr ( ..)
205
205
| PathSource :: Pat
206
206
| PathSource :: Struct
207
- | PathSource :: TupleStruct => true ,
207
+ | PathSource :: TupleStruct ( _ ) => true ,
208
208
PathSource :: Trait ( _) | PathSource :: TraitItem ( ..) => false ,
209
209
}
210
210
}
@@ -215,7 +215,7 @@ impl<'a> PathSource<'a> {
215
215
PathSource :: Trait ( _) => "trait" ,
216
216
PathSource :: Pat => "unit struct, unit variant or constant" ,
217
217
PathSource :: Struct => "struct, variant or union type" ,
218
- PathSource :: TupleStruct => "tuple struct or tuple variant" ,
218
+ PathSource :: TupleStruct ( _ ) => "tuple struct or tuple variant" ,
219
219
PathSource :: TraitItem ( ns) => match ns {
220
220
TypeNS => "associated type" ,
221
221
ValueNS => "method or associated constant" ,
@@ -301,7 +301,7 @@ impl<'a> PathSource<'a> {
301
301
| Res :: SelfCtor ( ..) => true ,
302
302
_ => false ,
303
303
} ,
304
- PathSource :: TupleStruct => match res {
304
+ PathSource :: TupleStruct ( _ ) => match res {
305
305
Res :: Def ( DefKind :: Ctor ( _, CtorKind :: Fn ) , _) | Res :: SelfCtor ( ..) => true ,
306
306
_ => false ,
307
307
} ,
@@ -336,8 +336,8 @@ impl<'a> PathSource<'a> {
336
336
( PathSource :: Struct , false ) => error_code ! ( E0422 ) ,
337
337
( PathSource :: Expr ( ..) , true ) => error_code ! ( E0423 ) ,
338
338
( PathSource :: Expr ( ..) , false ) => error_code ! ( E0425 ) ,
339
- ( PathSource :: Pat | PathSource :: TupleStruct , true ) => error_code ! ( E0532 ) ,
340
- ( PathSource :: Pat | PathSource :: TupleStruct , false ) => error_code ! ( E0531 ) ,
339
+ ( PathSource :: Pat | PathSource :: TupleStruct ( _ ) , true ) => error_code ! ( E0532 ) ,
340
+ ( PathSource :: Pat | PathSource :: TupleStruct ( _ ) , false ) => error_code ! ( E0531 ) ,
341
341
( PathSource :: TraitItem ( ..) , true ) => error_code ! ( E0575 ) ,
342
342
( PathSource :: TraitItem ( ..) , false ) => error_code ! ( E0576 ) ,
343
343
}
@@ -1483,7 +1483,7 @@ impl<'a, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
1483
1483
self . r . record_partial_res ( pat. id , PartialRes :: new ( res) ) ;
1484
1484
}
1485
1485
PatKind :: TupleStruct ( ref path, ..) => {
1486
- self . smart_resolve_path ( pat. id , None , path, PathSource :: TupleStruct ) ;
1486
+ self . smart_resolve_path ( pat. id , None , path, PathSource :: TupleStruct ( pat . span ) ) ;
1487
1487
}
1488
1488
PatKind :: Path ( ref qself, ref path) => {
1489
1489
self . smart_resolve_path ( pat. id , qself. as_ref ( ) , path, PathSource :: Pat ) ;
0 commit comments