@@ -655,7 +655,13 @@ impl Parse for ty::TyVariableDecl {
655655 ) ) ;
656656 token. type_def = Some ( TypeDefinition :: Ident ( self . name . clone ( ) ) ) ;
657657 }
658- if let Some ( call_path_tree) = & self . type_ascription . call_path_tree ( ) {
658+ if let Some ( call_path_tree) = & self
659+ . type_ascription
660+ . as_type_argument ( )
661+ . unwrap ( )
662+ . call_path_tree
663+ . as_ref ( )
664+ {
659665 collect_call_path_tree ( ctx, call_path_tree, & self . type_ascription ) ;
660666 }
661667 self . body . parse ( ctx) ;
@@ -879,7 +885,10 @@ impl Parse for ty::ImplSelfOrTrait {
879885 implementing_for. type_id ( ) ,
880886 & typed_token,
881887 implementing_for
882- . call_path_tree ( )
888+ . as_type_argument ( )
889+ . unwrap ( )
890+ . call_path_tree
891+ . as_ref ( )
883892 . map ( |tree| tree. qualified_call_path . call_path . suffix . span ( ) )
884893 . unwrap_or ( implementing_for. span ( ) ) ,
885894 ) ;
@@ -1367,7 +1376,13 @@ fn collect_const_decl(ctx: &ParseContext, const_decl: &ty::TyConstantDecl, ident
13671376 TokenAstNode :: Typed ( TypedAstToken :: TypedConstantDeclaration ( const_decl. clone ( ) ) ) ;
13681377 token. type_def = Some ( TypeDefinition :: Ident ( const_decl. call_path . suffix . clone ( ) ) ) ;
13691378 }
1370- if let Some ( call_path_tree) = & const_decl. type_ascription . call_path_tree ( ) {
1379+ if let Some ( call_path_tree) = & const_decl
1380+ . type_ascription
1381+ . as_type_argument ( )
1382+ . unwrap ( )
1383+ . call_path_tree
1384+ . as_ref ( )
1385+ {
13711386 collect_call_path_tree ( ctx, call_path_tree, & const_decl. type_ascription ) ;
13721387 }
13731388 if let Some ( value) = & const_decl. value {
@@ -1387,7 +1402,13 @@ fn collect_configurable_decl(
13871402 TokenAstNode :: Typed ( TypedAstToken :: TypedConfigurableDeclaration ( decl. clone ( ) ) ) ;
13881403 token. type_def = Some ( TypeDefinition :: Ident ( decl. call_path . suffix . clone ( ) ) ) ;
13891404 }
1390- if let Some ( call_path_tree) = & decl. type_ascription . call_path_tree ( ) {
1405+ if let Some ( call_path_tree) = & decl
1406+ . type_ascription
1407+ . as_type_argument ( )
1408+ . unwrap ( )
1409+ . call_path_tree
1410+ . as_ref ( )
1411+ {
13911412 collect_call_path_tree ( ctx, call_path_tree, & decl. type_ascription ) ;
13921413 }
13931414 if let Some ( value) = & decl. value {
@@ -1516,7 +1537,7 @@ fn collect_type_id(
15161537}
15171538
15181539fn collect_type_argument ( ctx : & ParseContext , type_arg : & GenericArgument ) {
1519- if let Some ( call_path_tree) = type_arg. call_path_tree ( ) {
1540+ if let Some ( call_path_tree) = type_arg. as_type_argument ( ) . unwrap ( ) . call_path_tree . as_ref ( ) {
15201541 collect_call_path_tree ( ctx, call_path_tree, type_arg) ;
15211542 } else {
15221543 collect_type_id (
0 commit comments