@@ -184,7 +184,7 @@ crate enum PathSource<'a> {
184184 // Paths in struct expressions and patterns `Path { .. }`.
185185 Struct ,
186186 // Paths in tuple struct patterns `Path(..)`.
187- TupleStruct ,
187+ TupleStruct ( Span ) ,
188188 // `m::A::B` in `<T as m::A>::B::C`.
189189 TraitItem ( Namespace ) ,
190190}
@@ -193,7 +193,7 @@ impl<'a> PathSource<'a> {
193193 fn namespace ( self ) -> Namespace {
194194 match self {
195195 PathSource :: Type | PathSource :: Trait ( _) | PathSource :: Struct => TypeNS ,
196- PathSource :: Expr ( ..) | PathSource :: Pat | PathSource :: TupleStruct => ValueNS ,
196+ PathSource :: Expr ( ..) | PathSource :: Pat | PathSource :: TupleStruct ( _ ) => ValueNS ,
197197 PathSource :: TraitItem ( ns) => ns,
198198 }
199199 }
@@ -204,7 +204,7 @@ impl<'a> PathSource<'a> {
204204 | PathSource :: Expr ( ..)
205205 | PathSource :: Pat
206206 | PathSource :: Struct
207- | PathSource :: TupleStruct => true ,
207+ | PathSource :: TupleStruct ( _ ) => true ,
208208 PathSource :: Trait ( _) | PathSource :: TraitItem ( ..) => false ,
209209 }
210210 }
@@ -215,7 +215,7 @@ impl<'a> PathSource<'a> {
215215 PathSource :: Trait ( _) => "trait" ,
216216 PathSource :: Pat => "unit struct, unit variant or constant" ,
217217 PathSource :: Struct => "struct, variant or union type" ,
218- PathSource :: TupleStruct => "tuple struct or tuple variant" ,
218+ PathSource :: TupleStruct ( _ ) => "tuple struct or tuple variant" ,
219219 PathSource :: TraitItem ( ns) => match ns {
220220 TypeNS => "associated type" ,
221221 ValueNS => "method or associated constant" ,
@@ -301,7 +301,7 @@ impl<'a> PathSource<'a> {
301301 | Res :: SelfCtor ( ..) => true ,
302302 _ => false ,
303303 } ,
304- PathSource :: TupleStruct => match res {
304+ PathSource :: TupleStruct ( _ ) => match res {
305305 Res :: Def ( DefKind :: Ctor ( _, CtorKind :: Fn ) , _) | Res :: SelfCtor ( ..) => true ,
306306 _ => false ,
307307 } ,
@@ -336,8 +336,8 @@ impl<'a> PathSource<'a> {
336336 ( PathSource :: Struct , false ) => error_code ! ( E0422 ) ,
337337 ( PathSource :: Expr ( ..) , true ) => error_code ! ( E0423 ) ,
338338 ( 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 ) ,
341341 ( PathSource :: TraitItem ( ..) , true ) => error_code ! ( E0575 ) ,
342342 ( PathSource :: TraitItem ( ..) , false ) => error_code ! ( E0576 ) ,
343343 }
@@ -1483,7 +1483,7 @@ impl<'a, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
14831483 self . r . record_partial_res ( pat. id , PartialRes :: new ( res) ) ;
14841484 }
14851485 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 ) ) ;
14871487 }
14881488 PatKind :: Path ( ref qself, ref path) => {
14891489 self . smart_resolve_path ( pat. id , qself. as_ref ( ) , path, PathSource :: Pat ) ;
0 commit comments