From 01cc19cffc61b3226037e4eb87f83f8075ab0653 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Fri, 23 Jan 2026 13:39:26 +0100 Subject: [PATCH 1/5] Rust: Add trait visibility test using `Self` --- .../library-tests/path-resolution/main.rs | 7 + .../path-resolution/path-resolution.expected | 499 +++++++++--------- 2 files changed, 258 insertions(+), 248 deletions(-) diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index 0c60ac9d2d01..f428f851c31d 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -606,6 +606,13 @@ mod trait_visibility { // Only the `Foo` trait is visible use m::Foo; // $ item=Foo X::a_method(&x); // $ item=X_Foo::a_method + + #[rustfmt::skip] + impl X { // $ item=X + fn test(&self) { + Self::a_method(self); // $ item=X_Foo::a_method + } + } } { // Only the `Bar` trait is visible diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index b204368cdb53..ad581e8bf93e 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -19,21 +19,21 @@ mod | main.rs:295:5:303:5 | mod m14 | | main.rs:306:1:375:1 | mod m15 | | main.rs:377:1:574:1 | mod m16 | -| main.rs:576:1:626:1 | mod trait_visibility | +| main.rs:576:1:633:1 | mod trait_visibility | | main.rs:577:5:599:5 | mod m | -| main.rs:628:1:658:1 | mod m17 | -| main.rs:660:1:678:1 | mod m18 | -| main.rs:665:5:677:5 | mod m19 | -| main.rs:670:9:676:9 | mod m20 | -| main.rs:680:1:705:1 | mod m21 | -| main.rs:681:5:687:5 | mod m22 | -| main.rs:689:5:704:5 | mod m33 | -| main.rs:707:1:732:1 | mod m23 | -| main.rs:734:1:802:1 | mod m24 | -| main.rs:819:1:871:1 | mod associated_types | -| main.rs:877:1:896:1 | mod impl_with_attribute_macro | -| main.rs:898:1:939:1 | mod patterns | -| main.rs:941:1:985:1 | mod self_constructors | +| main.rs:635:1:665:1 | mod m17 | +| main.rs:667:1:685:1 | mod m18 | +| main.rs:672:5:684:5 | mod m19 | +| main.rs:677:9:683:9 | mod m20 | +| main.rs:687:1:712:1 | mod m21 | +| main.rs:688:5:694:5 | mod m22 | +| main.rs:696:5:711:5 | mod m33 | +| main.rs:714:1:739:1 | mod m23 | +| main.rs:741:1:809:1 | mod m24 | +| main.rs:826:1:878:1 | mod associated_types | +| main.rs:884:1:903:1 | mod impl_with_attribute_macro | +| main.rs:905:1:946:1 | mod patterns | +| main.rs:948:1:992:1 | mod self_constructors | | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:20:1:20:12 | mod my3 | | my2/mod.rs:22:1:23:10 | mod mymod | @@ -74,7 +74,7 @@ resolvePath | main.rs:37:17:37:24 | ...::f | main.rs:26:9:28:9 | fn f | | main.rs:39:17:39:23 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:40:17:40:17 | f | main.rs:26:9:28:9 | fn f | -| main.rs:47:9:47:13 | super | main.rs:1:1:1024:2 | SourceFile | +| main.rs:47:9:47:13 | super | main.rs:1:1:1031:2 | SourceFile | | main.rs:47:9:47:17 | ...::m1 | main.rs:20:1:44:1 | mod m1 | | main.rs:47:9:47:21 | ...::m2 | main.rs:25:5:43:5 | mod m2 | | main.rs:47:9:47:24 | ...::g | main.rs:30:9:34:9 | fn g | @@ -89,7 +89,7 @@ resolvePath | main.rs:68:17:68:19 | Foo | main.rs:66:9:66:21 | struct Foo | | main.rs:71:13:71:15 | Foo | main.rs:60:5:60:17 | struct Foo | | main.rs:73:5:73:5 | f | main.rs:62:5:69:5 | fn f | -| main.rs:75:5:75:8 | self | main.rs:1:1:1024:2 | SourceFile | +| main.rs:75:5:75:8 | self | main.rs:1:1:1031:2 | SourceFile | | main.rs:75:5:75:11 | ...::i | main.rs:78:1:90:1 | fn i | | main.rs:79:5:79:11 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:81:13:81:15 | Foo | main.rs:55:1:55:13 | struct Foo | @@ -111,7 +111,7 @@ resolvePath | main.rs:112:9:112:15 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:118:9:118:15 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:122:9:122:15 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:125:13:125:17 | super | main.rs:1:1:1024:2 | SourceFile | +| main.rs:125:13:125:17 | super | main.rs:1:1:1031:2 | SourceFile | | main.rs:125:13:125:21 | ...::m5 | main.rs:110:1:114:1 | mod m5 | | main.rs:126:9:126:9 | f | main.rs:111:5:113:5 | fn f | | main.rs:126:9:126:9 | f | main.rs:117:5:119:5 | fn f | @@ -336,237 +336,240 @@ resolvePath | main.rs:607:17:607:22 | ...::Foo | main.rs:578:9:580:9 | trait Foo | | main.rs:608:13:608:13 | X | main.rs:586:9:586:21 | struct X | | main.rs:608:13:608:23 | ...::a_method | main.rs:588:26:591:13 | fn a_method | -| main.rs:612:17:612:17 | m | main.rs:577:5:599:5 | mod m | -| main.rs:612:17:612:22 | ...::Bar | main.rs:582:9:584:9 | trait Bar | -| main.rs:613:13:613:13 | X | main.rs:586:9:586:21 | struct X | -| main.rs:613:13:613:23 | ...::a_method | main.rs:594:26:597:13 | fn a_method | -| main.rs:617:17:617:17 | m | main.rs:577:5:599:5 | mod m | -| main.rs:617:17:617:22 | ...::Bar | main.rs:582:9:584:9 | trait Bar | -| main.rs:618:13:618:13 | X | main.rs:586:9:586:21 | struct X | -| main.rs:618:13:618:23 | ...::a_method | main.rs:594:26:597:13 | fn a_method | -| main.rs:623:13:623:13 | m | main.rs:577:5:599:5 | mod m | -| main.rs:623:13:623:18 | ...::Bar | main.rs:582:9:584:9 | trait Bar | -| main.rs:623:13:623:28 | ...::a_method | main.rs:583:13:583:31 | fn a_method | -| main.rs:636:10:636:16 | MyTrait | main.rs:629:5:631:5 | trait MyTrait | -| main.rs:637:9:637:9 | S | main.rs:633:5:633:13 | struct S | -| main.rs:639:13:639:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:645:7:645:13 | MyTrait | main.rs:629:5:631:5 | trait MyTrait | -| main.rs:646:10:646:10 | T | main.rs:644:10:644:10 | T | -| main.rs:648:9:648:9 | T | main.rs:644:10:644:10 | T | -| main.rs:648:9:648:12 | ...::f | main.rs:630:9:630:20 | fn f | -| main.rs:649:9:649:15 | MyTrait | main.rs:629:5:631:5 | trait MyTrait | -| main.rs:649:9:649:18 | ...::f | main.rs:630:9:630:20 | fn f | -| main.rs:654:9:654:9 | g | main.rs:643:5:650:5 | fn g | -| main.rs:655:11:655:11 | S | main.rs:633:5:633:13 | struct S | -| main.rs:662:9:662:15 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:667:13:667:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:672:17:672:23 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:673:17:673:21 | super | main.rs:665:5:677:5 | mod m19 | -| main.rs:673:17:673:24 | ...::f | main.rs:666:9:668:9 | fn f | -| main.rs:674:17:674:21 | super | main.rs:665:5:677:5 | mod m19 | -| main.rs:674:17:674:28 | ...::super | main.rs:660:1:678:1 | mod m18 | -| main.rs:674:17:674:31 | ...::f | main.rs:661:5:663:5 | fn f | -| main.rs:691:13:691:17 | super | main.rs:680:1:705:1 | mod m21 | -| main.rs:691:13:691:22 | ...::m22 | main.rs:681:5:687:5 | mod m22 | -| main.rs:691:13:691:30 | ...::MyEnum | main.rs:682:9:684:9 | enum MyEnum | -| main.rs:692:13:692:16 | self | main.rs:682:9:684:9 | enum MyEnum | -| main.rs:696:13:696:17 | super | main.rs:680:1:705:1 | mod m21 | -| main.rs:696:13:696:22 | ...::m22 | main.rs:681:5:687:5 | mod m22 | -| main.rs:696:13:696:32 | ...::MyStruct | main.rs:686:9:686:28 | struct MyStruct | -| main.rs:697:13:697:16 | self | main.rs:686:9:686:28 | struct MyStruct | -| main.rs:701:21:701:26 | MyEnum | main.rs:682:9:684:9 | enum MyEnum | -| main.rs:701:21:701:29 | ...::A | main.rs:683:13:683:13 | A | -| main.rs:702:21:702:28 | MyStruct | main.rs:686:9:686:28 | struct MyStruct | -| main.rs:718:10:720:5 | Trait1::<...> | main.rs:708:5:713:5 | trait Trait1 | -| main.rs:719:7:719:10 | Self | main.rs:715:5:715:13 | struct S | -| main.rs:721:11:721:11 | S | main.rs:715:5:715:13 | struct S | -| main.rs:723:13:723:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:729:17:729:17 | S | main.rs:715:5:715:13 | struct S | -| main.rs:745:15:745:15 | T | main.rs:744:26:744:26 | T | -| main.rs:750:9:750:24 | GenericStruct::<...> | main.rs:743:5:746:5 | struct GenericStruct | -| main.rs:750:23:750:23 | T | main.rs:749:10:749:10 | T | -| main.rs:752:9:752:9 | T | main.rs:749:10:749:10 | T | -| main.rs:752:12:752:17 | TraitA | main.rs:735:5:737:5 | trait TraitA | -| main.rs:761:9:761:24 | GenericStruct::<...> | main.rs:743:5:746:5 | struct GenericStruct | -| main.rs:761:23:761:23 | T | main.rs:760:10:760:10 | T | -| main.rs:763:9:763:9 | T | main.rs:760:10:760:10 | T | -| main.rs:763:12:763:17 | TraitB | main.rs:739:5:741:5 | trait TraitB | -| main.rs:764:9:764:9 | T | main.rs:760:10:760:10 | T | -| main.rs:764:12:764:17 | TraitA | main.rs:735:5:737:5 | trait TraitA | -| main.rs:775:10:775:15 | TraitA | main.rs:735:5:737:5 | trait TraitA | -| main.rs:775:21:775:31 | Implementor | main.rs:772:5:772:23 | struct Implementor | -| main.rs:777:13:777:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:782:10:782:15 | TraitB | main.rs:739:5:741:5 | trait TraitB | -| main.rs:782:21:782:31 | Implementor | main.rs:772:5:772:23 | struct Implementor | +| main.rs:611:18:611:18 | X | main.rs:586:9:586:21 | struct X | +| main.rs:613:21:613:24 | Self | main.rs:586:9:586:21 | struct X | +| main.rs:613:21:613:34 | ...::a_method | main.rs:588:26:591:13 | fn a_method | +| main.rs:619:17:619:17 | m | main.rs:577:5:599:5 | mod m | +| main.rs:619:17:619:22 | ...::Bar | main.rs:582:9:584:9 | trait Bar | +| main.rs:620:13:620:13 | X | main.rs:586:9:586:21 | struct X | +| main.rs:620:13:620:23 | ...::a_method | main.rs:594:26:597:13 | fn a_method | +| main.rs:624:17:624:17 | m | main.rs:577:5:599:5 | mod m | +| main.rs:624:17:624:22 | ...::Bar | main.rs:582:9:584:9 | trait Bar | +| main.rs:625:13:625:13 | X | main.rs:586:9:586:21 | struct X | +| main.rs:625:13:625:23 | ...::a_method | main.rs:594:26:597:13 | fn a_method | +| main.rs:630:13:630:13 | m | main.rs:577:5:599:5 | mod m | +| main.rs:630:13:630:18 | ...::Bar | main.rs:582:9:584:9 | trait Bar | +| main.rs:630:13:630:28 | ...::a_method | main.rs:583:13:583:31 | fn a_method | +| main.rs:643:10:643:16 | MyTrait | main.rs:636:5:638:5 | trait MyTrait | +| main.rs:644:9:644:9 | S | main.rs:640:5:640:13 | struct S | +| main.rs:646:13:646:19 | println | {EXTERNAL LOCATION} | MacroRules | +| main.rs:652:7:652:13 | MyTrait | main.rs:636:5:638:5 | trait MyTrait | +| main.rs:653:10:653:10 | T | main.rs:651:10:651:10 | T | +| main.rs:655:9:655:9 | T | main.rs:651:10:651:10 | T | +| main.rs:655:9:655:12 | ...::f | main.rs:637:9:637:20 | fn f | +| main.rs:656:9:656:15 | MyTrait | main.rs:636:5:638:5 | trait MyTrait | +| main.rs:656:9:656:18 | ...::f | main.rs:637:9:637:20 | fn f | +| main.rs:661:9:661:9 | g | main.rs:650:5:657:5 | fn g | +| main.rs:662:11:662:11 | S | main.rs:640:5:640:13 | struct S | +| main.rs:669:9:669:15 | println | {EXTERNAL LOCATION} | MacroRules | +| main.rs:674:13:674:19 | println | {EXTERNAL LOCATION} | MacroRules | +| main.rs:679:17:679:23 | println | {EXTERNAL LOCATION} | MacroRules | +| main.rs:680:17:680:21 | super | main.rs:672:5:684:5 | mod m19 | +| main.rs:680:17:680:24 | ...::f | main.rs:673:9:675:9 | fn f | +| main.rs:681:17:681:21 | super | main.rs:672:5:684:5 | mod m19 | +| main.rs:681:17:681:28 | ...::super | main.rs:667:1:685:1 | mod m18 | +| main.rs:681:17:681:31 | ...::f | main.rs:668:5:670:5 | fn f | +| main.rs:698:13:698:17 | super | main.rs:687:1:712:1 | mod m21 | +| main.rs:698:13:698:22 | ...::m22 | main.rs:688:5:694:5 | mod m22 | +| main.rs:698:13:698:30 | ...::MyEnum | main.rs:689:9:691:9 | enum MyEnum | +| main.rs:699:13:699:16 | self | main.rs:689:9:691:9 | enum MyEnum | +| main.rs:703:13:703:17 | super | main.rs:687:1:712:1 | mod m21 | +| main.rs:703:13:703:22 | ...::m22 | main.rs:688:5:694:5 | mod m22 | +| main.rs:703:13:703:32 | ...::MyStruct | main.rs:693:9:693:28 | struct MyStruct | +| main.rs:704:13:704:16 | self | main.rs:693:9:693:28 | struct MyStruct | +| main.rs:708:21:708:26 | MyEnum | main.rs:689:9:691:9 | enum MyEnum | +| main.rs:708:21:708:29 | ...::A | main.rs:690:13:690:13 | A | +| main.rs:709:21:709:28 | MyStruct | main.rs:693:9:693:28 | struct MyStruct | +| main.rs:725:10:727:5 | Trait1::<...> | main.rs:715:5:720:5 | trait Trait1 | +| main.rs:726:7:726:10 | Self | main.rs:722:5:722:13 | struct S | +| main.rs:728:11:728:11 | S | main.rs:722:5:722:13 | struct S | +| main.rs:730:13:730:19 | println | {EXTERNAL LOCATION} | MacroRules | +| main.rs:736:17:736:17 | S | main.rs:722:5:722:13 | struct S | +| main.rs:752:15:752:15 | T | main.rs:751:26:751:26 | T | +| main.rs:757:9:757:24 | GenericStruct::<...> | main.rs:750:5:753:5 | struct GenericStruct | +| main.rs:757:23:757:23 | T | main.rs:756:10:756:10 | T | +| main.rs:759:9:759:9 | T | main.rs:756:10:756:10 | T | +| main.rs:759:12:759:17 | TraitA | main.rs:742:5:744:5 | trait TraitA | +| main.rs:768:9:768:24 | GenericStruct::<...> | main.rs:750:5:753:5 | struct GenericStruct | +| main.rs:768:23:768:23 | T | main.rs:767:10:767:10 | T | +| main.rs:770:9:770:9 | T | main.rs:767:10:767:10 | T | +| main.rs:770:12:770:17 | TraitB | main.rs:746:5:748:5 | trait TraitB | +| main.rs:771:9:771:9 | T | main.rs:767:10:767:10 | T | +| main.rs:771:12:771:17 | TraitA | main.rs:742:5:744:5 | trait TraitA | +| main.rs:782:10:782:15 | TraitA | main.rs:742:5:744:5 | trait TraitA | +| main.rs:782:21:782:31 | Implementor | main.rs:779:5:779:23 | struct Implementor | | main.rs:784:13:784:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:790:24:790:34 | Implementor | main.rs:772:5:772:23 | struct Implementor | -| main.rs:791:23:791:35 | GenericStruct | main.rs:743:5:746:5 | struct GenericStruct | -| main.rs:797:9:797:36 | GenericStruct::<...> | main.rs:743:5:746:5 | struct GenericStruct | -| main.rs:797:9:797:50 | ...::call_trait_a | main.rs:754:9:756:9 | fn call_trait_a | -| main.rs:797:25:797:35 | Implementor | main.rs:772:5:772:23 | struct Implementor | -| main.rs:800:9:800:36 | GenericStruct::<...> | main.rs:743:5:746:5 | struct GenericStruct | -| main.rs:800:9:800:47 | ...::call_both | main.rs:766:9:769:9 | fn call_both | -| main.rs:800:25:800:35 | Implementor | main.rs:772:5:772:23 | struct Implementor | -| main.rs:806:3:806:12 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | -| main.rs:806:3:806:24 | ...::add_suffix | proc_macro.rs:4:1:13:1 | fn add_suffix | -| main.rs:810:6:810:12 | AStruct | main.rs:809:1:809:17 | struct AStruct | -| main.rs:812:7:812:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | -| main.rs:812:7:812:28 | ...::add_suffix | proc_macro.rs:4:1:13:1 | fn add_suffix | -| main.rs:815:7:815:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | -| main.rs:815:7:815:28 | ...::add_suffix | proc_macro.rs:4:1:13:1 | fn add_suffix | -| main.rs:820:9:820:11 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:820:9:820:19 | ...::marker | {EXTERNAL LOCATION} | mod marker | -| main.rs:820:9:820:32 | ...::PhantomData | {EXTERNAL LOCATION} | struct PhantomData | -| main.rs:821:9:821:11 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:821:9:821:19 | ...::result | {EXTERNAL LOCATION} | mod result | -| main.rs:821:9:821:27 | ...::Result | {EXTERNAL LOCATION} | enum Result | -| main.rs:829:19:829:22 | Self | main.rs:823:5:831:5 | trait Reduce | -| main.rs:829:19:829:29 | ...::Input | main.rs:824:9:824:19 | type Input | -| main.rs:830:14:830:46 | Result::<...> | {EXTERNAL LOCATION} | enum Result | -| main.rs:830:21:830:24 | Self | main.rs:823:5:831:5 | trait Reduce | -| main.rs:830:21:830:32 | ...::Output | main.rs:825:21:826:20 | type Output | -| main.rs:830:35:830:38 | Self | main.rs:823:5:831:5 | trait Reduce | -| main.rs:830:35:830:45 | ...::Error | main.rs:824:21:825:19 | type Error | -| main.rs:834:17:834:34 | PhantomData::<...> | {EXTERNAL LOCATION} | struct PhantomData | -| main.rs:834:29:834:33 | Input | main.rs:833:19:833:23 | Input | -| main.rs:835:17:835:34 | PhantomData::<...> | {EXTERNAL LOCATION} | struct PhantomData | -| main.rs:835:29:835:33 | Error | main.rs:833:26:833:30 | Error | -| main.rs:842:11:842:16 | Reduce | main.rs:823:5:831:5 | trait Reduce | -| main.rs:843:13:846:9 | MyImpl::<...> | main.rs:833:5:836:5 | struct MyImpl | -| main.rs:844:13:844:17 | Input | main.rs:840:13:840:17 | Input | -| main.rs:845:13:845:17 | Error | main.rs:841:13:841:17 | Error | -| main.rs:848:22:851:9 | Result::<...> | {EXTERNAL LOCATION} | enum Result | -| main.rs:849:13:849:17 | Input | main.rs:840:13:840:17 | Input | -| main.rs:850:13:850:16 | Self | main.rs:833:5:836:5 | struct MyImpl | -| main.rs:850:13:850:23 | ...::Error | main.rs:852:11:856:9 | type Error | -| main.rs:853:22:855:9 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:854:11:854:15 | Error | main.rs:841:13:841:17 | Error | -| main.rs:858:13:858:17 | Input | main.rs:840:13:840:17 | Input | -| main.rs:863:19:863:22 | Self | main.rs:833:5:836:5 | struct MyImpl | -| main.rs:863:19:863:29 | ...::Input | main.rs:848:9:852:9 | type Input | -| main.rs:864:14:867:9 | Result::<...> | {EXTERNAL LOCATION} | enum Result | -| main.rs:865:13:865:16 | Self | main.rs:833:5:836:5 | struct MyImpl | -| main.rs:865:13:865:24 | ...::Output | main.rs:856:11:859:9 | type Output | -| main.rs:866:13:866:16 | Self | main.rs:833:5:836:5 | struct MyImpl | -| main.rs:866:13:866:23 | ...::Error | main.rs:852:11:856:9 | type Error | -| main.rs:873:5:873:7 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:873:11:873:14 | self | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:875:15:875:17 | ztd | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:875:15:875:25 | ...::string | {EXTERNAL LOCATION} | mod string | -| main.rs:875:15:875:33 | ...::String | {EXTERNAL LOCATION} | struct String | -| main.rs:885:7:885:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | -| main.rs:885:7:885:26 | ...::identity | proc_macro.rs:15:1:18:1 | fn identity | -| main.rs:886:10:886:15 | ATrait | main.rs:881:5:883:5 | trait ATrait | -| main.rs:886:21:886:23 | i64 | {EXTERNAL LOCATION} | struct i64 | -| main.rs:888:11:888:13 | i64 | {EXTERNAL LOCATION} | struct i64 | -| main.rs:894:17:894:19 | Foo | main.rs:879:5:879:15 | struct Foo | -| main.rs:900:22:900:32 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:900:29:900:31 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:901:17:901:20 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:902:17:902:27 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:902:24:902:26 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:903:13:903:16 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:904:17:904:20 | None | {EXTERNAL LOCATION} | None | -| main.rs:906:13:906:16 | None | {EXTERNAL LOCATION} | None | -| main.rs:907:17:907:20 | None | {EXTERNAL LOCATION} | None | -| main.rs:916:19:916:29 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:916:26:916:28 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:917:26:917:29 | test | main.rs:899:5:913:5 | fn test | -| main.rs:923:14:923:16 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:928:17:928:20 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:930:13:930:16 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:935:13:935:16 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:935:18:935:18 | z | main.rs:922:5:924:12 | Const | -| main.rs:935:24:935:24 | z | main.rs:922:5:924:12 | Const | -| main.rs:943:24:943:26 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:946:10:946:20 | TupleStruct | main.rs:943:5:943:28 | struct TupleStruct | -| main.rs:948:19:948:21 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:948:27:948:30 | Self | main.rs:943:5:943:28 | struct TupleStruct | -| main.rs:949:21:949:24 | Self | main.rs:943:5:943:28 | struct TupleStruct | -| main.rs:950:31:950:34 | Self | main.rs:943:5:943:28 | struct TupleStruct | -| main.rs:956:12:956:14 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:960:10:960:21 | StructStruct | main.rs:955:5:957:5 | struct StructStruct | -| main.rs:962:19:962:21 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:962:27:962:30 | Self | main.rs:955:5:957:5 | struct StructStruct | -| main.rs:963:13:963:16 | Self | main.rs:955:5:957:5 | struct StructStruct | -| main.rs:969:13:969:15 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:974:10:974:15 | MyEnum | main.rs:967:5:971:5 | enum MyEnum | -| main.rs:975:25:975:27 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:977:17:977:20 | Self | main.rs:967:5:971:5 | enum MyEnum | -| main.rs:977:17:977:23 | ...::A | main.rs:968:9:970:9 | A | -| main.rs:988:5:988:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:988:5:988:14 | ...::nested | my.rs:1:1:1:15 | mod nested | -| main.rs:988:5:988:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | -| main.rs:988:5:988:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | -| main.rs:988:5:988:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | -| main.rs:989:5:989:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:989:5:989:9 | ...::f | my.rs:5:1:7:1 | fn f | -| main.rs:990:5:990:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | -| main.rs:990:5:990:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | -| main.rs:990:5:990:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | -| main.rs:990:5:990:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:991:5:991:5 | f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:992:5:992:5 | g | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:993:5:993:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | -| main.rs:993:5:993:12 | ...::h | main.rs:57:1:76:1 | fn h | -| main.rs:994:5:994:6 | m1 | main.rs:20:1:44:1 | mod m1 | -| main.rs:994:5:994:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | -| main.rs:994:5:994:13 | ...::g | main.rs:30:9:34:9 | fn g | -| main.rs:995:5:995:6 | m1 | main.rs:20:1:44:1 | mod m1 | -| main.rs:995:5:995:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | -| main.rs:995:5:995:14 | ...::m3 | main.rs:36:9:42:9 | mod m3 | -| main.rs:995:5:995:17 | ...::h | main.rs:37:27:41:13 | fn h | -| main.rs:996:5:996:6 | m4 | main.rs:46:1:53:1 | mod m4 | -| main.rs:996:5:996:9 | ...::i | main.rs:49:5:52:5 | fn i | -| main.rs:997:5:997:5 | h | main.rs:57:1:76:1 | fn h | -| main.rs:998:5:998:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:999:5:999:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:1000:5:1000:5 | j | main.rs:104:1:108:1 | fn j | -| main.rs:1001:5:1001:6 | m6 | main.rs:116:1:128:1 | mod m6 | -| main.rs:1001:5:1001:9 | ...::g | main.rs:121:5:127:5 | fn g | -| main.rs:1002:5:1002:6 | m7 | main.rs:130:1:149:1 | mod m7 | -| main.rs:1002:5:1002:9 | ...::f | main.rs:141:5:148:5 | fn f | -| main.rs:1003:5:1003:6 | m8 | main.rs:151:1:205:1 | mod m8 | -| main.rs:1003:5:1003:9 | ...::g | main.rs:189:5:204:5 | fn g | -| main.rs:1004:5:1004:6 | m9 | main.rs:207:1:215:1 | mod m9 | -| main.rs:1004:5:1004:9 | ...::f | main.rs:210:5:214:5 | fn f | -| main.rs:1005:5:1005:7 | m11 | main.rs:238:1:275:1 | mod m11 | -| main.rs:1005:5:1005:10 | ...::f | main.rs:243:5:246:5 | fn f | -| main.rs:1006:5:1006:7 | m15 | main.rs:306:1:375:1 | mod m15 | -| main.rs:1006:5:1006:10 | ...::f | main.rs:362:5:374:5 | fn f | -| main.rs:1007:5:1007:7 | m16 | main.rs:377:1:574:1 | mod m16 | -| main.rs:1007:5:1007:10 | ...::f | main.rs:446:5:470:5 | fn f | -| main.rs:1008:5:1008:20 | trait_visibility | main.rs:576:1:626:1 | mod trait_visibility | -| main.rs:1008:5:1008:23 | ...::f | main.rs:603:5:625:5 | fn f | -| main.rs:1009:5:1009:7 | m17 | main.rs:628:1:658:1 | mod m17 | -| main.rs:1009:5:1009:10 | ...::f | main.rs:652:5:657:5 | fn f | -| main.rs:1010:5:1010:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | -| main.rs:1010:5:1010:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | -| main.rs:1011:5:1011:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | -| main.rs:1011:5:1011:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | -| main.rs:1012:5:1012:7 | my3 | my2/mod.rs:20:1:20:12 | mod my3 | -| main.rs:1012:5:1012:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | -| main.rs:1013:5:1013:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| main.rs:1014:5:1014:12 | my_alias | main.rs:1:1:1:7 | mod my | -| main.rs:1014:5:1014:22 | ...::nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| main.rs:1015:5:1015:7 | m18 | main.rs:660:1:678:1 | mod m18 | -| main.rs:1015:5:1015:12 | ...::m19 | main.rs:665:5:677:5 | mod m19 | -| main.rs:1015:5:1015:17 | ...::m20 | main.rs:670:9:676:9 | mod m20 | -| main.rs:1015:5:1015:20 | ...::g | main.rs:671:13:675:13 | fn g | -| main.rs:1016:5:1016:7 | m23 | main.rs:707:1:732:1 | mod m23 | -| main.rs:1016:5:1016:10 | ...::f | main.rs:727:5:731:5 | fn f | -| main.rs:1017:5:1017:7 | m24 | main.rs:734:1:802:1 | mod m24 | -| main.rs:1017:5:1017:10 | ...::f | main.rs:788:5:801:5 | fn f | -| main.rs:1018:5:1018:8 | zelf | main.rs:0:0:0:0 | Crate(main@0.0.1) | -| main.rs:1018:5:1018:11 | ...::h | main.rs:57:1:76:1 | fn h | -| main.rs:1019:5:1019:13 | z_changed | main.rs:807:1:807:9 | fn z_changed | -| main.rs:1020:5:1020:11 | AStruct | main.rs:809:1:809:17 | struct AStruct | -| main.rs:1020:5:1020:22 | ...::z_on_type | main.rs:813:5:813:17 | fn z_on_type | -| main.rs:1021:5:1021:11 | AStruct | main.rs:809:1:809:17 | struct AStruct | -| main.rs:1022:5:1022:29 | impl_with_attribute_macro | main.rs:877:1:896:1 | mod impl_with_attribute_macro | -| main.rs:1022:5:1022:35 | ...::test | main.rs:892:5:895:5 | fn test | -| main.rs:1023:5:1023:12 | patterns | main.rs:898:1:939:1 | mod patterns | -| main.rs:1023:5:1023:18 | ...::test | main.rs:899:5:913:5 | fn test | +| main.rs:789:10:789:15 | TraitB | main.rs:746:5:748:5 | trait TraitB | +| main.rs:789:21:789:31 | Implementor | main.rs:779:5:779:23 | struct Implementor | +| main.rs:791:13:791:19 | println | {EXTERNAL LOCATION} | MacroRules | +| main.rs:797:24:797:34 | Implementor | main.rs:779:5:779:23 | struct Implementor | +| main.rs:798:23:798:35 | GenericStruct | main.rs:750:5:753:5 | struct GenericStruct | +| main.rs:804:9:804:36 | GenericStruct::<...> | main.rs:750:5:753:5 | struct GenericStruct | +| main.rs:804:9:804:50 | ...::call_trait_a | main.rs:761:9:763:9 | fn call_trait_a | +| main.rs:804:25:804:35 | Implementor | main.rs:779:5:779:23 | struct Implementor | +| main.rs:807:9:807:36 | GenericStruct::<...> | main.rs:750:5:753:5 | struct GenericStruct | +| main.rs:807:9:807:47 | ...::call_both | main.rs:773:9:776:9 | fn call_both | +| main.rs:807:25:807:35 | Implementor | main.rs:779:5:779:23 | struct Implementor | +| main.rs:813:3:813:12 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | +| main.rs:813:3:813:24 | ...::add_suffix | proc_macro.rs:4:1:13:1 | fn add_suffix | +| main.rs:817:6:817:12 | AStruct | main.rs:816:1:816:17 | struct AStruct | +| main.rs:819:7:819:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | +| main.rs:819:7:819:28 | ...::add_suffix | proc_macro.rs:4:1:13:1 | fn add_suffix | +| main.rs:822:7:822:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | +| main.rs:822:7:822:28 | ...::add_suffix | proc_macro.rs:4:1:13:1 | fn add_suffix | +| main.rs:827:9:827:11 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:827:9:827:19 | ...::marker | {EXTERNAL LOCATION} | mod marker | +| main.rs:827:9:827:32 | ...::PhantomData | {EXTERNAL LOCATION} | struct PhantomData | +| main.rs:828:9:828:11 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:828:9:828:19 | ...::result | {EXTERNAL LOCATION} | mod result | +| main.rs:828:9:828:27 | ...::Result | {EXTERNAL LOCATION} | enum Result | +| main.rs:836:19:836:22 | Self | main.rs:830:5:838:5 | trait Reduce | +| main.rs:836:19:836:29 | ...::Input | main.rs:831:9:831:19 | type Input | +| main.rs:837:14:837:46 | Result::<...> | {EXTERNAL LOCATION} | enum Result | +| main.rs:837:21:837:24 | Self | main.rs:830:5:838:5 | trait Reduce | +| main.rs:837:21:837:32 | ...::Output | main.rs:832:21:833:20 | type Output | +| main.rs:837:35:837:38 | Self | main.rs:830:5:838:5 | trait Reduce | +| main.rs:837:35:837:45 | ...::Error | main.rs:831:21:832:19 | type Error | +| main.rs:841:17:841:34 | PhantomData::<...> | {EXTERNAL LOCATION} | struct PhantomData | +| main.rs:841:29:841:33 | Input | main.rs:840:19:840:23 | Input | +| main.rs:842:17:842:34 | PhantomData::<...> | {EXTERNAL LOCATION} | struct PhantomData | +| main.rs:842:29:842:33 | Error | main.rs:840:26:840:30 | Error | +| main.rs:849:11:849:16 | Reduce | main.rs:830:5:838:5 | trait Reduce | +| main.rs:850:13:853:9 | MyImpl::<...> | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:851:13:851:17 | Input | main.rs:847:13:847:17 | Input | +| main.rs:852:13:852:17 | Error | main.rs:848:13:848:17 | Error | +| main.rs:855:22:858:9 | Result::<...> | {EXTERNAL LOCATION} | enum Result | +| main.rs:856:13:856:17 | Input | main.rs:847:13:847:17 | Input | +| main.rs:857:13:857:16 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:857:13:857:23 | ...::Error | main.rs:859:11:863:9 | type Error | +| main.rs:860:22:862:9 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:861:11:861:15 | Error | main.rs:848:13:848:17 | Error | +| main.rs:865:13:865:17 | Input | main.rs:847:13:847:17 | Input | +| main.rs:870:19:870:22 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:870:19:870:29 | ...::Input | main.rs:855:9:859:9 | type Input | +| main.rs:871:14:874:9 | Result::<...> | {EXTERNAL LOCATION} | enum Result | +| main.rs:872:13:872:16 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:872:13:872:24 | ...::Output | main.rs:863:11:866:9 | type Output | +| main.rs:873:13:873:16 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:873:13:873:23 | ...::Error | main.rs:859:11:863:9 | type Error | +| main.rs:880:5:880:7 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:880:11:880:14 | self | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:882:15:882:17 | ztd | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:882:15:882:25 | ...::string | {EXTERNAL LOCATION} | mod string | +| main.rs:882:15:882:33 | ...::String | {EXTERNAL LOCATION} | struct String | +| main.rs:892:7:892:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | +| main.rs:892:7:892:26 | ...::identity | proc_macro.rs:15:1:18:1 | fn identity | +| main.rs:893:10:893:15 | ATrait | main.rs:888:5:890:5 | trait ATrait | +| main.rs:893:21:893:23 | i64 | {EXTERNAL LOCATION} | struct i64 | +| main.rs:895:11:895:13 | i64 | {EXTERNAL LOCATION} | struct i64 | +| main.rs:901:17:901:19 | Foo | main.rs:886:5:886:15 | struct Foo | +| main.rs:907:22:907:32 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:907:29:907:31 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:908:17:908:20 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:909:17:909:27 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:909:24:909:26 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:910:13:910:16 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:911:17:911:20 | None | {EXTERNAL LOCATION} | None | +| main.rs:913:13:913:16 | None | {EXTERNAL LOCATION} | None | +| main.rs:914:17:914:20 | None | {EXTERNAL LOCATION} | None | +| main.rs:923:19:923:29 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:923:26:923:28 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:924:26:924:29 | test | main.rs:906:5:920:5 | fn test | +| main.rs:930:14:930:16 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:935:17:935:20 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:937:13:937:16 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:942:13:942:16 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:942:18:942:18 | z | main.rs:929:5:931:12 | Const | +| main.rs:942:24:942:24 | z | main.rs:929:5:931:12 | Const | +| main.rs:950:24:950:26 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:953:10:953:20 | TupleStruct | main.rs:950:5:950:28 | struct TupleStruct | +| main.rs:955:19:955:21 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:955:27:955:30 | Self | main.rs:950:5:950:28 | struct TupleStruct | +| main.rs:956:21:956:24 | Self | main.rs:950:5:950:28 | struct TupleStruct | +| main.rs:957:31:957:34 | Self | main.rs:950:5:950:28 | struct TupleStruct | +| main.rs:963:12:963:14 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:967:10:967:21 | StructStruct | main.rs:962:5:964:5 | struct StructStruct | +| main.rs:969:19:969:21 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:969:27:969:30 | Self | main.rs:962:5:964:5 | struct StructStruct | +| main.rs:970:13:970:16 | Self | main.rs:962:5:964:5 | struct StructStruct | +| main.rs:976:13:976:15 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:981:10:981:15 | MyEnum | main.rs:974:5:978:5 | enum MyEnum | +| main.rs:982:25:982:27 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:984:17:984:20 | Self | main.rs:974:5:978:5 | enum MyEnum | +| main.rs:984:17:984:23 | ...::A | main.rs:975:9:977:9 | A | +| main.rs:995:5:995:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:995:5:995:14 | ...::nested | my.rs:1:1:1:15 | mod nested | +| main.rs:995:5:995:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | +| main.rs:995:5:995:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | +| main.rs:995:5:995:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | +| main.rs:996:5:996:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:996:5:996:9 | ...::f | my.rs:5:1:7:1 | fn f | +| main.rs:997:5:997:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | +| main.rs:997:5:997:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | +| main.rs:997:5:997:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | +| main.rs:997:5:997:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:998:5:998:5 | f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:999:5:999:5 | g | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:1000:5:1000:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | +| main.rs:1000:5:1000:12 | ...::h | main.rs:57:1:76:1 | fn h | +| main.rs:1001:5:1001:6 | m1 | main.rs:20:1:44:1 | mod m1 | +| main.rs:1001:5:1001:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | +| main.rs:1001:5:1001:13 | ...::g | main.rs:30:9:34:9 | fn g | +| main.rs:1002:5:1002:6 | m1 | main.rs:20:1:44:1 | mod m1 | +| main.rs:1002:5:1002:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | +| main.rs:1002:5:1002:14 | ...::m3 | main.rs:36:9:42:9 | mod m3 | +| main.rs:1002:5:1002:17 | ...::h | main.rs:37:27:41:13 | fn h | +| main.rs:1003:5:1003:6 | m4 | main.rs:46:1:53:1 | mod m4 | +| main.rs:1003:5:1003:9 | ...::i | main.rs:49:5:52:5 | fn i | +| main.rs:1004:5:1004:5 | h | main.rs:57:1:76:1 | fn h | +| main.rs:1005:5:1005:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:1006:5:1006:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:1007:5:1007:5 | j | main.rs:104:1:108:1 | fn j | +| main.rs:1008:5:1008:6 | m6 | main.rs:116:1:128:1 | mod m6 | +| main.rs:1008:5:1008:9 | ...::g | main.rs:121:5:127:5 | fn g | +| main.rs:1009:5:1009:6 | m7 | main.rs:130:1:149:1 | mod m7 | +| main.rs:1009:5:1009:9 | ...::f | main.rs:141:5:148:5 | fn f | +| main.rs:1010:5:1010:6 | m8 | main.rs:151:1:205:1 | mod m8 | +| main.rs:1010:5:1010:9 | ...::g | main.rs:189:5:204:5 | fn g | +| main.rs:1011:5:1011:6 | m9 | main.rs:207:1:215:1 | mod m9 | +| main.rs:1011:5:1011:9 | ...::f | main.rs:210:5:214:5 | fn f | +| main.rs:1012:5:1012:7 | m11 | main.rs:238:1:275:1 | mod m11 | +| main.rs:1012:5:1012:10 | ...::f | main.rs:243:5:246:5 | fn f | +| main.rs:1013:5:1013:7 | m15 | main.rs:306:1:375:1 | mod m15 | +| main.rs:1013:5:1013:10 | ...::f | main.rs:362:5:374:5 | fn f | +| main.rs:1014:5:1014:7 | m16 | main.rs:377:1:574:1 | mod m16 | +| main.rs:1014:5:1014:10 | ...::f | main.rs:446:5:470:5 | fn f | +| main.rs:1015:5:1015:20 | trait_visibility | main.rs:576:1:633:1 | mod trait_visibility | +| main.rs:1015:5:1015:23 | ...::f | main.rs:603:5:632:5 | fn f | +| main.rs:1016:5:1016:7 | m17 | main.rs:635:1:665:1 | mod m17 | +| main.rs:1016:5:1016:10 | ...::f | main.rs:659:5:664:5 | fn f | +| main.rs:1017:5:1017:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | +| main.rs:1017:5:1017:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | +| main.rs:1018:5:1018:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | +| main.rs:1018:5:1018:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | +| main.rs:1019:5:1019:7 | my3 | my2/mod.rs:20:1:20:12 | mod my3 | +| main.rs:1019:5:1019:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | +| main.rs:1020:5:1020:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| main.rs:1021:5:1021:12 | my_alias | main.rs:1:1:1:7 | mod my | +| main.rs:1021:5:1021:22 | ...::nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| main.rs:1022:5:1022:7 | m18 | main.rs:667:1:685:1 | mod m18 | +| main.rs:1022:5:1022:12 | ...::m19 | main.rs:672:5:684:5 | mod m19 | +| main.rs:1022:5:1022:17 | ...::m20 | main.rs:677:9:683:9 | mod m20 | +| main.rs:1022:5:1022:20 | ...::g | main.rs:678:13:682:13 | fn g | +| main.rs:1023:5:1023:7 | m23 | main.rs:714:1:739:1 | mod m23 | +| main.rs:1023:5:1023:10 | ...::f | main.rs:734:5:738:5 | fn f | +| main.rs:1024:5:1024:7 | m24 | main.rs:741:1:809:1 | mod m24 | +| main.rs:1024:5:1024:10 | ...::f | main.rs:795:5:808:5 | fn f | +| main.rs:1025:5:1025:8 | zelf | main.rs:0:0:0:0 | Crate(main@0.0.1) | +| main.rs:1025:5:1025:11 | ...::h | main.rs:57:1:76:1 | fn h | +| main.rs:1026:5:1026:13 | z_changed | main.rs:814:1:814:9 | fn z_changed | +| main.rs:1027:5:1027:11 | AStruct | main.rs:816:1:816:17 | struct AStruct | +| main.rs:1027:5:1027:22 | ...::z_on_type | main.rs:820:5:820:17 | fn z_on_type | +| main.rs:1028:5:1028:11 | AStruct | main.rs:816:1:816:17 | struct AStruct | +| main.rs:1029:5:1029:29 | impl_with_attribute_macro | main.rs:884:1:903:1 | mod impl_with_attribute_macro | +| main.rs:1029:5:1029:35 | ...::test | main.rs:899:5:902:5 | fn test | +| main.rs:1030:5:1030:12 | patterns | main.rs:905:1:946:1 | mod patterns | +| main.rs:1030:5:1030:18 | ...::test | main.rs:906:5:920:5 | fn test | | my2/mod.rs:4:5:4:11 | println | {EXTERNAL LOCATION} | MacroRules | | my2/mod.rs:5:5:5:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:5:5:5:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | @@ -592,7 +595,7 @@ resolvePath | my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g | | my2/my3/mod.rs:4:5:4:5 | h | main.rs:57:1:76:1 | fn h | | my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:25:34 | SourceFile | -| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:1024:2 | SourceFile | +| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:1031:2 | SourceFile | | my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:57:1:76:1 | fn h | | my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:25:34 | SourceFile | | my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g | From 330505c524997ada28e49459c37eeec9dd8f9ee2 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 19 Jan 2026 14:35:50 +0100 Subject: [PATCH 2/5] Rust: Add tests for associated types --- .../library-tests/path-resolution/main.rs | 65 + .../path-resolution/path-resolution.expected | 291 ++-- .../PathResolutionConsistency.expected | 5 + .../TypeInferenceConsistency.expected | 3 + .../type-inference/associated_types.rs | 114 +- .../type-inference/type-inference.expected | 1243 +++++++++-------- 6 files changed, 1032 insertions(+), 689 deletions(-) create mode 100644 rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index f428f851c31d..3397d3a7000d 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -877,6 +877,71 @@ mod associated_types { } } +mod associated_types_subtrait { + trait Super { + type Out; // SuperAssoc + } // Super + + trait Sub: Super // $ item=Super + { + fn f() -> Self::Out // $ item=SuperAssoc + ; // Sub_f + } // Sub + + struct S( + ST, // $ item=ST + ); + + #[rustfmt::skip] + impl Super for S { // $ item=Super item=S item=i32 + type Out = char // $ item=char + ; // S::Out + } + + #[rustfmt::skip] + impl Super for S { // $ item=Super item=S item=bool + type Out = i64 // $ item=i64 + ; // S::Out + } + + #[rustfmt::skip] + impl Sub for S { // $ item=Sub item=S item=i32 + fn f() -> Self::Out { // $ MISSING: item=SuperAssoc SPURIOUS: item=S::Out item=S::Out item=S::Out + 'a' + } + } + + #[rustfmt::skip] + impl Sub for S { // $ item=Sub item=S item=bool + fn f() -> Self::Out { // $ MISSING: item=SuperAssoc SPURIOUS: item=S::Out item=S::Out item=S::Out + 1 + } + } + + trait SuperAlt { + type Out; // SuperAltAssoc + } // SuperAlt + + trait SubAlt: SuperAlt // $ item=SuperAlt + { + fn f(self) -> Self::Out // $ item=SuperAltAssoc + ; // SubAlt_f + } // SubAlt + + #[rustfmt::skip] + impl SuperAlt for S { // $ item=SuperAlt item=S item=A + type Out = A // $ item=A + ; // S::Out + } + + #[rustfmt::skip] + impl SubAlt for S { // $ item=SubAlt item=S item=A + fn f(self) -> Self::Out { // $ MISSING: item=SuperAltAssoc SPURIOUS: item=S::Out item=S::Out item=S::Out + self.0 + } + } +} + use std::{self as ztd}; // $ item=std fn use_ztd(x: ztd::string::String) {} // $ item=String diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index ad581e8bf93e..00d38d6e70d5 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -31,9 +31,10 @@ mod | main.rs:714:1:739:1 | mod m23 | | main.rs:741:1:809:1 | mod m24 | | main.rs:826:1:878:1 | mod associated_types | -| main.rs:884:1:903:1 | mod impl_with_attribute_macro | -| main.rs:905:1:946:1 | mod patterns | -| main.rs:948:1:992:1 | mod self_constructors | +| main.rs:880:1:943:1 | mod associated_types_subtrait | +| main.rs:949:1:968:1 | mod impl_with_attribute_macro | +| main.rs:970:1:1011:1 | mod patterns | +| main.rs:1013:1:1057:1 | mod self_constructors | | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:20:1:20:12 | mod my3 | | my2/mod.rs:22:1:23:10 | mod mymod | @@ -74,7 +75,7 @@ resolvePath | main.rs:37:17:37:24 | ...::f | main.rs:26:9:28:9 | fn f | | main.rs:39:17:39:23 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:40:17:40:17 | f | main.rs:26:9:28:9 | fn f | -| main.rs:47:9:47:13 | super | main.rs:1:1:1031:2 | SourceFile | +| main.rs:47:9:47:13 | super | main.rs:1:1:1096:2 | SourceFile | | main.rs:47:9:47:17 | ...::m1 | main.rs:20:1:44:1 | mod m1 | | main.rs:47:9:47:21 | ...::m2 | main.rs:25:5:43:5 | mod m2 | | main.rs:47:9:47:24 | ...::g | main.rs:30:9:34:9 | fn g | @@ -89,7 +90,7 @@ resolvePath | main.rs:68:17:68:19 | Foo | main.rs:66:9:66:21 | struct Foo | | main.rs:71:13:71:15 | Foo | main.rs:60:5:60:17 | struct Foo | | main.rs:73:5:73:5 | f | main.rs:62:5:69:5 | fn f | -| main.rs:75:5:75:8 | self | main.rs:1:1:1031:2 | SourceFile | +| main.rs:75:5:75:8 | self | main.rs:1:1:1096:2 | SourceFile | | main.rs:75:5:75:11 | ...::i | main.rs:78:1:90:1 | fn i | | main.rs:79:5:79:11 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:81:13:81:15 | Foo | main.rs:55:1:55:13 | struct Foo | @@ -111,7 +112,7 @@ resolvePath | main.rs:112:9:112:15 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:118:9:118:15 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:122:9:122:15 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:125:13:125:17 | super | main.rs:1:1:1031:2 | SourceFile | +| main.rs:125:13:125:17 | super | main.rs:1:1:1096:2 | SourceFile | | main.rs:125:13:125:21 | ...::m5 | main.rs:110:1:114:1 | mod m5 | | main.rs:126:9:126:9 | f | main.rs:111:5:113:5 | fn f | | main.rs:126:9:126:9 | f | main.rs:117:5:119:5 | fn f | @@ -452,124 +453,164 @@ resolvePath | main.rs:872:13:872:24 | ...::Output | main.rs:863:11:866:9 | type Output | | main.rs:873:13:873:16 | Self | main.rs:840:5:843:5 | struct MyImpl | | main.rs:873:13:873:23 | ...::Error | main.rs:859:11:863:9 | type Error | -| main.rs:880:5:880:7 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:880:11:880:14 | self | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:882:15:882:17 | ztd | {EXTERNAL LOCATION} | Crate(std@0.0.0) | -| main.rs:882:15:882:25 | ...::string | {EXTERNAL LOCATION} | mod string | -| main.rs:882:15:882:33 | ...::String | {EXTERNAL LOCATION} | struct String | -| main.rs:892:7:892:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | -| main.rs:892:7:892:26 | ...::identity | proc_macro.rs:15:1:18:1 | fn identity | -| main.rs:893:10:893:15 | ATrait | main.rs:888:5:890:5 | trait ATrait | -| main.rs:893:21:893:23 | i64 | {EXTERNAL LOCATION} | struct i64 | -| main.rs:895:11:895:13 | i64 | {EXTERNAL LOCATION} | struct i64 | -| main.rs:901:17:901:19 | Foo | main.rs:886:5:886:15 | struct Foo | -| main.rs:907:22:907:32 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:907:29:907:31 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:908:17:908:20 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:909:17:909:27 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:909:24:909:26 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:910:13:910:16 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:911:17:911:20 | None | {EXTERNAL LOCATION} | None | -| main.rs:913:13:913:16 | None | {EXTERNAL LOCATION} | None | -| main.rs:914:17:914:20 | None | {EXTERNAL LOCATION} | None | -| main.rs:923:19:923:29 | Option::<...> | {EXTERNAL LOCATION} | enum Option | -| main.rs:923:26:923:28 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:924:26:924:29 | test | main.rs:906:5:920:5 | fn test | -| main.rs:930:14:930:16 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:935:17:935:20 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:937:13:937:16 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:942:13:942:16 | Some | {EXTERNAL LOCATION} | Some | -| main.rs:942:18:942:18 | z | main.rs:929:5:931:12 | Const | -| main.rs:942:24:942:24 | z | main.rs:929:5:931:12 | Const | -| main.rs:950:24:950:26 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:953:10:953:20 | TupleStruct | main.rs:950:5:950:28 | struct TupleStruct | -| main.rs:955:19:955:21 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:955:27:955:30 | Self | main.rs:950:5:950:28 | struct TupleStruct | -| main.rs:956:21:956:24 | Self | main.rs:950:5:950:28 | struct TupleStruct | -| main.rs:957:31:957:34 | Self | main.rs:950:5:950:28 | struct TupleStruct | -| main.rs:963:12:963:14 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:967:10:967:21 | StructStruct | main.rs:962:5:964:5 | struct StructStruct | -| main.rs:969:19:969:21 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:969:27:969:30 | Self | main.rs:962:5:964:5 | struct StructStruct | -| main.rs:970:13:970:16 | Self | main.rs:962:5:964:5 | struct StructStruct | -| main.rs:976:13:976:15 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:981:10:981:15 | MyEnum | main.rs:974:5:978:5 | enum MyEnum | -| main.rs:982:25:982:27 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:984:17:984:20 | Self | main.rs:974:5:978:5 | enum MyEnum | -| main.rs:984:17:984:23 | ...::A | main.rs:975:9:977:9 | A | -| main.rs:995:5:995:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:995:5:995:14 | ...::nested | my.rs:1:1:1:15 | mod nested | -| main.rs:995:5:995:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | -| main.rs:995:5:995:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | -| main.rs:995:5:995:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | -| main.rs:996:5:996:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:996:5:996:9 | ...::f | my.rs:5:1:7:1 | fn f | -| main.rs:997:5:997:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | -| main.rs:997:5:997:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | -| main.rs:997:5:997:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | -| main.rs:997:5:997:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:998:5:998:5 | f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:999:5:999:5 | g | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:1000:5:1000:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | -| main.rs:1000:5:1000:12 | ...::h | main.rs:57:1:76:1 | fn h | -| main.rs:1001:5:1001:6 | m1 | main.rs:20:1:44:1 | mod m1 | -| main.rs:1001:5:1001:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | -| main.rs:1001:5:1001:13 | ...::g | main.rs:30:9:34:9 | fn g | -| main.rs:1002:5:1002:6 | m1 | main.rs:20:1:44:1 | mod m1 | -| main.rs:1002:5:1002:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | -| main.rs:1002:5:1002:14 | ...::m3 | main.rs:36:9:42:9 | mod m3 | -| main.rs:1002:5:1002:17 | ...::h | main.rs:37:27:41:13 | fn h | -| main.rs:1003:5:1003:6 | m4 | main.rs:46:1:53:1 | mod m4 | -| main.rs:1003:5:1003:9 | ...::i | main.rs:49:5:52:5 | fn i | -| main.rs:1004:5:1004:5 | h | main.rs:57:1:76:1 | fn h | -| main.rs:1005:5:1005:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:1006:5:1006:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:1007:5:1007:5 | j | main.rs:104:1:108:1 | fn j | -| main.rs:1008:5:1008:6 | m6 | main.rs:116:1:128:1 | mod m6 | -| main.rs:1008:5:1008:9 | ...::g | main.rs:121:5:127:5 | fn g | -| main.rs:1009:5:1009:6 | m7 | main.rs:130:1:149:1 | mod m7 | -| main.rs:1009:5:1009:9 | ...::f | main.rs:141:5:148:5 | fn f | -| main.rs:1010:5:1010:6 | m8 | main.rs:151:1:205:1 | mod m8 | -| main.rs:1010:5:1010:9 | ...::g | main.rs:189:5:204:5 | fn g | -| main.rs:1011:5:1011:6 | m9 | main.rs:207:1:215:1 | mod m9 | -| main.rs:1011:5:1011:9 | ...::f | main.rs:210:5:214:5 | fn f | -| main.rs:1012:5:1012:7 | m11 | main.rs:238:1:275:1 | mod m11 | -| main.rs:1012:5:1012:10 | ...::f | main.rs:243:5:246:5 | fn f | -| main.rs:1013:5:1013:7 | m15 | main.rs:306:1:375:1 | mod m15 | -| main.rs:1013:5:1013:10 | ...::f | main.rs:362:5:374:5 | fn f | -| main.rs:1014:5:1014:7 | m16 | main.rs:377:1:574:1 | mod m16 | -| main.rs:1014:5:1014:10 | ...::f | main.rs:446:5:470:5 | fn f | -| main.rs:1015:5:1015:20 | trait_visibility | main.rs:576:1:633:1 | mod trait_visibility | -| main.rs:1015:5:1015:23 | ...::f | main.rs:603:5:632:5 | fn f | -| main.rs:1016:5:1016:7 | m17 | main.rs:635:1:665:1 | mod m17 | -| main.rs:1016:5:1016:10 | ...::f | main.rs:659:5:664:5 | fn f | -| main.rs:1017:5:1017:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | -| main.rs:1017:5:1017:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | -| main.rs:1018:5:1018:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | -| main.rs:1018:5:1018:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | -| main.rs:1019:5:1019:7 | my3 | my2/mod.rs:20:1:20:12 | mod my3 | -| main.rs:1019:5:1019:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | -| main.rs:1020:5:1020:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| main.rs:1021:5:1021:12 | my_alias | main.rs:1:1:1:7 | mod my | -| main.rs:1021:5:1021:22 | ...::nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| main.rs:1022:5:1022:7 | m18 | main.rs:667:1:685:1 | mod m18 | -| main.rs:1022:5:1022:12 | ...::m19 | main.rs:672:5:684:5 | mod m19 | -| main.rs:1022:5:1022:17 | ...::m20 | main.rs:677:9:683:9 | mod m20 | -| main.rs:1022:5:1022:20 | ...::g | main.rs:678:13:682:13 | fn g | -| main.rs:1023:5:1023:7 | m23 | main.rs:714:1:739:1 | mod m23 | -| main.rs:1023:5:1023:10 | ...::f | main.rs:734:5:738:5 | fn f | -| main.rs:1024:5:1024:7 | m24 | main.rs:741:1:809:1 | mod m24 | -| main.rs:1024:5:1024:10 | ...::f | main.rs:795:5:808:5 | fn f | -| main.rs:1025:5:1025:8 | zelf | main.rs:0:0:0:0 | Crate(main@0.0.1) | -| main.rs:1025:5:1025:11 | ...::h | main.rs:57:1:76:1 | fn h | -| main.rs:1026:5:1026:13 | z_changed | main.rs:814:1:814:9 | fn z_changed | -| main.rs:1027:5:1027:11 | AStruct | main.rs:816:1:816:17 | struct AStruct | -| main.rs:1027:5:1027:22 | ...::z_on_type | main.rs:820:5:820:17 | fn z_on_type | -| main.rs:1028:5:1028:11 | AStruct | main.rs:816:1:816:17 | struct AStruct | -| main.rs:1029:5:1029:29 | impl_with_attribute_macro | main.rs:884:1:903:1 | mod impl_with_attribute_macro | -| main.rs:1029:5:1029:35 | ...::test | main.rs:899:5:902:5 | fn test | -| main.rs:1030:5:1030:12 | patterns | main.rs:905:1:946:1 | mod patterns | -| main.rs:1030:5:1030:18 | ...::test | main.rs:906:5:920:5 | fn test | +| main.rs:885:16:885:20 | Super | main.rs:881:5:883:5 | trait Super | +| main.rs:887:19:887:22 | Self | main.rs:885:5:889:5 | trait Sub | +| main.rs:887:19:887:27 | ...::Out | main.rs:882:9:882:17 | type Out | +| main.rs:892:9:892:10 | ST | main.rs:891:14:891:15 | ST | +| main.rs:896:10:896:14 | Super | main.rs:881:5:883:5 | trait Super | +| main.rs:896:20:896:25 | S::<...> | main.rs:891:5:893:6 | struct S | +| main.rs:896:22:896:24 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:897:20:897:23 | char | {EXTERNAL LOCATION} | struct char | +| main.rs:902:10:902:14 | Super | main.rs:881:5:883:5 | trait Super | +| main.rs:902:20:902:26 | S::<...> | main.rs:891:5:893:6 | struct S | +| main.rs:902:22:902:25 | bool | {EXTERNAL LOCATION} | struct bool | +| main.rs:903:20:903:22 | i64 | {EXTERNAL LOCATION} | struct i64 | +| main.rs:908:10:908:12 | Sub | main.rs:885:5:889:5 | trait Sub | +| main.rs:908:18:908:23 | S::<...> | main.rs:891:5:893:6 | struct S | +| main.rs:908:20:908:22 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:909:19:909:22 | Self | main.rs:891:5:893:6 | struct S | +| main.rs:909:19:909:27 | ...::Out | main.rs:896:29:898:9 | type Out | +| main.rs:909:19:909:27 | ...::Out | main.rs:902:30:904:9 | type Out | +| main.rs:909:19:909:27 | ...::Out | main.rs:932:33:934:9 | type Out | +| main.rs:915:10:915:12 | Sub | main.rs:885:5:889:5 | trait Sub | +| main.rs:915:18:915:24 | S::<...> | main.rs:891:5:893:6 | struct S | +| main.rs:915:20:915:23 | bool | {EXTERNAL LOCATION} | struct bool | +| main.rs:916:19:916:22 | Self | main.rs:891:5:893:6 | struct S | +| main.rs:916:19:916:27 | ...::Out | main.rs:896:29:898:9 | type Out | +| main.rs:916:19:916:27 | ...::Out | main.rs:902:30:904:9 | type Out | +| main.rs:916:19:916:27 | ...::Out | main.rs:932:33:934:9 | type Out | +| main.rs:925:19:925:26 | SuperAlt | main.rs:921:5:923:5 | trait SuperAlt | +| main.rs:927:23:927:26 | Self | main.rs:925:5:929:5 | trait SubAlt | +| main.rs:927:23:927:31 | ...::Out | main.rs:922:9:922:17 | type Out | +| main.rs:932:13:932:20 | SuperAlt | main.rs:921:5:923:5 | trait SuperAlt | +| main.rs:932:26:932:29 | S::<...> | main.rs:891:5:893:6 | struct S | +| main.rs:932:28:932:28 | A | main.rs:932:10:932:10 | A | +| main.rs:933:20:933:20 | A | main.rs:932:10:932:10 | A | +| main.rs:938:13:938:18 | SubAlt | main.rs:925:5:929:5 | trait SubAlt | +| main.rs:938:24:938:27 | S::<...> | main.rs:891:5:893:6 | struct S | +| main.rs:938:26:938:26 | A | main.rs:938:10:938:10 | A | +| main.rs:939:23:939:26 | Self | main.rs:891:5:893:6 | struct S | +| main.rs:939:23:939:31 | ...::Out | main.rs:896:29:898:9 | type Out | +| main.rs:939:23:939:31 | ...::Out | main.rs:902:30:904:9 | type Out | +| main.rs:939:23:939:31 | ...::Out | main.rs:932:33:934:9 | type Out | +| main.rs:945:5:945:7 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:945:11:945:14 | self | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:947:15:947:17 | ztd | {EXTERNAL LOCATION} | Crate(std@0.0.0) | +| main.rs:947:15:947:25 | ...::string | {EXTERNAL LOCATION} | mod string | +| main.rs:947:15:947:33 | ...::String | {EXTERNAL LOCATION} | struct String | +| main.rs:957:7:957:16 | proc_macro | proc_macro.rs:0:0:0:0 | Crate(proc_macro@0.0.1) | +| main.rs:957:7:957:26 | ...::identity | proc_macro.rs:15:1:18:1 | fn identity | +| main.rs:958:10:958:15 | ATrait | main.rs:953:5:955:5 | trait ATrait | +| main.rs:958:21:958:23 | i64 | {EXTERNAL LOCATION} | struct i64 | +| main.rs:960:11:960:13 | i64 | {EXTERNAL LOCATION} | struct i64 | +| main.rs:966:17:966:19 | Foo | main.rs:951:5:951:15 | struct Foo | +| main.rs:972:22:972:32 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:972:29:972:31 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:973:17:973:20 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:974:17:974:27 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:974:24:974:26 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:975:13:975:16 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:976:17:976:20 | None | {EXTERNAL LOCATION} | None | +| main.rs:978:13:978:16 | None | {EXTERNAL LOCATION} | None | +| main.rs:979:17:979:20 | None | {EXTERNAL LOCATION} | None | +| main.rs:988:19:988:29 | Option::<...> | {EXTERNAL LOCATION} | enum Option | +| main.rs:988:26:988:28 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:989:26:989:29 | test | main.rs:971:5:985:5 | fn test | +| main.rs:995:14:995:16 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1000:17:1000:20 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:1002:13:1002:16 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:1007:13:1007:16 | Some | {EXTERNAL LOCATION} | Some | +| main.rs:1007:18:1007:18 | z | main.rs:994:5:996:12 | Const | +| main.rs:1007:24:1007:24 | z | main.rs:994:5:996:12 | Const | +| main.rs:1015:24:1015:26 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1018:10:1018:20 | TupleStruct | main.rs:1015:5:1015:28 | struct TupleStruct | +| main.rs:1020:19:1020:21 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1020:27:1020:30 | Self | main.rs:1015:5:1015:28 | struct TupleStruct | +| main.rs:1021:21:1021:24 | Self | main.rs:1015:5:1015:28 | struct TupleStruct | +| main.rs:1022:31:1022:34 | Self | main.rs:1015:5:1015:28 | struct TupleStruct | +| main.rs:1028:12:1028:14 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1032:10:1032:21 | StructStruct | main.rs:1027:5:1029:5 | struct StructStruct | +| main.rs:1034:19:1034:21 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1034:27:1034:30 | Self | main.rs:1027:5:1029:5 | struct StructStruct | +| main.rs:1035:13:1035:16 | Self | main.rs:1027:5:1029:5 | struct StructStruct | +| main.rs:1041:13:1041:15 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1046:10:1046:15 | MyEnum | main.rs:1039:5:1043:5 | enum MyEnum | +| main.rs:1047:25:1047:27 | i32 | {EXTERNAL LOCATION} | struct i32 | +| main.rs:1049:17:1049:20 | Self | main.rs:1039:5:1043:5 | enum MyEnum | +| main.rs:1049:17:1049:23 | ...::A | main.rs:1040:9:1042:9 | A | +| main.rs:1060:5:1060:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:1060:5:1060:14 | ...::nested | my.rs:1:1:1:15 | mod nested | +| main.rs:1060:5:1060:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | +| main.rs:1060:5:1060:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | +| main.rs:1060:5:1060:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | +| main.rs:1061:5:1061:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:1061:5:1061:9 | ...::f | my.rs:5:1:7:1 | fn f | +| main.rs:1062:5:1062:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | +| main.rs:1062:5:1062:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | +| main.rs:1062:5:1062:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | +| main.rs:1062:5:1062:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:1063:5:1063:5 | f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:1064:5:1064:5 | g | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:1065:5:1065:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | +| main.rs:1065:5:1065:12 | ...::h | main.rs:57:1:76:1 | fn h | +| main.rs:1066:5:1066:6 | m1 | main.rs:20:1:44:1 | mod m1 | +| main.rs:1066:5:1066:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | +| main.rs:1066:5:1066:13 | ...::g | main.rs:30:9:34:9 | fn g | +| main.rs:1067:5:1067:6 | m1 | main.rs:20:1:44:1 | mod m1 | +| main.rs:1067:5:1067:10 | ...::m2 | main.rs:25:5:43:5 | mod m2 | +| main.rs:1067:5:1067:14 | ...::m3 | main.rs:36:9:42:9 | mod m3 | +| main.rs:1067:5:1067:17 | ...::h | main.rs:37:27:41:13 | fn h | +| main.rs:1068:5:1068:6 | m4 | main.rs:46:1:53:1 | mod m4 | +| main.rs:1068:5:1068:9 | ...::i | main.rs:49:5:52:5 | fn i | +| main.rs:1069:5:1069:5 | h | main.rs:57:1:76:1 | fn h | +| main.rs:1070:5:1070:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:1071:5:1071:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:1072:5:1072:5 | j | main.rs:104:1:108:1 | fn j | +| main.rs:1073:5:1073:6 | m6 | main.rs:116:1:128:1 | mod m6 | +| main.rs:1073:5:1073:9 | ...::g | main.rs:121:5:127:5 | fn g | +| main.rs:1074:5:1074:6 | m7 | main.rs:130:1:149:1 | mod m7 | +| main.rs:1074:5:1074:9 | ...::f | main.rs:141:5:148:5 | fn f | +| main.rs:1075:5:1075:6 | m8 | main.rs:151:1:205:1 | mod m8 | +| main.rs:1075:5:1075:9 | ...::g | main.rs:189:5:204:5 | fn g | +| main.rs:1076:5:1076:6 | m9 | main.rs:207:1:215:1 | mod m9 | +| main.rs:1076:5:1076:9 | ...::f | main.rs:210:5:214:5 | fn f | +| main.rs:1077:5:1077:7 | m11 | main.rs:238:1:275:1 | mod m11 | +| main.rs:1077:5:1077:10 | ...::f | main.rs:243:5:246:5 | fn f | +| main.rs:1078:5:1078:7 | m15 | main.rs:306:1:375:1 | mod m15 | +| main.rs:1078:5:1078:10 | ...::f | main.rs:362:5:374:5 | fn f | +| main.rs:1079:5:1079:7 | m16 | main.rs:377:1:574:1 | mod m16 | +| main.rs:1079:5:1079:10 | ...::f | main.rs:446:5:470:5 | fn f | +| main.rs:1080:5:1080:20 | trait_visibility | main.rs:576:1:633:1 | mod trait_visibility | +| main.rs:1080:5:1080:23 | ...::f | main.rs:603:5:632:5 | fn f | +| main.rs:1081:5:1081:7 | m17 | main.rs:635:1:665:1 | mod m17 | +| main.rs:1081:5:1081:10 | ...::f | main.rs:659:5:664:5 | fn f | +| main.rs:1082:5:1082:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | +| main.rs:1082:5:1082:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | +| main.rs:1083:5:1083:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | +| main.rs:1083:5:1083:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | +| main.rs:1084:5:1084:7 | my3 | my2/mod.rs:20:1:20:12 | mod my3 | +| main.rs:1084:5:1084:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | +| main.rs:1085:5:1085:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| main.rs:1086:5:1086:12 | my_alias | main.rs:1:1:1:7 | mod my | +| main.rs:1086:5:1086:22 | ...::nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| main.rs:1087:5:1087:7 | m18 | main.rs:667:1:685:1 | mod m18 | +| main.rs:1087:5:1087:12 | ...::m19 | main.rs:672:5:684:5 | mod m19 | +| main.rs:1087:5:1087:17 | ...::m20 | main.rs:677:9:683:9 | mod m20 | +| main.rs:1087:5:1087:20 | ...::g | main.rs:678:13:682:13 | fn g | +| main.rs:1088:5:1088:7 | m23 | main.rs:714:1:739:1 | mod m23 | +| main.rs:1088:5:1088:10 | ...::f | main.rs:734:5:738:5 | fn f | +| main.rs:1089:5:1089:7 | m24 | main.rs:741:1:809:1 | mod m24 | +| main.rs:1089:5:1089:10 | ...::f | main.rs:795:5:808:5 | fn f | +| main.rs:1090:5:1090:8 | zelf | main.rs:0:0:0:0 | Crate(main@0.0.1) | +| main.rs:1090:5:1090:11 | ...::h | main.rs:57:1:76:1 | fn h | +| main.rs:1091:5:1091:13 | z_changed | main.rs:814:1:814:9 | fn z_changed | +| main.rs:1092:5:1092:11 | AStruct | main.rs:816:1:816:17 | struct AStruct | +| main.rs:1092:5:1092:22 | ...::z_on_type | main.rs:820:5:820:17 | fn z_on_type | +| main.rs:1093:5:1093:11 | AStruct | main.rs:816:1:816:17 | struct AStruct | +| main.rs:1094:5:1094:29 | impl_with_attribute_macro | main.rs:949:1:968:1 | mod impl_with_attribute_macro | +| main.rs:1094:5:1094:35 | ...::test | main.rs:964:5:967:5 | fn test | +| main.rs:1095:5:1095:12 | patterns | main.rs:970:1:1011:1 | mod patterns | +| main.rs:1095:5:1095:18 | ...::test | main.rs:971:5:985:5 | fn test | | my2/mod.rs:4:5:4:11 | println | {EXTERNAL LOCATION} | MacroRules | | my2/mod.rs:5:5:5:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:5:5:5:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | @@ -595,7 +636,7 @@ resolvePath | my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g | | my2/my3/mod.rs:4:5:4:5 | h | main.rs:57:1:76:1 | fn h | | my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:25:34 | SourceFile | -| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:1031:2 | SourceFile | +| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:1096:2 | SourceFile | | my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:57:1:76:1 | fn h | | my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:25:34 | SourceFile | | my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g | diff --git a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected index 97dfe4bc278c..7b751c9ea8be 100644 --- a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected @@ -1,2 +1,7 @@ multipleResolvedTargets +| associated_types.rs:393:13:393:30 | ...::default(...) | +| associated_types.rs:400:13:400:30 | ...::default(...) | | main.rs:2871:13:2871:17 | x.f() | +multiplePathResolutions +| associated_types.rs:391:34:391:45 | ...::Output | +| associated_types.rs:399:34:399:45 | ...::Output | diff --git a/rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected b/rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected new file mode 100644 index 000000000000..f2551bcad6ca --- /dev/null +++ b/rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected @@ -0,0 +1,3 @@ +nonUniqueCertainType +| associated_types.rs:391:47:394:9 | { ... } | | +| associated_types.rs:399:47:401:9 | { ... } | | diff --git a/rust/ql/test/library-tests/type-inference/associated_types.rs b/rust/ql/test/library-tests/type-inference/associated_types.rs index b08be0264a04..b517b63403f8 100644 --- a/rust/ql/test/library-tests/type-inference/associated_types.rs +++ b/rust/ql/test/library-tests/type-inference/associated_types.rs @@ -46,6 +46,15 @@ impl GetSet for S { } } +impl AnotherGet for S { + type AnotherOutput = bool; + + // S::get_another + fn get_another(&self) -> Self::AnotherOutput { + true + } +} + impl GetSet for Wrapper { type Output = T; @@ -55,6 +64,24 @@ impl GetSet for Wrapper { } } +struct Odd(OddT); + +impl GetSet for Odd { + type Output = bool; + + fn get(&self) -> Self::Output { + true + } +} + +impl GetSet for Odd { + type Output = char; + + fn get(&self) -> Self::Output { + 'a' + } +} + mod default_method_using_associated_type { use super::*; @@ -110,7 +137,62 @@ mod default_method_using_associated_type { } } -// Tests for signatures that access associated types from type parameters +mod concrete_type_access_associated_type { + use super::*; + + fn using_as( + a: ::Output, + b: as GetSet>::Output, + c: as GetSet>::Output, + d: as GetSet>::Output, + ) { + let _a = a; // $ MISSING: type=_a:S3 + let _b = b; // $ MISSING: type=_b:i32 + let _c = c; // $ MISSING: type=_c:bool + let _d = d; // $ MISSING: type=_d:char + } + + // NOTE: The below seems like it should work, but is currently rejected by + // the Rust compiler. This behavior does not seem to be documented and + // there's an open issue about it: + // https://github.com/rust-lang/rust/issues/104119 + // fn without_as( + // a: S::Output, + // b: Wrapper::Output, + // c: Odd::Output, + // d: Odd::Output, + // ) { + // let _a = a; // $ type=_a:S3 + // let _b = b; // $ type=_b:i32 + // let _c = c; // $ type=_c:bool + // let _d = d; // $ type=_d:char + // } + + impl Odd { + // Odd::proj + fn proj(&self) -> ::Output { + let x = Default::default(); // $ MISSING: target=default + x // $ MISSING: type=x:bool + } + } + + impl Odd { + // Odd::proj + fn proj(&self) -> ::Output { + let x = Default::default(); // $ MISSING: target=default + x // $ MISSING: type=x:char + } + } + + pub fn test() { + using_as(S3, 1, true, 'a'); // $ target=using_as + + let _a = Odd(42i32).proj(); // $ target=Odd::proj MISSING: type=_a:bool + let _b = Odd(true).proj(); // $ target=Odd::proj MISSING: type=_b:char + } +} + +// Tests for signatures that access associated types on type parameters mod type_param_access_associated_type { use super::*; @@ -122,9 +204,20 @@ mod type_param_access_associated_type { thing.get() // $ target=GetSet::get } + fn tp_assoc_from_supertrait(thing: T) -> (T::Output, T::AnotherOutput) { + ( + thing.get(), // $ target=GetSet::get + thing.get_another(), // $ target=AnotherGet::get_another + ) + } + pub fn test() { let _o1 = tp_with_as(S); // $ target=tp_with_as MISSING: type=_o1:S3 let _o2 = tp_without_as(S); // $ target=tp_without_as MISSING: type=_o2:S3 + let ( + _o3, // $ MISSING: type=_o3:S3 + _o4, // $ MISSING: type=_o4:bool + ) = tp_assoc_from_supertrait(S); // $ target=tp_assoc_from_supertrait } } @@ -293,6 +386,21 @@ mod associated_type_in_supertrait { } } + impl Subtrait for Odd { + // Odd::get_content + fn get_content(&self) -> Self::Output { + // let _x = Self::get(self); + Default::default() // $ target=default + } + } + + impl Subtrait for Odd { + // Odd::get_content + fn get_content(&self) -> Self::Output { + Default::default() // $ target=default + } + } + fn get_content(item: &T) -> T::Output { item.get_content() // $ target=Subtrait::get_content } @@ -308,6 +416,9 @@ mod associated_type_in_supertrait { let item2 = MyType(true); let _content2 = get_content(&item2); // $ target=get_content MISSING: type=_content2:bool + + let _content3 = Odd(42i32).get_content(); // $ target=Odd::get_content type=_content3:bool SPURIOUS: type=_content3:char + let _content4 = Odd(true).get_content(); // $ target=Odd::get_content type=_content4:char SPURIOUS: type=_content4:bool } } @@ -356,6 +467,7 @@ mod dyn_trait { pub fn test() { default_method_using_associated_type::test(); // $ target=test + concrete_type_access_associated_type::test(); // $ target=test type_param_access_associated_type::test(); // $ target=test generic_associated_type::test(); // $ target=test multiple_associated_types::test(); // $ target=test diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 36663b1dc4bf..14d6ae3115e3 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -20,212 +20,259 @@ inferCertainType | associated_types.rs:44:12:44:16 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:44:12:44:16 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | | associated_types.rs:44:35:46:5 | { ... } | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:53:12:53:16 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:53:12:53:16 | SelfParam | TRef | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:53:12:53:16 | SelfParam | TRef.A | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:53:35:55:5 | { ... } | | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:54:9:54:12 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:54:9:54:12 | self | TRef | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:54:9:54:12 | self | TRef.A | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:65:15:65:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] | -| associated_types.rs:67:15:67:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] | -| associated_types.rs:71:9:75:9 | { ... } | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] | -| associated_types.rs:72:13:72:16 | self | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] | -| associated_types.rs:82:15:82:18 | SelfParam | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:82:45:84:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:91:15:91:18 | SelfParam | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:91:45:93:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:91:45:93:9 | { ... } | A | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:92:21:92:24 | self | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:96:19:110:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:99:18:99:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:99:18:99:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:99:18:99:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:99:18:99:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:104:18:104:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:104:18:104:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:104:18:104:26 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:104:18:104:26 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:107:18:107:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:107:18:107:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:107:18:107:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:107:18:107:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:109:18:109:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:109:18:109:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:109:18:109:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:109:18:109:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:117:30:117:34 | thing | | associated_types.rs:117:19:117:27 | T | -| associated_types.rs:118:9:118:13 | thing | | associated_types.rs:117:19:117:27 | T | -| associated_types.rs:121:33:121:37 | thing | | associated_types.rs:121:22:121:30 | T | -| associated_types.rs:122:9:122:13 | thing | | associated_types.rs:121:22:121:30 | T | -| associated_types.rs:125:19:128:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:135:26:135:26 | x | | associated_types.rs:135:23:135:23 | T | -| associated_types.rs:138:5:140:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:139:18:139:18 | x | | associated_types.rs:135:23:135:23 | T | -| associated_types.rs:143:24:143:24 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:146:5:150:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:147:19:147:19 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:148:23:148:24 | &x | | {EXTERNAL LOCATION} | & | -| associated_types.rs:148:24:148:24 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:149:18:149:18 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:153:23:153:23 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:157:5:161:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:158:19:158:19 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:159:23:159:24 | &x | | {EXTERNAL LOCATION} | & | -| associated_types.rs:159:24:159:24 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:160:18:160:18 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:167:17:167:21 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:167:17:167:21 | SelfParam | TRef | associated_types.rs:163:5:168:5 | Self [trait AssocNameClash] | -| associated_types.rs:170:34:170:34 | x | | associated_types.rs:170:31:170:31 | T | -| associated_types.rs:174:5:177:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:175:18:175:18 | x | | associated_types.rs:170:31:170:31 | T | -| associated_types.rs:176:18:176:18 | x | | associated_types.rs:170:31:170:31 | T | -| associated_types.rs:187:19:187:23 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:187:19:187:23 | SelfParam | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:187:26:187:26 | a | | associated_types.rs:187:16:187:16 | A | -| associated_types.rs:190:23:190:27 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:190:23:190:27 | SelfParam | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:190:30:190:30 | a | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:190:36:190:36 | b | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:190:76:193:9 | { ... } | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] | -| associated_types.rs:191:13:191:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:191:13:191:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:191:22:191:22 | a | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:192:13:192:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:192:13:192:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:192:22:192:22 | b | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:201:19:201:23 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:201:19:201:23 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:201:26:201:26 | a | | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:201:46:203:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:201:46:203:9 | { ... } | A | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:202:21:202:21 | a | | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:206:19:213:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:209:25:209:28 | 1i32 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:212:29:212:32 | true | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:212:35:212:39 | false | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:224:21:224:25 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:224:21:224:25 | SelfParam | TRef | associated_types.rs:219:5:229:5 | Self [trait TraitMultipleAssoc] | -| associated_types.rs:226:20:226:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:226:20:226:24 | SelfParam | TRef | associated_types.rs:219:5:229:5 | Self [trait TraitMultipleAssoc] | -| associated_types.rs:228:20:228:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:228:20:228:24 | SelfParam | TRef | associated_types.rs:219:5:229:5 | Self [trait TraitMultipleAssoc] | -| associated_types.rs:235:21:235:25 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:235:21:235:25 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:235:34:237:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:239:20:239:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:239:20:239:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:239:43:241:9 | { ... } | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:243:20:243:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:243:20:243:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:243:43:245:9 | { ... } | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:248:19:252:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:260:24:260:28 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:260:24:260:28 | SelfParam | TRef | associated_types.rs:258:5:261:5 | Self [trait Subtrait] | -| associated_types.rs:269:23:269:27 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:269:23:269:27 | SelfParam | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] | -| associated_types.rs:269:30:269:31 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:269:48:269:49 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:269:66:272:9 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:270:13:270:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:270:13:270:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] | -| associated_types.rs:270:22:270:23 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:271:13:271:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:271:13:271:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] | -| associated_types.rs:271:22:271:23 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:280:16:280:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:280:16:280:20 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:280:16:280:20 | SelfParam | TRef.T | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:280:39:282:9 | { ... } | | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:281:13:281:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:281:13:281:16 | self | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:281:13:281:16 | self | TRef.T | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:284:16:284:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:284:16:284:20 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:284:16:284:20 | SelfParam | TRef.T | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:284:23:284:30 | _content | | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:284:47:286:9 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:285:22:285:42 | "Inserting content: \\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:285:22:285:42 | "Inserting content: \\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:285:22:285:42 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:285:22:285:42 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:291:24:291:28 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:291:24:291:28 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:291:24:291:28 | SelfParam | TRef.T | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:292:15:292:18 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:292:15:292:18 | self | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:292:15:292:18 | self | TRef.T | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:296:33:296:36 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:296:33:296:36 | item | TRef | associated_types.rs:296:20:296:30 | T | -| associated_types.rs:297:9:297:12 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:297:9:297:12 | item | TRef | associated_types.rs:296:20:296:30 | T | -| associated_types.rs:300:35:300:38 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:300:35:300:38 | item | TRef | associated_types.rs:300:21:300:32 | T | -| associated_types.rs:300:90:303:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:301:9:301:12 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:301:9:301:12 | item | TRef | associated_types.rs:300:21:300:32 | T | -| associated_types.rs:302:9:302:12 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:302:9:302:12 | item | TRef | associated_types.rs:300:21:300:32 | T | -| associated_types.rs:305:19:311:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:306:28:306:32 | 42i64 | | {EXTERNAL LOCATION} | i64 | -| associated_types.rs:309:28:309:31 | true | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:310:37:310:42 | &item2 | | {EXTERNAL LOCATION} | & | -| associated_types.rs:324:16:324:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:324:16:324:20 | SelfParam | TRef | associated_types.rs:317:5:317:20 | ST | -| associated_types.rs:324:16:324:20 | SelfParam | TRef.T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:324:39:326:9 | { ... } | | {EXTERNAL LOCATION} | Result | -| associated_types.rs:324:39:326:9 | { ... } | E | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:324:39:326:9 | { ... } | T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:325:16:325:19 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:325:16:325:19 | self | TRef | associated_types.rs:317:5:317:20 | ST | -| associated_types.rs:325:16:325:19 | self | TRef.T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:329:19:331:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:330:21:330:24 | true | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:338:31:338:31 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:338:31:338:31 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:338:31:338:31 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:338:61:346:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:340:21:340:21 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:340:21:340:21 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:340:21:340:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:343:19:343:19 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:343:19:343:19 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:343:19:343:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:345:23:345:23 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:345:23:345:23 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:345:23:345:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:348:36:348:36 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:348:36:348:36 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:348:36:348:36 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:348:36:348:36 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:348:92:354:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:349:21:349:21 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:349:21:349:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:349:21:349:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:349:21:349:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:350:19:350:19 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:350:19:350:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:350:19:350:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:350:19:350:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:351:23:351:23 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:351:23:351:23 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:351:23:351:23 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:351:23:351:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:352:21:352:21 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:352:21:352:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:352:21:352:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:352:21:352:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:353:19:353:19 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:353:19:353:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:353:19:353:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:353:19:353:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:357:15:364:1 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:358:5:358:48 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:359:5:359:45 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:360:5:360:35 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:361:5:361:37 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:362:5:362:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:363:5:363:46 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:53:20:53:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:53:20:53:24 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:53:50:55:5 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:54:9:54:12 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:62:12:62:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:62:12:62:16 | SelfParam | TRef | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:62:12:62:16 | SelfParam | TRef.A | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:62:35:64:5 | { ... } | | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:63:9:63:12 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:63:9:63:12 | self | TRef | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:63:9:63:12 | self | TRef.A | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:72:12:72:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:72:12:72:16 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:72:12:72:16 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:72:35:74:5 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:73:9:73:12 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:80:12:80:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:80:12:80:16 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:80:12:80:16 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:80:35:82:5 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:81:9:81:11 | 'a' | | {EXTERNAL LOCATION} | char | +| associated_types.rs:92:15:92:18 | SelfParam | | associated_types.rs:88:5:103:5 | Self [trait MyTrait] | +| associated_types.rs:94:15:94:18 | SelfParam | | associated_types.rs:88:5:103:5 | Self [trait MyTrait] | +| associated_types.rs:98:9:102:9 | { ... } | | associated_types.rs:89:9:89:28 | AssociatedType[MyTrait] | +| associated_types.rs:99:13:99:16 | self | | associated_types.rs:88:5:103:5 | Self [trait MyTrait] | +| associated_types.rs:109:15:109:18 | SelfParam | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:109:45:111:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:118:15:118:18 | SelfParam | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:118:45:120:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:118:45:120:9 | { ... } | A | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:119:21:119:24 | self | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:123:19:137:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:126:18:126:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:126:18:126:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:126:18:126:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:126:18:126:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:131:18:131:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:131:18:131:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:131:18:131:26 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:131:18:131:26 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:134:18:134:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:134:18:134:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:134:18:134:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:134:18:134:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:136:18:136:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:136:18:136:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:136:18:136:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:136:18:136:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:148:7:153:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:173:17:173:21 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:173:17:173:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:173:17:173:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:181:17:181:21 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:181:17:181:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:181:17:181:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:187:19:192:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:188:9:188:34 | using_as(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:188:25:188:28 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:188:31:188:33 | 'a' | | {EXTERNAL LOCATION} | char | +| associated_types.rs:190:22:190:26 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:191:22:191:25 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:199:30:199:34 | thing | | associated_types.rs:199:19:199:27 | T | +| associated_types.rs:200:9:200:13 | thing | | associated_types.rs:199:19:199:27 | T | +| associated_types.rs:203:33:203:37 | thing | | associated_types.rs:203:22:203:30 | T | +| associated_types.rs:204:9:204:13 | thing | | associated_types.rs:203:22:203:30 | T | +| associated_types.rs:207:48:207:52 | thing | | associated_types.rs:207:33:207:45 | T | +| associated_types.rs:207:91:212:5 | { ... } | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:208:9:211:9 | TupleExpr | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:209:13:209:17 | thing | | associated_types.rs:207:33:207:45 | T | +| associated_types.rs:210:13:210:17 | thing | | associated_types.rs:207:33:207:45 | T | +| associated_types.rs:214:19:221:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:217:13:220:9 | TuplePat | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:220:13:220:39 | tp_assoc_from_supertrait(...) | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:228:26:228:26 | x | | associated_types.rs:228:23:228:23 | T | +| associated_types.rs:231:5:233:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:232:18:232:18 | x | | associated_types.rs:228:23:228:23 | T | +| associated_types.rs:236:24:236:24 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:239:5:243:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:240:19:240:19 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:241:23:241:24 | &x | | {EXTERNAL LOCATION} | & | +| associated_types.rs:241:24:241:24 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:242:18:242:18 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:246:23:246:23 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:250:5:254:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:251:19:251:19 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:252:23:252:24 | &x | | {EXTERNAL LOCATION} | & | +| associated_types.rs:252:24:252:24 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:253:18:253:18 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:260:17:260:21 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:260:17:260:21 | SelfParam | TRef | associated_types.rs:256:5:261:5 | Self [trait AssocNameClash] | +| associated_types.rs:263:34:263:34 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:267:5:270:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:268:18:268:18 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:269:18:269:18 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:280:19:280:23 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:280:19:280:23 | SelfParam | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:280:26:280:26 | a | | associated_types.rs:280:16:280:16 | A | +| associated_types.rs:283:23:283:27 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:283:23:283:27 | SelfParam | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:283:30:283:30 | a | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:283:36:283:36 | b | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:283:76:286:9 | { ... } | | associated_types.rs:277:9:277:52 | GenericAssociatedType[MyTraitAssoc2] | +| associated_types.rs:284:13:284:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:284:13:284:16 | self | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:284:22:284:22 | a | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:285:13:285:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:285:13:285:16 | self | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:285:22:285:22 | b | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:294:19:294:23 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:294:19:294:23 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:294:26:294:26 | a | | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:294:46:296:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:294:46:296:9 | { ... } | A | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:295:21:295:21 | a | | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:299:19:306:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:302:25:302:28 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:305:29:305:32 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:305:35:305:39 | false | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:317:21:317:25 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:317:21:317:25 | SelfParam | TRef | associated_types.rs:312:5:322:5 | Self [trait TraitMultipleAssoc] | +| associated_types.rs:319:20:319:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:319:20:319:24 | SelfParam | TRef | associated_types.rs:312:5:322:5 | Self [trait TraitMultipleAssoc] | +| associated_types.rs:321:20:321:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:321:20:321:24 | SelfParam | TRef | associated_types.rs:312:5:322:5 | Self [trait TraitMultipleAssoc] | +| associated_types.rs:328:21:328:25 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:328:21:328:25 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:328:34:330:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:332:20:332:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:332:20:332:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:332:43:334:9 | { ... } | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:336:20:336:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:336:20:336:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:336:43:338:9 | { ... } | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:341:19:345:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:353:24:353:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:353:24:353:28 | SelfParam | TRef | associated_types.rs:351:5:354:5 | Self [trait Subtrait] | +| associated_types.rs:362:23:362:27 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:362:23:362:27 | SelfParam | TRef | associated_types.rs:356:5:366:5 | Self [trait Subtrait2] | +| associated_types.rs:362:30:362:31 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:362:48:362:49 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:362:66:365:9 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:363:13:363:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:363:13:363:16 | self | TRef | associated_types.rs:356:5:366:5 | Self [trait Subtrait2] | +| associated_types.rs:363:22:363:23 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:364:13:364:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:364:13:364:16 | self | TRef | associated_types.rs:356:5:366:5 | Self [trait Subtrait2] | +| associated_types.rs:364:22:364:23 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:373:16:373:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:373:16:373:20 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:373:16:373:20 | SelfParam | TRef.T | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:373:39:375:9 | { ... } | | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:374:13:374:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:374:13:374:16 | self | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:374:13:374:16 | self | TRef.T | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:377:16:377:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:377:16:377:20 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:377:16:377:20 | SelfParam | TRef.T | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:377:23:377:30 | _content | | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:377:47:379:9 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:378:22:378:42 | "Inserting content: \\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:378:22:378:42 | "Inserting content: \\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:378:22:378:42 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:378:22:378:42 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:384:24:384:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:384:24:384:28 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:384:24:384:28 | SelfParam | TRef.T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:385:15:385:18 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:385:15:385:18 | self | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:385:15:385:18 | self | TRef.T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:391:24:391:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:391:24:391:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:391:24:391:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:399:24:399:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:399:24:399:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:399:24:399:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:404:33:404:36 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:404:33:404:36 | item | TRef | associated_types.rs:404:20:404:30 | T | +| associated_types.rs:405:9:405:12 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:405:9:405:12 | item | TRef | associated_types.rs:404:20:404:30 | T | +| associated_types.rs:408:35:408:38 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:408:35:408:38 | item | TRef | associated_types.rs:408:21:408:32 | T | +| associated_types.rs:408:90:411:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:409:9:409:12 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:409:9:409:12 | item | TRef | associated_types.rs:408:21:408:32 | T | +| associated_types.rs:410:9:410:12 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:410:9:410:12 | item | TRef | associated_types.rs:408:21:408:32 | T | +| associated_types.rs:413:19:422:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:414:28:414:32 | 42i64 | | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:417:28:417:31 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:418:37:418:42 | &item2 | | {EXTERNAL LOCATION} | & | +| associated_types.rs:420:29:420:33 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:421:29:421:32 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:435:16:435:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:435:16:435:20 | SelfParam | TRef | associated_types.rs:428:5:428:20 | ST | +| associated_types.rs:435:16:435:20 | SelfParam | TRef.T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:435:39:437:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| associated_types.rs:435:39:437:9 | { ... } | E | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:435:39:437:9 | { ... } | T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:436:16:436:19 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:436:16:436:19 | self | TRef | associated_types.rs:428:5:428:20 | ST | +| associated_types.rs:436:16:436:19 | self | TRef.T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:440:19:442:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:441:21:441:24 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:449:31:449:31 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:449:31:449:31 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:449:31:449:31 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:449:61:457:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:451:21:451:21 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:451:21:451:21 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:451:21:451:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:454:19:454:19 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:454:19:454:19 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:454:19:454:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:456:23:456:23 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:456:23:456:23 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:456:23:456:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:459:36:459:36 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:459:36:459:36 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:459:36:459:36 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:459:36:459:36 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:459:92:465:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:460:21:460:21 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:460:21:460:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:460:21:460:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:460:21:460:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:461:19:461:19 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:461:19:461:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:461:19:461:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:461:19:461:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:462:23:462:23 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:462:23:462:23 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:462:23:462:23 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:462:23:462:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:463:21:463:21 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:463:21:463:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:463:21:463:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:463:21:463:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:464:19:464:19 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:464:19:464:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:464:19:464:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:464:19:464:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:468:15:476:1 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:469:5:469:48 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:470:5:470:48 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:471:5:471:45 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:472:5:472:35 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:473:5:473:37 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:474:5:474:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:475:5:475:46 | ...::test(...) | | {EXTERNAL LOCATION} | () | | blanket_impl.rs:15:18:15:22 | SelfParam | | {EXTERNAL LOCATION} | & | | blanket_impl.rs:15:18:15:22 | SelfParam | TRef | blanket_impl.rs:9:5:10:14 | S2 | | blanket_impl.rs:15:42:17:9 | { ... } | | {EXTERNAL LOCATION} | & | @@ -4703,363 +4750,433 @@ inferType | associated_types.rs:44:12:44:16 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | | associated_types.rs:44:35:46:5 | { ... } | | associated_types.rs:16:1:17:10 | S3 | | associated_types.rs:45:9:45:10 | S3 | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:53:12:53:16 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:53:12:53:16 | SelfParam | TRef | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:53:12:53:16 | SelfParam | TRef.A | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:53:35:55:5 | { ... } | | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:54:9:54:12 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:54:9:54:12 | self | TRef | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:54:9:54:12 | self | TRef.A | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:54:9:54:14 | self.0 | | associated_types.rs:49:6:49:12 | T | -| associated_types.rs:65:15:65:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] | -| associated_types.rs:67:15:67:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] | -| associated_types.rs:71:9:75:9 | { ... } | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] | -| associated_types.rs:72:13:72:16 | self | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] | -| associated_types.rs:72:13:72:21 | self.m1() | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] | -| associated_types.rs:74:13:74:43 | ...::default(...) | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] | -| associated_types.rs:82:15:82:18 | SelfParam | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:82:45:84:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:83:13:83:14 | S3 | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:91:15:91:18 | SelfParam | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:91:45:93:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:91:45:93:9 | { ... } | A | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:92:13:92:25 | Wrapper(...) | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:92:13:92:25 | Wrapper(...) | A | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:92:21:92:24 | self | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:96:19:110:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:97:13:97:14 | x1 | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:97:18:97:18 | S | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:99:9:99:33 | MacroExpr | | {EXTERNAL LOCATION} | () | -| associated_types.rs:99:18:99:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:99:18:99:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:99:18:99:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:99:18:99:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:99:18:99:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:99:26:99:27 | x1 | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:99:26:99:32 | x1.m1() | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:101:13:101:14 | x2 | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:101:18:101:18 | S | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:103:13:103:13 | y | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:103:17:103:18 | x2 | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:103:17:103:23 | x2.m2() | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:104:9:104:27 | MacroExpr | | {EXTERNAL LOCATION} | () | -| associated_types.rs:104:18:104:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:104:18:104:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:104:18:104:26 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:104:18:104:26 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:104:18:104:26 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:104:26:104:26 | y | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:106:13:106:14 | x5 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:106:18:106:19 | S2 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:107:9:107:33 | MacroExpr | | {EXTERNAL LOCATION} | () | -| associated_types.rs:107:18:107:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:107:18:107:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:107:18:107:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:107:18:107:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:107:18:107:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:107:26:107:27 | x5 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:107:26:107:32 | x5.m1() | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:107:26:107:32 | x5.m1() | A | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:108:13:108:14 | x6 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:108:18:108:19 | S2 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:109:9:109:33 | MacroExpr | | {EXTERNAL LOCATION} | () | -| associated_types.rs:109:18:109:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:109:18:109:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:109:18:109:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:109:18:109:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:109:18:109:32 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:109:26:109:27 | x6 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:109:26:109:32 | x6.m2() | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:109:26:109:32 | x6.m2() | A | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:117:30:117:34 | thing | | associated_types.rs:117:19:117:27 | T | -| associated_types.rs:118:9:118:13 | thing | | associated_types.rs:117:19:117:27 | T | -| associated_types.rs:121:33:121:37 | thing | | associated_types.rs:121:22:121:30 | T | -| associated_types.rs:122:9:122:13 | thing | | associated_types.rs:121:22:121:30 | T | -| associated_types.rs:125:19:128:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:126:30:126:30 | S | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:127:33:127:33 | S | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:135:26:135:26 | x | | associated_types.rs:135:23:135:23 | T | -| associated_types.rs:138:5:140:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:139:13:139:14 | _a | | {EXTERNAL LOCATION} | char | -| associated_types.rs:139:18:139:18 | x | | associated_types.rs:135:23:135:23 | T | -| associated_types.rs:139:18:139:24 | x.get() | | {EXTERNAL LOCATION} | char | -| associated_types.rs:143:24:143:24 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:146:5:150:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:147:13:147:15 | _a1 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:147:19:147:19 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:147:19:147:25 | x.get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:148:13:148:15 | _a2 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:148:19:148:25 | get(...) | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:148:23:148:24 | &x | | {EXTERNAL LOCATION} | & | -| associated_types.rs:148:23:148:24 | &x | TRef | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:148:24:148:24 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:149:13:149:14 | _b | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:149:18:149:18 | x | | associated_types.rs:143:21:143:21 | T | -| associated_types.rs:149:18:149:32 | x.get_another() | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:153:23:153:23 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:157:5:161:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:158:13:158:15 | _a1 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:158:19:158:19 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:158:19:158:25 | x.get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:159:13:159:15 | _a2 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:159:19:159:25 | get(...) | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:159:23:159:24 | &x | | {EXTERNAL LOCATION} | & | -| associated_types.rs:159:23:159:24 | &x | TRef | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:159:24:159:24 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:160:13:160:14 | _b | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:160:18:160:18 | x | | associated_types.rs:153:20:153:20 | T | -| associated_types.rs:160:18:160:32 | x.get_another() | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:167:17:167:21 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:167:17:167:21 | SelfParam | TRef | associated_types.rs:163:5:168:5 | Self [trait AssocNameClash] | -| associated_types.rs:170:34:170:34 | x | | associated_types.rs:170:31:170:31 | T | -| associated_types.rs:174:5:177:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:175:13:175:14 | _a | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:175:18:175:18 | x | | associated_types.rs:170:31:170:31 | T | -| associated_types.rs:175:18:175:24 | x.get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:176:18:176:18 | x | | associated_types.rs:170:31:170:31 | T | -| associated_types.rs:187:19:187:23 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:187:19:187:23 | SelfParam | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:187:26:187:26 | a | | associated_types.rs:187:16:187:16 | A | -| associated_types.rs:190:23:190:27 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:190:23:190:27 | SelfParam | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:190:30:190:30 | a | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:190:36:190:36 | b | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:190:76:193:9 | { ... } | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] | -| associated_types.rs:191:13:191:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:191:13:191:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:191:13:191:23 | self.put(...) | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] | -| associated_types.rs:191:22:191:22 | a | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:192:13:192:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:192:13:192:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] | -| associated_types.rs:192:13:192:23 | self.put(...) | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] | -| associated_types.rs:192:22:192:22 | b | | associated_types.rs:190:20:190:20 | A | -| associated_types.rs:201:19:201:23 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:201:19:201:23 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:201:26:201:26 | a | | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:201:46:203:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:201:46:203:9 | { ... } | A | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:202:13:202:22 | Wrapper(...) | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:202:13:202:22 | Wrapper(...) | A | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:202:21:202:21 | a | | associated_types.rs:201:16:201:16 | A | -| associated_types.rs:206:19:213:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:207:13:207:13 | s | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:207:17:207:17 | S | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:209:13:209:15 | _g1 | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:209:13:209:15 | _g1 | A | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:209:19:209:19 | s | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:209:19:209:29 | s.put(...) | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:209:19:209:29 | s.put(...) | A | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:209:25:209:28 | 1i32 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:212:13:212:15 | _g2 | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:212:19:212:19 | s | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:212:19:212:40 | s.put_two(...) | | associated_types.rs:1:1:2:21 | Wrapper | -| associated_types.rs:212:29:212:32 | true | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:212:35:212:39 | false | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:224:21:224:25 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:224:21:224:25 | SelfParam | TRef | associated_types.rs:219:5:229:5 | Self [trait TraitMultipleAssoc] | -| associated_types.rs:226:20:226:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:226:20:226:24 | SelfParam | TRef | associated_types.rs:219:5:229:5 | Self [trait TraitMultipleAssoc] | -| associated_types.rs:228:20:228:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:228:20:228:24 | SelfParam | TRef | associated_types.rs:219:5:229:5 | Self [trait TraitMultipleAssoc] | -| associated_types.rs:235:21:235:25 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:235:21:235:25 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:235:34:237:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:236:13:236:14 | S3 | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:239:20:239:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:239:20:239:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:239:43:241:9 | { ... } | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:240:13:240:13 | S | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:243:20:243:24 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:243:20:243:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:243:43:245:9 | { ... } | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:244:13:244:14 | S2 | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:248:19:252:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:249:13:249:23 | _assoc_zero | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:249:27:249:28 | S3 | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:249:27:249:39 | S3.get_zero() | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:250:13:250:22 | _assoc_one | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:250:26:250:27 | S3 | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:250:26:250:37 | S3.get_one() | | associated_types.rs:10:1:11:9 | S | -| associated_types.rs:251:13:251:22 | _assoc_two | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:251:26:251:27 | S3 | | associated_types.rs:16:1:17:10 | S3 | -| associated_types.rs:251:26:251:37 | S3.get_two() | | associated_types.rs:13:1:14:10 | S2 | -| associated_types.rs:260:24:260:28 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:260:24:260:28 | SelfParam | TRef | associated_types.rs:258:5:261:5 | Self [trait Subtrait] | -| associated_types.rs:269:23:269:27 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:269:23:269:27 | SelfParam | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] | -| associated_types.rs:269:30:269:31 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:269:48:269:49 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:269:66:272:9 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:270:13:270:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:270:13:270:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] | -| associated_types.rs:270:13:270:24 | self.set(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:270:22:270:23 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:271:13:271:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:271:13:271:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] | -| associated_types.rs:271:13:271:24 | self.set(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:271:22:271:23 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | -| associated_types.rs:280:16:280:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:280:16:280:20 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:280:16:280:20 | SelfParam | TRef.T | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:280:39:282:9 | { ... } | | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:281:13:281:16 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:281:13:281:16 | self | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:281:13:281:16 | self | TRef.T | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:281:13:281:18 | self.0 | | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:284:16:284:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:284:16:284:20 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:284:16:284:20 | SelfParam | TRef.T | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:284:23:284:30 | _content | | associated_types.rs:277:10:277:16 | T | -| associated_types.rs:284:47:286:9 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:285:13:285:43 | MacroExpr | | {EXTERNAL LOCATION} | () | -| associated_types.rs:285:22:285:42 | "Inserting content: \\n" | | {EXTERNAL LOCATION} | & | -| associated_types.rs:285:22:285:42 | "Inserting content: \\n" | TRef | {EXTERNAL LOCATION} | str | -| associated_types.rs:285:22:285:42 | ...::_print(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:285:22:285:42 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:285:22:285:42 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:291:24:291:28 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:291:24:291:28 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:291:24:291:28 | SelfParam | TRef.T | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:291:47:293:9 | { ... } | | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:292:13:292:19 | (...) | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:292:13:292:19 | (...) | T | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:292:13:292:21 | ... .0 | | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:292:14:292:18 | * ... | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:292:14:292:18 | * ... | T | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:292:15:292:18 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:292:15:292:18 | self | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:292:15:292:18 | self | TRef.T | associated_types.rs:289:10:289:16 | T | -| associated_types.rs:296:33:296:36 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:296:33:296:36 | item | TRef | associated_types.rs:296:20:296:30 | T | -| associated_types.rs:297:9:297:12 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:297:9:297:12 | item | TRef | associated_types.rs:296:20:296:30 | T | -| associated_types.rs:300:35:300:38 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:300:35:300:38 | item | TRef | associated_types.rs:300:21:300:32 | T | -| associated_types.rs:300:90:303:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:301:9:301:12 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:301:9:301:12 | item | TRef | associated_types.rs:300:21:300:32 | T | -| associated_types.rs:301:9:301:20 | item.set(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:302:9:302:12 | item | | {EXTERNAL LOCATION} | & | -| associated_types.rs:302:9:302:12 | item | TRef | associated_types.rs:300:21:300:32 | T | -| associated_types.rs:302:9:302:31 | item.insert_two(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:305:19:311:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:306:13:306:17 | item1 | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:306:13:306:17 | item1 | T | {EXTERNAL LOCATION} | i64 | -| associated_types.rs:306:21:306:33 | MyType(...) | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:306:21:306:33 | MyType(...) | T | {EXTERNAL LOCATION} | i64 | -| associated_types.rs:306:28:306:32 | 42i64 | | {EXTERNAL LOCATION} | i64 | -| associated_types.rs:307:25:307:29 | item1 | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:307:25:307:29 | item1 | T | {EXTERNAL LOCATION} | i64 | -| associated_types.rs:309:13:309:17 | item2 | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:309:13:309:17 | item2 | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:309:21:309:32 | MyType(...) | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:309:21:309:32 | MyType(...) | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:309:28:309:31 | true | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:310:37:310:42 | &item2 | | {EXTERNAL LOCATION} | & | -| associated_types.rs:310:37:310:42 | &item2 | TRef | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:310:37:310:42 | &item2 | TRef.T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:310:38:310:42 | item2 | | associated_types.rs:275:5:275:24 | MyType | -| associated_types.rs:310:38:310:42 | item2 | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:324:16:324:20 | SelfParam | | {EXTERNAL LOCATION} | & | -| associated_types.rs:324:16:324:20 | SelfParam | TRef | associated_types.rs:317:5:317:20 | ST | -| associated_types.rs:324:16:324:20 | SelfParam | TRef.T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:324:39:326:9 | { ... } | | {EXTERNAL LOCATION} | Result | -| associated_types.rs:324:39:326:9 | { ... } | E | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:324:39:326:9 | { ... } | T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:325:13:325:22 | Ok(...) | | {EXTERNAL LOCATION} | Result | -| associated_types.rs:325:13:325:22 | Ok(...) | E | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:325:13:325:22 | Ok(...) | T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:325:16:325:19 | self | | {EXTERNAL LOCATION} | & | -| associated_types.rs:325:16:325:19 | self | TRef | associated_types.rs:317:5:317:20 | ST | -| associated_types.rs:325:16:325:19 | self | TRef.T | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:325:16:325:21 | self.0 | | associated_types.rs:319:10:319:21 | Output | -| associated_types.rs:329:19:331:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:330:13:330:14 | _y | | {EXTERNAL LOCATION} | Result | -| associated_types.rs:330:13:330:14 | _y | E | {EXTERNAL LOCATION} | bool | -| associated_types.rs:330:13:330:14 | _y | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:330:18:330:25 | ST(...) | | associated_types.rs:317:5:317:20 | ST | -| associated_types.rs:330:18:330:25 | ST(...) | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:330:18:330:31 | ... .get() | | {EXTERNAL LOCATION} | Result | -| associated_types.rs:330:18:330:31 | ... .get() | E | {EXTERNAL LOCATION} | bool | -| associated_types.rs:330:18:330:31 | ... .get() | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:330:21:330:24 | true | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:338:31:338:31 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:338:31:338:31 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:338:31:338:31 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:338:61:346:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:340:13:340:15 | _a1 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:340:19:340:22 | (...) | | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:340:19:340:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:340:19:340:28 | ... .get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:340:20:340:21 | * ... | | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:340:20:340:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:340:21:340:21 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:340:21:340:21 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:340:21:340:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:343:13:343:15 | _a2 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:343:19:343:19 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:343:19:343:19 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:343:19:343:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:343:19:343:25 | t.get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:345:13:345:15 | _a3 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:345:19:345:24 | get(...) | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:345:23:345:23 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:345:23:345:23 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | -| associated_types.rs:345:23:345:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:348:36:348:36 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:348:36:348:36 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:348:36:348:36 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:348:36:348:36 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:348:92:354:5 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:349:13:349:15 | _a1 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:349:19:349:22 | (...) | | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:349:19:349:22 | (...) | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:349:19:349:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:349:19:349:28 | ... .get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:349:20:349:21 | * ... | | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:349:20:349:21 | * ... | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:349:20:349:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:349:21:349:21 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:349:21:349:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:349:21:349:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:349:21:349:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:350:13:350:15 | _a2 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:350:19:350:19 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:350:19:350:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:350:19:350:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:350:19:350:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:350:19:350:25 | t.get() | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:351:13:351:15 | _a3 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:351:19:351:24 | get(...) | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:351:23:351:23 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:351:23:351:23 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:351:23:351:23 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:351:23:351:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:352:13:352:15 | _b1 | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:352:19:352:22 | (...) | | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:352:19:352:22 | (...) | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:352:19:352:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:352:19:352:36 | ... .get_another() | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:352:20:352:21 | * ... | | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:352:20:352:21 | * ... | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:352:20:352:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:352:21:352:21 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:352:21:352:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:352:21:352:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:352:21:352:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:353:13:353:15 | _b2 | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:353:19:353:19 | t | | {EXTERNAL LOCATION} | & | -| associated_types.rs:353:19:353:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | -| associated_types.rs:353:19:353:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | -| associated_types.rs:353:19:353:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:353:19:353:33 | t.get_another() | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:357:15:364:1 | { ... } | | {EXTERNAL LOCATION} | () | -| associated_types.rs:358:5:358:48 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:359:5:359:45 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:360:5:360:35 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:361:5:361:37 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:362:5:362:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | -| associated_types.rs:363:5:363:46 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:53:20:53:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:53:20:53:24 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:53:50:55:5 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:54:9:54:12 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:62:12:62:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:62:12:62:16 | SelfParam | TRef | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:62:12:62:16 | SelfParam | TRef.A | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:62:35:64:5 | { ... } | | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:63:9:63:12 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:63:9:63:12 | self | TRef | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:63:9:63:12 | self | TRef.A | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:63:9:63:14 | self.0 | | associated_types.rs:58:6:58:12 | T | +| associated_types.rs:72:12:72:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:72:12:72:16 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:72:12:72:16 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:72:35:74:5 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:73:9:73:12 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:80:12:80:16 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:80:12:80:16 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:80:12:80:16 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:80:35:82:5 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:81:9:81:11 | 'a' | | {EXTERNAL LOCATION} | char | +| associated_types.rs:92:15:92:18 | SelfParam | | associated_types.rs:88:5:103:5 | Self [trait MyTrait] | +| associated_types.rs:94:15:94:18 | SelfParam | | associated_types.rs:88:5:103:5 | Self [trait MyTrait] | +| associated_types.rs:98:9:102:9 | { ... } | | associated_types.rs:89:9:89:28 | AssociatedType[MyTrait] | +| associated_types.rs:99:13:99:16 | self | | associated_types.rs:88:5:103:5 | Self [trait MyTrait] | +| associated_types.rs:99:13:99:21 | self.m1() | | associated_types.rs:89:9:89:28 | AssociatedType[MyTrait] | +| associated_types.rs:101:13:101:43 | ...::default(...) | | associated_types.rs:89:9:89:28 | AssociatedType[MyTrait] | +| associated_types.rs:109:15:109:18 | SelfParam | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:109:45:111:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:110:13:110:14 | S3 | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:118:15:118:18 | SelfParam | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:118:45:120:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:118:45:120:9 | { ... } | A | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:119:13:119:25 | Wrapper(...) | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:119:13:119:25 | Wrapper(...) | A | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:119:21:119:24 | self | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:123:19:137:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:124:13:124:14 | x1 | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:124:18:124:18 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:126:9:126:33 | MacroExpr | | {EXTERNAL LOCATION} | () | +| associated_types.rs:126:18:126:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:126:18:126:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:126:18:126:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:126:18:126:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:126:18:126:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:126:26:126:27 | x1 | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:126:26:126:32 | x1.m1() | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:128:13:128:14 | x2 | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:128:18:128:18 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:130:13:130:13 | y | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:130:17:130:18 | x2 | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:130:17:130:23 | x2.m2() | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:131:9:131:27 | MacroExpr | | {EXTERNAL LOCATION} | () | +| associated_types.rs:131:18:131:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:131:18:131:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:131:18:131:26 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:131:18:131:26 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:131:18:131:26 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:131:26:131:26 | y | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:133:13:133:14 | x5 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:133:18:133:19 | S2 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:134:9:134:33 | MacroExpr | | {EXTERNAL LOCATION} | () | +| associated_types.rs:134:18:134:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:134:18:134:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:134:18:134:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:134:18:134:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:134:18:134:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:134:26:134:27 | x5 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:134:26:134:32 | x5.m1() | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:134:26:134:32 | x5.m1() | A | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:135:13:135:14 | x6 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:135:18:135:19 | S2 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:136:9:136:33 | MacroExpr | | {EXTERNAL LOCATION} | () | +| associated_types.rs:136:18:136:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:136:18:136:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:136:18:136:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:136:18:136:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:136:18:136:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:136:26:136:27 | x6 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:136:26:136:32 | x6.m2() | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:136:26:136:32 | x6.m2() | A | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:148:7:153:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:173:17:173:21 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:173:17:173:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:173:17:173:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:181:17:181:21 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:181:17:181:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:181:17:181:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:187:19:192:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:188:9:188:34 | using_as(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:188:18:188:19 | S3 | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:188:22:188:22 | 1 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:188:25:188:28 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:188:31:188:33 | 'a' | | {EXTERNAL LOCATION} | char | +| associated_types.rs:190:18:190:27 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:190:18:190:27 | Odd(...) | OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:190:22:190:26 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:191:18:191:26 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:191:18:191:26 | Odd(...) | OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:191:22:191:25 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:199:30:199:34 | thing | | associated_types.rs:199:19:199:27 | T | +| associated_types.rs:200:9:200:13 | thing | | associated_types.rs:199:19:199:27 | T | +| associated_types.rs:203:33:203:37 | thing | | associated_types.rs:203:22:203:30 | T | +| associated_types.rs:204:9:204:13 | thing | | associated_types.rs:203:22:203:30 | T | +| associated_types.rs:207:48:207:52 | thing | | associated_types.rs:207:33:207:45 | T | +| associated_types.rs:207:91:212:5 | { ... } | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:208:9:211:9 | TupleExpr | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:209:13:209:17 | thing | | associated_types.rs:207:33:207:45 | T | +| associated_types.rs:210:13:210:17 | thing | | associated_types.rs:207:33:207:45 | T | +| associated_types.rs:214:19:221:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:215:30:215:30 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:216:33:216:33 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:217:13:220:9 | TuplePat | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:220:13:220:39 | tp_assoc_from_supertrait(...) | | {EXTERNAL LOCATION} | (T_2) | +| associated_types.rs:220:38:220:38 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:228:26:228:26 | x | | associated_types.rs:228:23:228:23 | T | +| associated_types.rs:231:5:233:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:232:13:232:14 | _a | | {EXTERNAL LOCATION} | char | +| associated_types.rs:232:18:232:18 | x | | associated_types.rs:228:23:228:23 | T | +| associated_types.rs:232:18:232:24 | x.get() | | {EXTERNAL LOCATION} | char | +| associated_types.rs:236:24:236:24 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:239:5:243:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:240:13:240:15 | _a1 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:240:19:240:19 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:240:19:240:25 | x.get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:241:13:241:15 | _a2 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:241:19:241:25 | get(...) | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:241:23:241:24 | &x | | {EXTERNAL LOCATION} | & | +| associated_types.rs:241:23:241:24 | &x | TRef | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:241:24:241:24 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:242:13:242:14 | _b | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:242:18:242:18 | x | | associated_types.rs:236:21:236:21 | T | +| associated_types.rs:242:18:242:32 | x.get_another() | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:246:23:246:23 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:250:5:254:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:251:13:251:15 | _a1 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:251:19:251:19 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:251:19:251:25 | x.get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:252:13:252:15 | _a2 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:252:19:252:25 | get(...) | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:252:23:252:24 | &x | | {EXTERNAL LOCATION} | & | +| associated_types.rs:252:23:252:24 | &x | TRef | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:252:24:252:24 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:253:13:253:14 | _b | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:253:18:253:18 | x | | associated_types.rs:246:20:246:20 | T | +| associated_types.rs:253:18:253:32 | x.get_another() | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:260:17:260:21 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:260:17:260:21 | SelfParam | TRef | associated_types.rs:256:5:261:5 | Self [trait AssocNameClash] | +| associated_types.rs:263:34:263:34 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:267:5:270:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:268:13:268:14 | _a | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:268:18:268:18 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:268:18:268:24 | x.get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:269:18:269:18 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:280:19:280:23 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:280:19:280:23 | SelfParam | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:280:26:280:26 | a | | associated_types.rs:280:16:280:16 | A | +| associated_types.rs:283:23:283:27 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:283:23:283:27 | SelfParam | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:283:30:283:30 | a | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:283:36:283:36 | b | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:283:76:286:9 | { ... } | | associated_types.rs:277:9:277:52 | GenericAssociatedType[MyTraitAssoc2] | +| associated_types.rs:284:13:284:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:284:13:284:16 | self | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:284:13:284:23 | self.put(...) | | associated_types.rs:277:9:277:52 | GenericAssociatedType[MyTraitAssoc2] | +| associated_types.rs:284:22:284:22 | a | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:285:13:285:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:285:13:285:16 | self | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | +| associated_types.rs:285:13:285:23 | self.put(...) | | associated_types.rs:277:9:277:52 | GenericAssociatedType[MyTraitAssoc2] | +| associated_types.rs:285:22:285:22 | b | | associated_types.rs:283:20:283:20 | A | +| associated_types.rs:294:19:294:23 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:294:19:294:23 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:294:26:294:26 | a | | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:294:46:296:9 | { ... } | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:294:46:296:9 | { ... } | A | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:295:13:295:22 | Wrapper(...) | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:295:13:295:22 | Wrapper(...) | A | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:295:21:295:21 | a | | associated_types.rs:294:16:294:16 | A | +| associated_types.rs:299:19:306:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:300:13:300:13 | s | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:300:17:300:17 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:302:13:302:15 | _g1 | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:302:13:302:15 | _g1 | A | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:302:19:302:19 | s | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:302:19:302:29 | s.put(...) | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:302:19:302:29 | s.put(...) | A | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:302:25:302:28 | 1i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:305:13:305:15 | _g2 | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:305:19:305:19 | s | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:305:19:305:40 | s.put_two(...) | | associated_types.rs:1:1:2:21 | Wrapper | +| associated_types.rs:305:29:305:32 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:305:35:305:39 | false | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:317:21:317:25 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:317:21:317:25 | SelfParam | TRef | associated_types.rs:312:5:322:5 | Self [trait TraitMultipleAssoc] | +| associated_types.rs:319:20:319:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:319:20:319:24 | SelfParam | TRef | associated_types.rs:312:5:322:5 | Self [trait TraitMultipleAssoc] | +| associated_types.rs:321:20:321:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:321:20:321:24 | SelfParam | TRef | associated_types.rs:312:5:322:5 | Self [trait TraitMultipleAssoc] | +| associated_types.rs:328:21:328:25 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:328:21:328:25 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:328:34:330:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:329:13:329:14 | S3 | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:332:20:332:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:332:20:332:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:332:43:334:9 | { ... } | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:333:13:333:13 | S | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:336:20:336:24 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:336:20:336:24 | SelfParam | TRef | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:336:43:338:9 | { ... } | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:337:13:337:14 | S2 | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:341:19:345:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:342:13:342:23 | _assoc_zero | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:342:27:342:28 | S3 | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:342:27:342:39 | S3.get_zero() | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:343:13:343:22 | _assoc_one | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:343:26:343:27 | S3 | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:343:26:343:37 | S3.get_one() | | associated_types.rs:10:1:11:9 | S | +| associated_types.rs:344:13:344:22 | _assoc_two | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:344:26:344:27 | S3 | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:344:26:344:37 | S3.get_two() | | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:353:24:353:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:353:24:353:28 | SelfParam | TRef | associated_types.rs:351:5:354:5 | Self [trait Subtrait] | +| associated_types.rs:362:23:362:27 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:362:23:362:27 | SelfParam | TRef | associated_types.rs:356:5:366:5 | Self [trait Subtrait2] | +| associated_types.rs:362:30:362:31 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:362:48:362:49 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:362:66:365:9 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:363:13:363:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:363:13:363:16 | self | TRef | associated_types.rs:356:5:366:5 | Self [trait Subtrait2] | +| associated_types.rs:363:13:363:24 | self.set(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:363:22:363:23 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:364:13:364:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:364:13:364:16 | self | TRef | associated_types.rs:356:5:366:5 | Self [trait Subtrait2] | +| associated_types.rs:364:13:364:24 | self.set(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:364:22:364:23 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] | +| associated_types.rs:373:16:373:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:373:16:373:20 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:373:16:373:20 | SelfParam | TRef.T | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:373:39:375:9 | { ... } | | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:374:13:374:16 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:374:13:374:16 | self | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:374:13:374:16 | self | TRef.T | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:374:13:374:18 | self.0 | | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:377:16:377:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:377:16:377:20 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:377:16:377:20 | SelfParam | TRef.T | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:377:23:377:30 | _content | | associated_types.rs:370:10:370:16 | T | +| associated_types.rs:377:47:379:9 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:378:13:378:43 | MacroExpr | | {EXTERNAL LOCATION} | () | +| associated_types.rs:378:22:378:42 | "Inserting content: \\n" | | {EXTERNAL LOCATION} | & | +| associated_types.rs:378:22:378:42 | "Inserting content: \\n" | TRef | {EXTERNAL LOCATION} | str | +| associated_types.rs:378:22:378:42 | ...::_print(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:378:22:378:42 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:378:22:378:42 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:384:24:384:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:384:24:384:28 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:384:24:384:28 | SelfParam | TRef.T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:384:47:386:9 | { ... } | | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:385:13:385:19 | (...) | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:385:13:385:19 | (...) | T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:385:13:385:21 | ... .0 | | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:385:14:385:18 | * ... | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:385:14:385:18 | * ... | T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:385:15:385:18 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:385:15:385:18 | self | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:385:15:385:18 | self | TRef.T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:391:24:391:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:391:24:391:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:391:24:391:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:393:13:393:30 | ...::default(...) | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:393:13:393:30 | ...::default(...) | | {EXTERNAL LOCATION} | char | +| associated_types.rs:399:24:399:28 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:399:24:399:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:399:24:399:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:400:13:400:30 | ...::default(...) | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:400:13:400:30 | ...::default(...) | | {EXTERNAL LOCATION} | char | +| associated_types.rs:404:33:404:36 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:404:33:404:36 | item | TRef | associated_types.rs:404:20:404:30 | T | +| associated_types.rs:405:9:405:12 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:405:9:405:12 | item | TRef | associated_types.rs:404:20:404:30 | T | +| associated_types.rs:408:35:408:38 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:408:35:408:38 | item | TRef | associated_types.rs:408:21:408:32 | T | +| associated_types.rs:408:90:411:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:409:9:409:12 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:409:9:409:12 | item | TRef | associated_types.rs:408:21:408:32 | T | +| associated_types.rs:409:9:409:20 | item.set(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:410:9:410:12 | item | | {EXTERNAL LOCATION} | & | +| associated_types.rs:410:9:410:12 | item | TRef | associated_types.rs:408:21:408:32 | T | +| associated_types.rs:410:9:410:31 | item.insert_two(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:413:19:422:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:414:13:414:17 | item1 | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:414:13:414:17 | item1 | T | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:414:21:414:33 | MyType(...) | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:414:21:414:33 | MyType(...) | T | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:414:28:414:32 | 42i64 | | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:415:25:415:29 | item1 | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:415:25:415:29 | item1 | T | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:417:13:417:17 | item2 | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:417:13:417:17 | item2 | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:417:21:417:32 | MyType(...) | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:417:21:417:32 | MyType(...) | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:417:28:417:31 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:418:37:418:42 | &item2 | | {EXTERNAL LOCATION} | & | +| associated_types.rs:418:37:418:42 | &item2 | TRef | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:418:37:418:42 | &item2 | TRef.T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:418:38:418:42 | item2 | | associated_types.rs:368:5:368:24 | MyType | +| associated_types.rs:418:38:418:42 | item2 | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:420:13:420:21 | _content3 | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:420:13:420:21 | _content3 | | {EXTERNAL LOCATION} | char | +| associated_types.rs:420:25:420:34 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:420:25:420:34 | Odd(...) | OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:420:25:420:48 | ... .get_content() | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:420:25:420:48 | ... .get_content() | | {EXTERNAL LOCATION} | char | +| associated_types.rs:420:29:420:33 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:421:13:421:21 | _content4 | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:421:13:421:21 | _content4 | | {EXTERNAL LOCATION} | char | +| associated_types.rs:421:25:421:33 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | +| associated_types.rs:421:25:421:33 | Odd(...) | OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:421:25:421:47 | ... .get_content() | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:421:25:421:47 | ... .get_content() | | {EXTERNAL LOCATION} | char | +| associated_types.rs:421:29:421:32 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:435:16:435:20 | SelfParam | | {EXTERNAL LOCATION} | & | +| associated_types.rs:435:16:435:20 | SelfParam | TRef | associated_types.rs:428:5:428:20 | ST | +| associated_types.rs:435:16:435:20 | SelfParam | TRef.T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:435:39:437:9 | { ... } | | {EXTERNAL LOCATION} | Result | +| associated_types.rs:435:39:437:9 | { ... } | E | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:435:39:437:9 | { ... } | T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:436:13:436:22 | Ok(...) | | {EXTERNAL LOCATION} | Result | +| associated_types.rs:436:13:436:22 | Ok(...) | E | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:436:13:436:22 | Ok(...) | T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:436:16:436:19 | self | | {EXTERNAL LOCATION} | & | +| associated_types.rs:436:16:436:19 | self | TRef | associated_types.rs:428:5:428:20 | ST | +| associated_types.rs:436:16:436:19 | self | TRef.T | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:436:16:436:21 | self.0 | | associated_types.rs:430:10:430:21 | Output | +| associated_types.rs:440:19:442:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:441:13:441:14 | _y | | {EXTERNAL LOCATION} | Result | +| associated_types.rs:441:13:441:14 | _y | E | {EXTERNAL LOCATION} | bool | +| associated_types.rs:441:13:441:14 | _y | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:441:18:441:25 | ST(...) | | associated_types.rs:428:5:428:20 | ST | +| associated_types.rs:441:18:441:25 | ST(...) | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:441:18:441:31 | ... .get() | | {EXTERNAL LOCATION} | Result | +| associated_types.rs:441:18:441:31 | ... .get() | E | {EXTERNAL LOCATION} | bool | +| associated_types.rs:441:18:441:31 | ... .get() | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:441:21:441:24 | true | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:449:31:449:31 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:449:31:449:31 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:449:31:449:31 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:449:61:457:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:451:13:451:15 | _a1 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:451:19:451:22 | (...) | | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:451:19:451:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:451:19:451:28 | ... .get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:451:20:451:21 | * ... | | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:451:20:451:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:451:21:451:21 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:451:21:451:21 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:451:21:451:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:454:13:454:15 | _a2 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:454:19:454:19 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:454:19:454:19 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:454:19:454:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:454:19:454:25 | t.get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:456:13:456:15 | _a3 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:456:19:456:24 | get(...) | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:456:23:456:23 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:456:23:456:23 | t | TRef | associated_types.rs:19:1:27:1 | dyn GetSet | +| associated_types.rs:456:23:456:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:459:36:459:36 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:459:36:459:36 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:459:36:459:36 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:459:36:459:36 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:459:92:465:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:460:13:460:15 | _a1 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:460:19:460:22 | (...) | | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:460:19:460:22 | (...) | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:460:19:460:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:460:19:460:28 | ... .get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:460:20:460:21 | * ... | | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:460:20:460:21 | * ... | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:460:20:460:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:460:21:460:21 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:460:21:460:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:460:21:460:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:460:21:460:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:461:13:461:15 | _a2 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:461:19:461:19 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:461:19:461:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:461:19:461:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:461:19:461:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:461:19:461:25 | t.get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:462:13:462:15 | _a3 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:462:19:462:24 | get(...) | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:462:23:462:23 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:462:23:462:23 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:462:23:462:23 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:462:23:462:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:463:13:463:15 | _b1 | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:463:19:463:22 | (...) | | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:463:19:463:22 | (...) | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:463:19:463:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:463:19:463:36 | ... .get_another() | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:463:20:463:21 | * ... | | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:463:20:463:21 | * ... | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:463:20:463:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:463:21:463:21 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:463:21:463:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:463:21:463:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:463:21:463:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:464:13:464:15 | _b2 | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:464:19:464:19 | t | | {EXTERNAL LOCATION} | & | +| associated_types.rs:464:19:464:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet | +| associated_types.rs:464:19:464:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool | +| associated_types.rs:464:19:464:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:464:19:464:33 | t.get_another() | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:468:15:476:1 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:469:5:469:48 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:470:5:470:48 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:471:5:471:45 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:472:5:472:35 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:473:5:473:37 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:474:5:474:41 | ...::test(...) | | {EXTERNAL LOCATION} | () | +| associated_types.rs:475:5:475:46 | ...::test(...) | | {EXTERNAL LOCATION} | () | | blanket_impl.rs:15:18:15:22 | SelfParam | | {EXTERNAL LOCATION} | & | | blanket_impl.rs:15:18:15:22 | SelfParam | TRef | blanket_impl.rs:9:5:10:14 | S2 | | blanket_impl.rs:15:42:17:9 | { ... } | | {EXTERNAL LOCATION} | & | From 0ac50ed4a66e4dc0455bd750e0e6187402e84723 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 19 Jan 2026 15:25:25 +0100 Subject: [PATCH 3/5] Rust: Paths to associated types resolve to the associated type if implementation is unclear --- .../codeql/rust/internal/PathResolution.qll | 164 ++++++++++-------- .../definitions/Definitions.expected | 4 +- .../library-tests/path-resolution/main.rs | 8 +- .../path-resolution/path-resolution.expected | 60 +++---- .../PathResolutionConsistency.expected | 5 - .../TypeInferenceConsistency.expected | 3 - .../type-inference/associated_types.rs | 8 +- .../type-inference/type-inference.expected | 20 --- 8 files changed, 126 insertions(+), 146 deletions(-) delete mode 100644 rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index f30625807b43..f6d769fdf723 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -110,18 +110,15 @@ pragma[nomagic] private ItemNode getAChildSuccessor(ItemNode item, string name, SuccessorKind kind) { item = result.getImmediateParent() and name = result.getName() and + // Associated types in `impl` and `trait` blocks are handled elsewhere + not (item instanceof ImplOrTraitItemNode and result instanceof AssocItem) and // type parameters are only available inside the declaring item if result instanceof TypeParam then kind.isInternal() else - // associated items must always be qualified, also within the declaring - // item (using `Self`) - if item instanceof ImplOrTraitItemNode and result instanceof AssocItem - then kind.isExternal() - else - if result.isPublic() - then kind.isBoth() - else kind.isInternal() + if result.isPublic() + then kind.isBoth() + else kind.isInternal() } private module UseOption = Option; @@ -327,30 +324,24 @@ abstract class ItemNode extends Locatable { ) ) or - // a trait has access to the associated items of its supertraits - this = - any(TraitItemNodeImpl trait | - result = trait.resolveABoundCand().getASuccessor(name, kind, useOpt) and - kind.isExternalOrBoth() and - result instanceof AssocItemNode and - not trait.hasAssocItem(name) - ) + exists(TraitItemNodeImpl trait | this = trait | + result = trait.getAssocItem(name) + or + // a trait has access to the associated items of its supertraits + not trait.hasAssocItem(name) and + result = trait.resolveABoundCand().getASuccessor(name).(AssocItemNode) + ) and + kind.isExternal() and + useOpt.isNone() or // items made available by an implementation where `this` is the implementing type - typeImplEdge(this, _, name, kind, result, useOpt) - or - // trait items with default implementations made available in an implementation - exists(ImplItemNodeImpl impl, TraitItemNode trait | - this = impl and - trait = impl.resolveTraitTyCand() and - result = trait.getASuccessor(name, kind, useOpt) and - // do not inherit default implementations from super traits; those are inherited by - // their `impl` blocks - result = trait.getAssocItem(name) and - result.(AssocItemNode).hasImplementation() and - kind.isExternalOrBoth() and - not impl.hasAssocItem(name) - ) + typeImplEdge(this, _, name, result) and + kind.isExternal() and + useOpt.isNone() + or + implEdge(this, name, result) and + kind.isExternal() and + useOpt.isNone() or // type parameters have access to the associated items of its bounds result = @@ -413,14 +404,8 @@ abstract class ItemNode extends Locatable { this instanceof SourceFile and builtin(name, result) or - exists(ImplOrTraitItemNode i | - name = "Self" and - this = i.getAnItemInSelfScope() - | - result = i.(Trait) - or - result = i.(ImplItemNodeImpl).resolveSelfTyCand() - ) + name = "Self" and + this = result.(ImplOrTraitItemNode).getAnItemInSelfScope() or name = "crate" and this = result.(CrateItemNode).getASourceFile() @@ -755,7 +740,7 @@ abstract class ImplOrTraitItemNode extends ItemNode { } /** Gets an associated item belonging to this trait or `impl` block. */ - abstract AssocItemNode getAnAssocItem(); + AssocItemNode getAnAssocItem() { result = this.getADescendant() } /** Gets the associated item named `name` belonging to this trait or `impl` block. */ pragma[nomagic] @@ -807,12 +792,12 @@ final class ImplItemNode extends ImplOrTraitItemNode instanceof Impl { TraitItemNode resolveTraitTy() { result = resolvePath(this.getTraitPath()) } - override AssocItemNode getAnAssocItem() { result = this.getADescendant() } - override string getName() { result = "(impl)" } override Namespace getNamespace() { - result.isType() // can be referenced with `Self` + // `impl` blocks are refered to using `Self` paths which can appear both as + // types and as values (when the implementing type is a tuple-like struct). + result.isType() or result.isValue() } override TypeParam getTypeParam(int i) { result = super.getGenericParamList().getTypeParam(i) } @@ -985,6 +970,18 @@ private class ImplItemNodeImpl extends ImplItemNode { } TraitItemNodeImpl resolveTraitTyCand() { result = resolvePathCand(this.getTraitPath()) } + + /** + * Gets the associated item named `name` in this impl block or the default + * inherited from the trait being implemented. + */ + AssocItemNode getAssocItemOrDefault(string name) { + result = this.getAssocItem(name) + or + not this.hasAssocItem(name) and + result = this.resolveTraitTyCand().getAssocItem(name) and + result.hasImplementation() + } } private class StructItemNode extends TypeItemTypeItemNode, ParameterizableItemNode instanceof Struct @@ -1020,8 +1017,6 @@ final class TraitItemNode extends ImplOrTraitItemNode, TypeItemNode instanceof T ItemNode resolveABound() { result = this.resolveBound(_) } - override AssocItemNode getAnAssocItem() { result = this.getADescendant() } - override string getName() { result = Trait.super.getName().getText() } override Namespace getNamespace() { result.isType() } @@ -1790,7 +1785,15 @@ private module DollarCrateResolution { pragma[nomagic] private ItemNode resolvePathCand0(PathExt path, Namespace ns) { - result = unqualifiedPathLookup(path, ns, _) + exists(ItemNode res | + res = unqualifiedPathLookup(path, ns, _) and + if + not any(PathExt parent).getQualifier() = path and + isUnqualifiedSelfPath(path) and + res instanceof ImplItemNode + then result = res.(ImplItemNodeImpl).resolveSelfTyCand() + else result = res + ) or DollarCrateResolution::resolveDollarCrate(path, result) and ns = result.getNamespace() @@ -1852,35 +1855,12 @@ private predicate checkQualifiedVisibility( not i instanceof TypeParam } -pragma[nomagic] -private predicate isImplSelfQualifiedPath( - ImplItemNode impl, PathExt qualifier, PathExt path, string name -) { - qualifier = impl.getASelfPath() and - qualifier = path.getQualifier() and - name = path.getText() -} - -private ItemNode resolveImplSelfQualified(PathExt qualifier, PathExt path, Namespace ns) { - exists(ImplItemNode impl, string name | - isImplSelfQualifiedPath(impl, qualifier, path, name) and - result = impl.getAssocItem(name) and - ns = result.getNamespace() - ) -} - /** * Gets the item that `path` resolves to in `ns` when `qualifier` is the * qualifier of `path` and `qualifier` resolves to `q`, if any. */ pragma[nomagic] private ItemNode resolvePathCandQualified(PathExt qualifier, ItemNode q, PathExt path, Namespace ns) { - // Special case for `Self::Assoc`; this always refers to the associated - // item in the enclosing `impl` block, if available. - q = resolvePathCandQualifier(qualifier, path, _) and - result = resolveImplSelfQualified(qualifier, path, ns) - or - not exists(resolveImplSelfQualified(qualifier, path, ns)) and exists(string name, SuccessorKind kind, UseOption useOpt | q = resolvePathCandQualifier(qualifier, path, name) and result = getASuccessor(q, name, ns, kind, useOpt) and @@ -1940,6 +1920,37 @@ private predicate macroExportEdge(CrateItemNode crate, string name, MacroItemNod name = macro.getName() } +/** + * Holds if a `Self` path inside `impl` might refer to a function named `name` + * from another impl block. + */ +pragma[nomagic] +private predicate relevantSelfFunctionName(ImplItemNodeImpl impl, string name) { + any(Path path | path.getQualifier() = impl.getASelfPath()).getText() = name and + not impl.hasAssocItem(name) +} + +/** + * Holds if `impl` has a `node` available externally at `name`. + * + * Since `Self` in an impl block resolves to the impl block, this corresponds to + * the items that should be available on `Self` within the `impl` block. + */ +private predicate implEdge(ImplItemNodeImpl impl, string name, ItemNode node) { + node = impl.getAssocItemOrDefault(name) + or + // Associated types from the implemented trait are available on `Self`. + not impl.hasAssocItem(name) and + node = impl.resolveTraitTyCand().getASuccessor(name).(TypeAliasItemNode) + or + // Items available on the implementing type are available on `Self`. We only + // add these edges when they are relevant. If a type has `n` impl blocks with + // `m` functions each, we would otherwise end up always constructing somethong + // proportional to `O(n * m)`. + relevantSelfFunctionName(impl, name) and + node = impl.resolveSelfTyCand().getASuccessor(name) +} + /** * Holds if item `i` contains a `mod` or `extern crate` definition that * makes the macro `macro` named `name` available using a `#[macro_use]` @@ -2009,9 +2020,10 @@ private ItemNode resolvePathCand(PathExt path) { /** Get a trait that should be visible when `path` resolves to `node`, if any. */ private Trait getResolvePathTraitUsed(PathExt path, AssocItemNode node) { - exists(TypeItemNode type, ImplItemNodeImpl impl | - node = resolvePathCandQualified(_, type, path, _) and - typeImplEdge(type, impl, _, _, node, _) and + exists(TypeItemNode type, ItemNode qual, ImplItemNodeImpl impl | + node = resolvePathCandQualified(_, qual, path, _) and + type = [qual, qual.(ImplItemNodeImpl).resolveSelfTyCand()] and + typeImplEdge(type, impl, _, node) and result = impl.resolveTraitTyCand() ) } @@ -2182,12 +2194,14 @@ private predicate externCrateEdge( * makes `assoc` available as `name` at `kind`. */ private predicate typeImplEdge( - TypeItemNode typeItem, ImplItemNodeImpl impl, string name, SuccessorKind kind, - AssocItemNode assoc, UseOption useOpt + TypeItemNode typeItem, ImplItemNodeImpl impl, string name, AssocItemNode assoc ) { + assoc = impl.getAssocItemOrDefault(name) and typeItem = impl.resolveSelfTyCand() and - assoc = impl.getASuccessor(name, kind, useOpt) and - kind.isExternalOrBoth() + // Functions in `impl` blocks are made available on the implementing type + // (e.g., `S::fun` is valid) but associated types are not (e.g., `S::Output` + // is invalid). + (assoc instanceof FunctionItemNode or assoc instanceof ConstItemNode) } pragma[nomagic] diff --git a/rust/ql/test/library-tests/definitions/Definitions.expected b/rust/ql/test/library-tests/definitions/Definitions.expected index 23ad4e291de3..b051c264a830 100644 --- a/rust/ql/test/library-tests/definitions/Definitions.expected +++ b/rust/ql/test/library-tests/definitions/Definitions.expected @@ -1,12 +1,12 @@ | main.rs:3:5:3:7 | lib | lib.rs:1:1:1:1 | SourceFile | file | | main.rs:9:14:9:14 | S | main.rs:7:9:7:21 | struct S | path | -| main.rs:10:36:10:39 | Self | main.rs:7:9:7:21 | struct S | path | +| main.rs:10:36:10:39 | Self | main.rs:9:9:13:9 | impl S { ... } | path | | main.rs:11:17:11:17 | S | main.rs:7:9:7:21 | struct S | path | | main.rs:16:22:16:22 | T | main.rs:16:19:16:19 | T | path | | main.rs:18:13:18:14 | S2 | main.rs:16:5:16:24 | struct S2 | path | | main.rs:18:16:18:16 | T | main.rs:18:10:18:10 | T | path | | main.rs:19:23:19:23 | T | main.rs:18:10:18:10 | T | path | -| main.rs:19:29:19:32 | Self | main.rs:16:5:16:24 | struct S2 | path | +| main.rs:19:29:19:32 | Self | main.rs:18:5:22:5 | impl S2::<...> { ... } | path | | main.rs:20:13:20:14 | S2 | main.rs:16:5:16:24 | struct S2 | path | | main.rs:20:16:20:16 | x | main.rs:19:20:19:20 | x | local variable | | main.rs:29:5:29:11 | println | {EXTERNAL LOCATION} | MacroRules | path | diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index 3397d3a7000d..9336666b477d 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -729,7 +729,7 @@ mod m23 { fn f(&self) { println!("m23::>::f"); // $ item=println } // I5 - } + } // implTrait1forS #[rustfmt::skip] pub fn f() { @@ -906,14 +906,14 @@ mod associated_types_subtrait { #[rustfmt::skip] impl Sub for S { // $ item=Sub item=S item=i32 - fn f() -> Self::Out { // $ MISSING: item=SuperAssoc SPURIOUS: item=S::Out item=S::Out item=S::Out + fn f() -> Self::Out { // $ item=SuperAssoc 'a' } } #[rustfmt::skip] impl Sub for S { // $ item=Sub item=S item=bool - fn f() -> Self::Out { // $ MISSING: item=SuperAssoc SPURIOUS: item=S::Out item=S::Out item=S::Out + fn f() -> Self::Out { // $ item=SuperAssoc 1 } } @@ -936,7 +936,7 @@ mod associated_types_subtrait { #[rustfmt::skip] impl SubAlt for S { // $ item=SubAlt item=S item=A - fn f(self) -> Self::Out { // $ MISSING: item=SuperAltAssoc SPURIOUS: item=S::Out item=S::Out item=S::Out + fn f(self) -> Self::Out { // $ item=SuperAltAssoc self.0 } } diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 00d38d6e70d5..fd1e5fd8503e 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -135,7 +135,7 @@ resolvePath | main.rs:169:22:169:29 | MyStruct | main.rs:162:5:162:22 | struct MyStruct | | main.rs:171:13:171:19 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:172:13:172:13 | f | main.rs:164:5:166:5 | fn f | -| main.rs:173:13:173:16 | Self | main.rs:162:5:162:22 | struct MyStruct | +| main.rs:173:13:173:16 | Self | main.rs:168:5:179:5 | impl MyTrait for MyStruct { ... } | | main.rs:173:13:173:19 | ...::g | main.rs:176:9:178:9 | fn g | | main.rs:177:13:177:19 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:182:10:182:17 | MyStruct | main.rs:162:5:162:22 | struct MyStruct | @@ -199,7 +199,7 @@ resolvePath | main.rs:341:10:341:15 | Trait1 | main.rs:307:5:311:5 | trait Trait1 | | main.rs:342:11:342:11 | S | main.rs:338:5:338:13 | struct S | | main.rs:344:13:344:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:345:13:345:16 | Self | main.rs:338:5:338:13 | struct S | +| main.rs:345:13:345:16 | Self | main.rs:340:5:352:5 | impl Trait1 for S { ... } | | main.rs:345:13:345:19 | ...::g | main.rs:349:9:351:9 | fn g | | main.rs:350:13:350:19 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:355:10:355:15 | Trait2 | main.rs:313:5:321:5 | trait Trait2 | @@ -232,11 +232,11 @@ resolvePath | main.rs:418:11:418:11 | S | main.rs:412:5:412:13 | struct S | | main.rs:419:24:419:24 | S | main.rs:412:5:412:13 | struct S | | main.rs:420:13:420:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:421:13:421:16 | Self | main.rs:412:5:412:13 | struct S | +| main.rs:421:13:421:16 | Self | main.rs:414:5:432:5 | impl Trait1::<...> for S { ... } | | main.rs:421:13:421:19 | ...::g | main.rs:425:9:428:9 | fn g | | main.rs:425:24:425:24 | S | main.rs:412:5:412:13 | struct S | | main.rs:426:13:426:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:427:13:427:16 | Self | main.rs:412:5:412:13 | struct S | +| main.rs:427:13:427:16 | Self | main.rs:414:5:432:5 | impl Trait1::<...> for S { ... } | | main.rs:427:13:427:19 | ...::c | main.rs:430:9:431:9 | Const | | main.rs:430:18:430:18 | S | main.rs:412:5:412:13 | struct S | | main.rs:430:22:430:22 | S | main.rs:412:5:412:13 | struct S | @@ -244,10 +244,10 @@ resolvePath | main.rs:436:7:436:7 | S | main.rs:412:5:412:13 | struct S | | main.rs:438:11:438:11 | S | main.rs:412:5:412:13 | struct S | | main.rs:439:24:439:24 | S | main.rs:412:5:412:13 | struct S | -| main.rs:440:13:440:16 | Self | main.rs:412:5:412:13 | struct S | +| main.rs:440:13:440:16 | Self | main.rs:434:5:444:5 | impl Trait2::<...> for S { ... } | | main.rs:440:13:440:19 | ...::g | main.rs:425:9:428:9 | fn g | | main.rs:441:13:441:19 | println | {EXTERNAL LOCATION} | MacroRules | -| main.rs:442:13:442:16 | Self | main.rs:412:5:412:13 | struct S | +| main.rs:442:13:442:16 | Self | main.rs:434:5:444:5 | impl Trait2::<...> for S { ... } | | main.rs:442:13:442:19 | ...::c | main.rs:430:9:431:9 | Const | | main.rs:448:9:448:15 | println | {EXTERNAL LOCATION} | MacroRules | | main.rs:449:17:449:17 | S | main.rs:412:5:412:13 | struct S | @@ -269,42 +269,42 @@ resolvePath | main.rs:487:10:487:15 | Trait3 | main.rs:472:5:476:5 | trait Trait3 | | main.rs:487:21:487:22 | S2 | main.rs:484:5:484:14 | struct S2 | | main.rs:488:26:488:28 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:492:20:492:23 | Self | main.rs:484:5:484:14 | struct S2 | +| main.rs:492:20:492:23 | Self | main.rs:486:5:494:5 | impl Trait3 for S2 { ... } | | main.rs:492:20:492:34 | ...::AssocType | main.rs:487:26:489:9 | type AssocType | | main.rs:497:10:497:15 | Trait4 | main.rs:478:5:482:5 | trait Trait4 | | main.rs:497:21:497:22 | S2 | main.rs:484:5:484:14 | struct S2 | | main.rs:498:26:498:29 | bool | {EXTERNAL LOCATION} | struct bool | -| main.rs:502:13:502:16 | Self | main.rs:484:5:484:14 | struct S2 | +| main.rs:502:13:502:16 | Self | main.rs:496:5:506:5 | impl Trait4 for S2 { ... } | | main.rs:502:13:502:19 | ...::f | main.rs:489:11:493:9 | fn f | | main.rs:503:13:503:14 | S2 | main.rs:484:5:484:14 | struct S2 | | main.rs:503:13:503:17 | ...::f | main.rs:489:11:493:9 | fn f | -| main.rs:504:20:504:23 | Self | main.rs:484:5:484:14 | struct S2 | +| main.rs:504:20:504:23 | Self | main.rs:496:5:506:5 | impl Trait4 for S2 { ... } | | main.rs:504:20:504:34 | ...::AssocType | main.rs:497:26:499:9 | type AssocType | | main.rs:511:23:511:26 | Self | main.rs:508:5:512:5 | trait Trait5 | | main.rs:511:23:511:33 | ...::Assoc | main.rs:509:9:509:19 | type Assoc | | main.rs:515:10:515:15 | Trait5 | main.rs:508:5:512:5 | trait Trait5 | | main.rs:515:21:515:21 | S | main.rs:412:5:412:13 | struct S | | main.rs:516:22:516:24 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:520:16:520:19 | Self | main.rs:412:5:412:13 | struct S | +| main.rs:520:16:520:19 | Self | main.rs:514:5:523:5 | impl Trait5 for S { ... } | | main.rs:520:16:520:26 | ...::Assoc | main.rs:515:25:517:9 | type Assoc | -| main.rs:521:13:521:16 | Self | main.rs:412:5:412:13 | struct S | +| main.rs:521:13:521:16 | Self | main.rs:514:5:523:5 | impl Trait5 for S { ... } | | main.rs:521:13:521:23 | ...::Assoc | main.rs:519:9:522:9 | fn Assoc | | main.rs:525:19:525:20 | T3 | main.rs:525:15:525:16 | T3 | | main.rs:528:10:528:15 | Trait5 | main.rs:508:5:512:5 | trait Trait5 | | main.rs:528:21:528:27 | S3::<...> | main.rs:525:5:525:22 | struct S3 | | main.rs:528:24:528:26 | i32 | {EXTERNAL LOCATION} | struct i32 | | main.rs:529:22:529:24 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:533:16:533:19 | Self | main.rs:525:5:525:22 | struct S3 | +| main.rs:533:16:533:19 | Self | main.rs:527:5:536:5 | impl Trait5 for S3::<...> { ... } | | main.rs:533:16:533:26 | ...::Assoc | main.rs:528:31:530:9 | type Assoc | -| main.rs:534:13:534:16 | Self | main.rs:525:5:525:22 | struct S3 | +| main.rs:534:13:534:16 | Self | main.rs:527:5:536:5 | impl Trait5 for S3::<...> { ... } | | main.rs:534:13:534:23 | ...::Assoc | main.rs:532:9:535:9 | fn Assoc | | main.rs:539:10:539:15 | Trait5 | main.rs:508:5:512:5 | trait Trait5 | | main.rs:539:21:539:28 | S3::<...> | main.rs:525:5:525:22 | struct S3 | | main.rs:539:24:539:27 | bool | {EXTERNAL LOCATION} | struct bool | | main.rs:540:22:540:25 | bool | {EXTERNAL LOCATION} | struct bool | -| main.rs:544:16:544:19 | Self | main.rs:525:5:525:22 | struct S3 | +| main.rs:544:16:544:19 | Self | main.rs:538:5:547:5 | impl Trait5 for S3::<...> { ... } | | main.rs:544:16:544:26 | ...::Assoc | main.rs:539:32:541:9 | type Assoc | -| main.rs:545:14:545:17 | Self | main.rs:525:5:525:22 | struct S3 | +| main.rs:545:14:545:17 | Self | main.rs:538:5:547:5 | impl Trait5 for S3::<...> { ... } | | main.rs:545:14:545:24 | ...::Assoc | main.rs:543:9:546:9 | fn Assoc | | main.rs:550:10:550:16 | S3::<...> | main.rs:525:5:525:22 | struct S3 | | main.rs:550:13:550:15 | i32 | {EXTERNAL LOCATION} | struct i32 | @@ -338,7 +338,7 @@ resolvePath | main.rs:608:13:608:13 | X | main.rs:586:9:586:21 | struct X | | main.rs:608:13:608:23 | ...::a_method | main.rs:588:26:591:13 | fn a_method | | main.rs:611:18:611:18 | X | main.rs:586:9:586:21 | struct X | -| main.rs:613:21:613:24 | Self | main.rs:586:9:586:21 | struct X | +| main.rs:613:21:613:24 | Self | main.rs:610:13:615:13 | impl X { ... } | | main.rs:613:21:613:34 | ...::a_method | main.rs:588:26:591:13 | fn a_method | | main.rs:619:17:619:17 | m | main.rs:577:5:599:5 | mod m | | main.rs:619:17:619:22 | ...::Bar | main.rs:582:9:584:9 | trait Bar | @@ -441,17 +441,17 @@ resolvePath | main.rs:852:13:852:17 | Error | main.rs:848:13:848:17 | Error | | main.rs:855:22:858:9 | Result::<...> | {EXTERNAL LOCATION} | enum Result | | main.rs:856:13:856:17 | Input | main.rs:847:13:847:17 | Input | -| main.rs:857:13:857:16 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:857:13:857:16 | Self | main.rs:845:5:877:5 | impl Reduce for MyImpl::<...> { ... } | | main.rs:857:13:857:23 | ...::Error | main.rs:859:11:863:9 | type Error | | main.rs:860:22:862:9 | Option::<...> | {EXTERNAL LOCATION} | enum Option | | main.rs:861:11:861:15 | Error | main.rs:848:13:848:17 | Error | | main.rs:865:13:865:17 | Input | main.rs:847:13:847:17 | Input | -| main.rs:870:19:870:22 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:870:19:870:22 | Self | main.rs:845:5:877:5 | impl Reduce for MyImpl::<...> { ... } | | main.rs:870:19:870:29 | ...::Input | main.rs:855:9:859:9 | type Input | | main.rs:871:14:874:9 | Result::<...> | {EXTERNAL LOCATION} | enum Result | -| main.rs:872:13:872:16 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:872:13:872:16 | Self | main.rs:845:5:877:5 | impl Reduce for MyImpl::<...> { ... } | | main.rs:872:13:872:24 | ...::Output | main.rs:863:11:866:9 | type Output | -| main.rs:873:13:873:16 | Self | main.rs:840:5:843:5 | struct MyImpl | +| main.rs:873:13:873:16 | Self | main.rs:845:5:877:5 | impl Reduce for MyImpl::<...> { ... } | | main.rs:873:13:873:23 | ...::Error | main.rs:859:11:863:9 | type Error | | main.rs:885:16:885:20 | Super | main.rs:881:5:883:5 | trait Super | | main.rs:887:19:887:22 | Self | main.rs:885:5:889:5 | trait Sub | @@ -468,17 +468,13 @@ resolvePath | main.rs:908:10:908:12 | Sub | main.rs:885:5:889:5 | trait Sub | | main.rs:908:18:908:23 | S::<...> | main.rs:891:5:893:6 | struct S | | main.rs:908:20:908:22 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:909:19:909:22 | Self | main.rs:891:5:893:6 | struct S | -| main.rs:909:19:909:27 | ...::Out | main.rs:896:29:898:9 | type Out | -| main.rs:909:19:909:27 | ...::Out | main.rs:902:30:904:9 | type Out | -| main.rs:909:19:909:27 | ...::Out | main.rs:932:33:934:9 | type Out | +| main.rs:909:19:909:22 | Self | main.rs:907:5:912:5 | impl Sub for S::<...> { ... } | +| main.rs:909:19:909:27 | ...::Out | main.rs:882:9:882:17 | type Out | | main.rs:915:10:915:12 | Sub | main.rs:885:5:889:5 | trait Sub | | main.rs:915:18:915:24 | S::<...> | main.rs:891:5:893:6 | struct S | | main.rs:915:20:915:23 | bool | {EXTERNAL LOCATION} | struct bool | -| main.rs:916:19:916:22 | Self | main.rs:891:5:893:6 | struct S | -| main.rs:916:19:916:27 | ...::Out | main.rs:896:29:898:9 | type Out | -| main.rs:916:19:916:27 | ...::Out | main.rs:902:30:904:9 | type Out | -| main.rs:916:19:916:27 | ...::Out | main.rs:932:33:934:9 | type Out | +| main.rs:916:19:916:22 | Self | main.rs:914:5:919:5 | impl Sub for S::<...> { ... } | +| main.rs:916:19:916:27 | ...::Out | main.rs:882:9:882:17 | type Out | | main.rs:925:19:925:26 | SuperAlt | main.rs:921:5:923:5 | trait SuperAlt | | main.rs:927:23:927:26 | Self | main.rs:925:5:929:5 | trait SubAlt | | main.rs:927:23:927:31 | ...::Out | main.rs:922:9:922:17 | type Out | @@ -489,10 +485,8 @@ resolvePath | main.rs:938:13:938:18 | SubAlt | main.rs:925:5:929:5 | trait SubAlt | | main.rs:938:24:938:27 | S::<...> | main.rs:891:5:893:6 | struct S | | main.rs:938:26:938:26 | A | main.rs:938:10:938:10 | A | -| main.rs:939:23:939:26 | Self | main.rs:891:5:893:6 | struct S | -| main.rs:939:23:939:31 | ...::Out | main.rs:896:29:898:9 | type Out | -| main.rs:939:23:939:31 | ...::Out | main.rs:902:30:904:9 | type Out | -| main.rs:939:23:939:31 | ...::Out | main.rs:932:33:934:9 | type Out | +| main.rs:939:23:939:26 | Self | main.rs:937:5:942:5 | impl SubAlt for S::<...> { ... } | +| main.rs:939:23:939:31 | ...::Out | main.rs:922:9:922:17 | type Out | | main.rs:945:5:945:7 | std | {EXTERNAL LOCATION} | Crate(std@0.0.0) | | main.rs:945:11:945:14 | self | {EXTERNAL LOCATION} | Crate(std@0.0.0) | | main.rs:947:15:947:17 | ztd | {EXTERNAL LOCATION} | Crate(std@0.0.0) | @@ -536,7 +530,7 @@ resolvePath | main.rs:1041:13:1041:15 | i32 | {EXTERNAL LOCATION} | struct i32 | | main.rs:1046:10:1046:15 | MyEnum | main.rs:1039:5:1043:5 | enum MyEnum | | main.rs:1047:25:1047:27 | i32 | {EXTERNAL LOCATION} | struct i32 | -| main.rs:1049:17:1049:20 | Self | main.rs:1039:5:1043:5 | enum MyEnum | +| main.rs:1049:17:1049:20 | Self | main.rs:1045:5:1056:5 | impl MyEnum { ... } | | main.rs:1049:17:1049:23 | ...::A | main.rs:1040:9:1042:9 | A | | main.rs:1060:5:1060:6 | my | main.rs:1:1:1:7 | mod my | | main.rs:1060:5:1060:14 | ...::nested | my.rs:1:1:1:15 | mod nested | diff --git a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected index 7b751c9ea8be..97dfe4bc278c 100644 --- a/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected +++ b/rust/ql/test/library-tests/type-inference/CONSISTENCY/PathResolutionConsistency.expected @@ -1,7 +1,2 @@ multipleResolvedTargets -| associated_types.rs:393:13:393:30 | ...::default(...) | -| associated_types.rs:400:13:400:30 | ...::default(...) | | main.rs:2871:13:2871:17 | x.f() | -multiplePathResolutions -| associated_types.rs:391:34:391:45 | ...::Output | -| associated_types.rs:399:34:399:45 | ...::Output | diff --git a/rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected b/rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected deleted file mode 100644 index f2551bcad6ca..000000000000 --- a/rust/ql/test/library-tests/type-inference/CONSISTENCY/TypeInferenceConsistency.expected +++ /dev/null @@ -1,3 +0,0 @@ -nonUniqueCertainType -| associated_types.rs:391:47:394:9 | { ... } | | -| associated_types.rs:399:47:401:9 | { ... } | | diff --git a/rust/ql/test/library-tests/type-inference/associated_types.rs b/rust/ql/test/library-tests/type-inference/associated_types.rs index b517b63403f8..332b1d554171 100644 --- a/rust/ql/test/library-tests/type-inference/associated_types.rs +++ b/rust/ql/test/library-tests/type-inference/associated_types.rs @@ -390,14 +390,14 @@ mod associated_type_in_supertrait { // Odd::get_content fn get_content(&self) -> Self::Output { // let _x = Self::get(self); - Default::default() // $ target=default + Default::default() // $ MISSING: target=default } } impl Subtrait for Odd { // Odd::get_content fn get_content(&self) -> Self::Output { - Default::default() // $ target=default + Default::default() // $ MISSING: target=default } } @@ -417,8 +417,8 @@ mod associated_type_in_supertrait { let item2 = MyType(true); let _content2 = get_content(&item2); // $ target=get_content MISSING: type=_content2:bool - let _content3 = Odd(42i32).get_content(); // $ target=Odd::get_content type=_content3:bool SPURIOUS: type=_content3:char - let _content4 = Odd(true).get_content(); // $ target=Odd::get_content type=_content4:char SPURIOUS: type=_content4:bool + let _content3 = Odd(42i32).get_content(); // $ target=Odd::get_content MISSING: type=_content3:bool + let _content4 = Odd(true).get_content(); // $ target=Odd::get_content MISSING: type=_content4:char } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 14d6ae3115e3..80ee3a2b1d54 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -192,13 +192,9 @@ inferCertainType | associated_types.rs:391:24:391:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:391:24:391:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:391:24:391:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | char | | associated_types.rs:399:24:399:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:399:24:399:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:399:24:399:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | -| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | char | | associated_types.rs:404:33:404:36 | item | | {EXTERNAL LOCATION} | & | | associated_types.rs:404:33:404:36 | item | TRef | associated_types.rs:404:20:404:30 | T | | associated_types.rs:405:9:405:12 | item | | {EXTERNAL LOCATION} | & | @@ -5020,17 +5016,9 @@ inferType | associated_types.rs:391:24:391:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:391:24:391:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:391:24:391:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | char | -| associated_types.rs:393:13:393:30 | ...::default(...) | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:393:13:393:30 | ...::default(...) | | {EXTERNAL LOCATION} | char | | associated_types.rs:399:24:399:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:399:24:399:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:399:24:399:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | -| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | char | -| associated_types.rs:400:13:400:30 | ...::default(...) | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:400:13:400:30 | ...::default(...) | | {EXTERNAL LOCATION} | char | | associated_types.rs:404:33:404:36 | item | | {EXTERNAL LOCATION} | & | | associated_types.rs:404:33:404:36 | item | TRef | associated_types.rs:404:20:404:30 | T | | associated_types.rs:405:9:405:12 | item | | {EXTERNAL LOCATION} | & | @@ -5062,19 +5050,11 @@ inferType | associated_types.rs:418:37:418:42 | &item2 | TRef.T | {EXTERNAL LOCATION} | bool | | associated_types.rs:418:38:418:42 | item2 | | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:418:38:418:42 | item2 | T | {EXTERNAL LOCATION} | bool | -| associated_types.rs:420:13:420:21 | _content3 | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:420:13:420:21 | _content3 | | {EXTERNAL LOCATION} | char | | associated_types.rs:420:25:420:34 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:420:25:420:34 | Odd(...) | OddT | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:420:25:420:48 | ... .get_content() | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:420:25:420:48 | ... .get_content() | | {EXTERNAL LOCATION} | char | | associated_types.rs:420:29:420:33 | 42i32 | | {EXTERNAL LOCATION} | i32 | -| associated_types.rs:421:13:421:21 | _content4 | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:421:13:421:21 | _content4 | | {EXTERNAL LOCATION} | char | | associated_types.rs:421:25:421:33 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:421:25:421:33 | Odd(...) | OddT | {EXTERNAL LOCATION} | bool | -| associated_types.rs:421:25:421:47 | ... .get_content() | | {EXTERNAL LOCATION} | bool | -| associated_types.rs:421:25:421:47 | ... .get_content() | | {EXTERNAL LOCATION} | char | | associated_types.rs:421:29:421:32 | true | | {EXTERNAL LOCATION} | bool | | associated_types.rs:435:16:435:20 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:435:16:435:20 | SelfParam | TRef | associated_types.rs:428:5:428:20 | ST | From 2f889710bcf0b5878788cc9375d21c89b75c5e72 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 26 Jan 2026 14:55:59 +0100 Subject: [PATCH 4/5] Rust: Implement `TypeMention` for paths that access associated types on concrete types --- .../rust/internal/typeinference/Type.qll | 6 +- .../internal/typeinference/TypeInference.qll | 8 +- .../internal/typeinference/TypeMention.qll | 1097 +++++++++-------- .../type-inference/associated_types.rs | 32 +- .../type-inference/type-inference.expected | 53 + 5 files changed, 670 insertions(+), 526 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll b/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll index bf25d96cfa4c..983e9a75ee5a 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/Type.qll @@ -75,7 +75,7 @@ abstract class Type extends TType { abstract TypeParameter getPositionalTypeParameter(int i); /** Gets the default type for the `i`th type parameter, if any. */ - TypeMention getTypeParameterDefault(int i) { none() } + TypeRepr getTypeParameterDefault(int i) { none() } /** * Gets a type parameter of this type. @@ -129,7 +129,7 @@ class DataType extends Type, TDataType { result = TTypeParamTypeParameter(typeItem.getGenericParamList().getTypeParam(i)) } - override TypeMention getTypeParameterDefault(int i) { + override TypeRepr getTypeParameterDefault(int i) { result = typeItem.getGenericParamList().getTypeParam(i).getDefaultType() } @@ -189,7 +189,7 @@ class TraitType extends Type, TTrait { result.(SelfTypeParameter).getTrait() = trait } - override TypeMention getTypeParameterDefault(int i) { + override TypeRepr getTypeParameterDefault(int i) { result = trait.getGenericParamList().getTypeParam(i).getDefaultType() } diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll index b051d60d8b4d..4170874df5d6 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll @@ -134,8 +134,8 @@ class TypePath = M1::TypePath; module TypePath = M1::TypePath; -private module Input2 implements InputSig2 { - TypeMention getABaseTypeMention(Type t) { none() } +private module Input2 implements InputSig2 { + PreTypeMention getABaseTypeMention(Type t) { none() } Type getATypeParameterConstraint(TypeParameter tp, TypePath path) { exists(TypeMention tm | result = tm.getTypeAt(path) | @@ -158,7 +158,7 @@ private module Input2 implements InputSig2 { * inference module for more information. */ predicate conditionSatisfiesConstraint( - TypeAbstraction abs, TypeMention condition, TypeMention constraint, boolean transitive + TypeAbstraction abs, PreTypeMention condition, PreTypeMention constraint, boolean transitive ) { // `impl` blocks implementing traits transitive = false and @@ -208,7 +208,7 @@ private module Input2 implements InputSig2 { } } -private module M2 = Make2; +private module M2 = Make2; import M2 diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll b/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll index a5a9eae37156..f4d7a82bb5be 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/TypeMention.qll @@ -7,602 +7,693 @@ private import Type private import TypeAbstraction private import TypeInference -/** An AST node that may mention a type. */ -abstract class TypeMention extends AstNode { - /** Gets the type at `path` that this mention resolves to, if any. */ - pragma[nomagic] - abstract Type getTypeAt(TypePath path); +private signature Type getAdditionalPathTypeAtSig(Path p, TypePath typePath); - /** Gets the type that this node resolves to, if any. */ - pragma[nomagic] - final Type getType() { result = this.getTypeAt(TypePath::nil()) } -} +/** + * Constructing the "type hierachy" (that is, the trait hierachy and how types + * implements trait) in the shared type inference library relies on type + * mentions. + * + * Furthermore, resolving type mentions such as `::AssocType` + * relies on knowing how `Type` implements `Trait`. This makes type mentions and + * the type hierachy recursively dependentent, which causes non-monotonic + * recursion. + * + * To avoid the recursion, we parameterize the `TypeMention` by a predicate for + * resolving "additional" types for paths. A first instantion uses the empty + * predicate to create `PreTypeMention` which is used to construct the type + * hierachy. Afterwards, a second instantion uses a predicate that can resolve + * paths that rely on the type hierachy to create the actual `TypeMention`. + */ +private module MkTypeMention { + /** An AST node that may mention a type. */ + abstract private class TypeMentionImpl extends AstNode { + /** Gets the type at `path` that this type mention resolves to, if any. */ + pragma[nomagic] + abstract Type getTypeAt(TypePath path); -class TupleTypeReprMention extends TypeMention instanceof TupleTypeRepr { - override Type getTypeAt(TypePath path) { - path.isEmpty() and - result.(TupleType).getArity() = super.getNumberOfFields() - or - exists(TypePath suffix, int i | - result = super.getField(i).(TypeMention).getTypeAt(suffix) and - path = TypePath::cons(getTupleTypeParameter(super.getNumberOfFields(), i), suffix) - ) + /** Gets the root type that this type mention resolves to, if any. */ + pragma[nomagic] + final Type getType() { result = this.getTypeAt(TypePath::nil()) } } -} -class ParenthesizedArgListMention extends TypeMention instanceof ParenthesizedArgList { - override Type getTypeAt(TypePath path) { - path.isEmpty() and - result.(TupleType).getArity() = super.getNumberOfTypeArgs() - or - exists(TypePath suffix, int index | - result = super.getTypeArg(index).getTypeRepr().(TypeMention).getTypeAt(suffix) and - path = TypePath::cons(getTupleTypeParameter(super.getNumberOfTypeArgs(), index), suffix) - ) - } -} + final class TypeMention = TypeMentionImpl; -class ArrayTypeReprMention extends TypeMention instanceof ArrayTypeRepr { - override Type getTypeAt(TypePath path) { - path.isEmpty() and - result instanceof ArrayType - or - exists(TypePath suffix | - result = super.getElementTypeRepr().(TypeMention).getTypeAt(suffix) and - path = TypePath::cons(getArrayTypeParameter(), suffix) - ) + class TupleTypeReprMention extends TypeMentionImpl instanceof TupleTypeRepr { + override Type getTypeAt(TypePath path) { + path.isEmpty() and + result.(TupleType).getArity() = super.getNumberOfFields() + or + exists(TypePath suffix, int i | + result = super.getField(i).(TypeMention).getTypeAt(suffix) and + path = TypePath::cons(getTupleTypeParameter(super.getNumberOfFields(), i), suffix) + ) + } } -} -class RefTypeReprMention extends TypeMention instanceof RefTypeRepr { - private RefType resolveRootType() { - if super.isMut() then result instanceof RefMutType else result instanceof RefSharedType + class ParenthesizedArgListMention extends TypeMentionImpl instanceof ParenthesizedArgList { + override Type getTypeAt(TypePath path) { + path.isEmpty() and + result.(TupleType).getArity() = super.getNumberOfTypeArgs() + or + exists(TypePath suffix, int index | + result = super.getTypeArg(index).getTypeRepr().(TypeMention).getTypeAt(suffix) and + path = TypePath::cons(getTupleTypeParameter(super.getNumberOfTypeArgs(), index), suffix) + ) + } } - override Type getTypeAt(TypePath path) { - path.isEmpty() and result = this.resolveRootType() - or - exists(TypePath suffix | - result = super.getTypeRepr().(TypeMention).getTypeAt(suffix) and - path = TypePath::cons(this.resolveRootType().getPositionalTypeParameter(0), suffix) - ) + class ArrayTypeReprMention extends TypeMentionImpl instanceof ArrayTypeRepr { + override Type getTypeAt(TypePath path) { + path.isEmpty() and + result instanceof ArrayType + or + exists(TypePath suffix | + result = super.getElementTypeRepr().(TypeMention).getTypeAt(suffix) and + path = TypePath::cons(getArrayTypeParameter(), suffix) + ) + } } -} -class SliceTypeReprMention extends TypeMention instanceof SliceTypeRepr { - override Type getTypeAt(TypePath path) { - path.isEmpty() and - result instanceof SliceType - or - exists(TypePath suffix | - result = super.getTypeRepr().(TypeMention).getTypeAt(suffix) and - path = TypePath::cons(getSliceTypeParameter(), suffix) - ) - } -} + class RefTypeReprMention extends TypeMentionImpl instanceof RefTypeRepr { + private RefType resolveRootType() { + if super.isMut() then result instanceof RefMutType else result instanceof RefSharedType + } -abstract class PathTypeMention extends TypeMention, Path { - abstract Type resolvePathTypeAt(TypePath typePath); + override Type getTypeAt(TypePath path) { + path.isEmpty() and result = this.resolveRootType() + or + exists(TypePath suffix | + result = super.getTypeRepr().(TypeMention).getTypeAt(suffix) and + path = TypePath::cons(this.resolveRootType().getPositionalTypeParameter(0), suffix) + ) + } + } - final override Type getTypeAt(TypePath typePath) { - result = this.resolvePathTypeAt(typePath) and - ( - not result instanceof TypeParameter + class SliceTypeReprMention extends TypeMentionImpl instanceof SliceTypeRepr { + override Type getTypeAt(TypePath path) { + path.isEmpty() and + result instanceof SliceType or - // Prevent type parameters from escaping their scope - this = result.(TypeParameter).getDeclaringItem().getAChild*().getADescendant() - ) + exists(TypePath suffix | + result = super.getTypeRepr().(TypeMention).getTypeAt(suffix) and + path = TypePath::cons(getSliceTypeParameter(), suffix) + ) + } } -} -class AliasPathTypeMention extends PathTypeMention { - TypeAlias resolved; - TypeMention rhs; + abstract class PathTypeMention extends TypeMentionImpl, Path { + abstract Type resolvePathTypeAt(TypePath typePath); - AliasPathTypeMention() { - resolved = resolvePath(this) and - rhs = resolved.getTypeRepr() + final override Type getTypeAt(TypePath typePath) { + result = getAdditionalPathTypeAt(this, typePath) + or + result = this.resolvePathTypeAt(typePath) and + ( + not result instanceof TypeParameter + or + // Prevent type parameters from escaping their scope + this = result.(TypeParameter).getDeclaringItem().getAChild*().getADescendant() + ) + } } - TypeItemNode getResolved() { result = resolved } + class AdditionalPathTypeMention extends PathTypeMention { + AdditionalPathTypeMention() { exists(getAdditionalPathTypeAt(this, _)) } - /** - * Holds if this path resolved to a type alias with a rhs. that has the - * resulting type at `typePath`. - */ - override Type resolvePathTypeAt(TypePath typePath) { - result = rhs.getTypeAt(typePath) and - not result = pathGetTypeParameter(resolved, _) - or - exists(TypeParameter tp, TypeMention arg, TypePath prefix, TypePath suffix, int i | - tp = rhs.getTypeAt(prefix) and - tp = pathGetTypeParameter(resolved, pragma[only_bind_into](i)) and - arg = this.getSegment().getGenericArgList().getTypeArg(pragma[only_bind_into](i)) and - result = arg.getTypeAt(suffix) and - typePath = prefix.append(suffix) - ) + override Type resolvePathTypeAt(TypePath typePath) { + result = getAdditionalPathTypeAt(this, typePath) + } } -} -/** - * Gets the `i`th type argument of `p`. - * - * Takes into account that variants can have type arguments applied to both the - * enum and the variant itself, e.g. `Option::::Some` is valid in addition - * to `Option::Some::`. - */ -TypeMention getPathTypeArgument(Path p, int i) { - result = p.getSegment().getGenericArgList().getTypeArg(i) - or - resolvePath(p) instanceof Variant and - result = p.getQualifier().getSegment().getGenericArgList().getTypeArg(i) -} - -class NonAliasPathTypeMention extends PathTypeMention { - TypeItemNode resolved; + class AliasPathTypeMention extends PathTypeMention { + TypeAlias resolved; + TypeMention rhs; - NonAliasPathTypeMention() { - resolved = [resolvePath(this), resolvePath(this).(Variant).getEnum().(TypeItemNode)] and - not exists(resolved.(TypeAlias).getTypeRepr()) and - not this = any(ImplItemNode i).getASelfPath() // handled by `ImplSelfMention` - } + AliasPathTypeMention() { + resolved = resolvePath(this) and + rhs = resolved.getTypeRepr() + } - TypeItemNode getResolved() { result = resolved } + TypeItemNode getResolved() { result = resolved } - pragma[nomagic] - private TypeMention getAssocTypeArg(string name) { - result = this.getSegment().getGenericArgList().getAssocTypeArg(name) + /** + * Holds if this path resolved to a type alias with a rhs. that has the + * resulting type at `typePath`. + */ + override Type resolvePathTypeAt(TypePath typePath) { + result = rhs.getTypeAt(typePath) and + not result = pathGetTypeParameter(resolved, _) + or + exists(TypeParameter tp, TypeMention arg, TypePath prefix, TypePath suffix, int i | + tp = rhs.getTypeAt(prefix) and + tp = pathGetTypeParameter(resolved, pragma[only_bind_into](i)) and + arg = this.getSegment().getGenericArgList().getTypeArg(pragma[only_bind_into](i)) and + result = arg.getTypeAt(suffix) and + typePath = prefix.append(suffix) + ) + } } /** - * Gets the type mention that instantiates the implicit `Self` type parameter - * for this path, if it occurs in the position of a trait bound. + * Gets the `i`th type argument of `p`. + * + * Takes into account that variants can have type arguments applied to both the + * enum and the variant itself, e.g. `Option::::Some` is valid in addition + * to `Option::Some::`. */ - private TypeMention getSelfTraitBoundArg() { - exists(ImplItemNode impl | this = impl.getTraitPath() and result = impl.(Impl).getSelfTy()) - or - exists(Trait subTrait | - this = subTrait.getATypeBound().getTypeRepr().(PathTypeRepr).getPath() and - result.(SelfTypeParameterMention).getTrait() = subTrait - ) + TypeMention getPathTypeArgument(Path p, int i) { + result = p.getSegment().getGenericArgList().getTypeArg(i) or - exists(TypeParamItemNode tp | this = tp.getABoundPath() and result = tp) + resolvePath(p) instanceof Variant and + result = p.getQualifier().getSegment().getGenericArgList().getTypeArg(i) } - private Type getDefaultPositionalTypeArgument(int i, TypePath path) { - // If a type argument is not given in the path, then we use the default for - // the type parameter if one exists for the type. - not exists(getPathTypeArgument(this, i)) and - // Defaults only apply to type mentions in type annotations - this = any(PathTypeRepr ptp).getPath().getQualifier*() and - exists(Type ty, TypePath prefix | - ty = this.resolveRootType().getTypeParameterDefault(i).getTypeAt(prefix) and - if not ty = TSelfTypeParameter(resolved) - then result = ty and path = prefix - else - // When a default contains an implicit `Self` type parameter, it should - // be substituted for the type that implements the trait. - exists(TypePath suffix | - path = prefix.append(suffix) and - result = this.getSelfTraitBoundArg().getTypeAt(suffix) - ) - ) - } + class NonAliasPathTypeMention extends PathTypeMention { + TypeItemNode resolved; - private Type getPositionalTypeArgument(int i, TypePath path) { - result = getPathTypeArgument(this, i).getTypeAt(path) - or - result = this.getDefaultPositionalTypeArgument(i, path) - } + NonAliasPathTypeMention() { + resolved = [resolvePath(this), resolvePath(this).(Variant).getEnum().(TypeItemNode)] and + not exists(resolved.(TypeAlias).getTypeRepr()) and + not exists(getAdditionalPathTypeAt(this, _)) and // handled by `AdditionalPathTypeMention` + not this = any(ImplItemNode i).getASelfPath() // handled by `ImplSelfMention` + } - /** - * Gets the type for this path for the type parameter `tp` at `path`, when the - * type parameter does not correspond directly to a type mention. - */ - private Type getTypeForTypeParameterAt(TypeParameter tp, TypePath path) { - exists(int i | - result = this.getPositionalTypeArgument(pragma[only_bind_into](i), path) and - tp = this.resolveRootType().getPositionalTypeParameter(pragma[only_bind_into](i)) - ) - or - // Handle the special syntactic sugar for function traits. The syntactic - // form is detected by the presence of a parenthesized argument list which - // is a mandatory part of the syntax [1]. - // - // For now we only support `FnOnce` as we can't support the "inherited" - // associated types of `Fn` and `FnMut` yet. - // - // [1]: https://doc.rust-lang.org/reference/paths.html#grammar-TypePathFn - exists(AnyFnTrait t, PathSegment s | - t = resolved and - s = this.getSegment() and - s.hasParenthesizedArgList() - | - tp = TTypeParamTypeParameter(t.getTypeParam()) and - result = s.getParenthesizedArgList().(TypeMention).getTypeAt(path) + TypeItemNode getResolved() { result = resolved } + + pragma[nomagic] + private TypeMention getAssocTypeArg(string name) { + result = this.getSegment().getGenericArgList().getAssocTypeArg(name) + } + + /** + * Gets the type mention that instantiates the implicit `Self` type parameter + * for this path, if it occurs in the position of a trait bound. + */ + private TypeMention getSelfTraitBoundArg() { + exists(ImplItemNode impl | this = impl.getTraitPath() and result = impl.(Impl).getSelfTy()) or - tp = TAssociatedTypeTypeParameter(t, any(FnOnceTrait tr).getOutputType()) and - ( - result = s.getRetType().getTypeRepr().(TypeMention).getTypeAt(path) + exists(Trait subTrait | + this = subTrait.getATypeBound().getTypeRepr().(PathTypeRepr).getPath() and + result.(SelfTypeParameterMention).getTrait() = subTrait + ) + or + exists(TypeParamItemNode tp | this = tp.getABoundPath() and result = tp) + } + + private Type getDefaultPositionalTypeArgument(int i, TypePath path) { + // If a type argument is not given in the path, then we use the default for + // the type parameter if one exists for the type. + not exists(getPathTypeArgument(this, i)) and + // Defaults only apply to type mentions in type annotations + this = any(PathTypeRepr ptp).getPath().getQualifier*() and + exists(Type ty, TypePath prefix | + ty = this.resolveRootType().getTypeParameterDefault(i).(TypeMention).getTypeAt(prefix) and + if not ty = TSelfTypeParameter(resolved) + then result = ty and path = prefix + else + // When a default contains an implicit `Self` type parameter, it should + // be substituted for the type that implements the trait. + exists(TypePath suffix | + path = prefix.append(suffix) and + result = this.getSelfTraitBoundArg().getTypeAt(suffix) + ) + ) + } + + private Type getPositionalTypeArgument(int i, TypePath path) { + result = getPathTypeArgument(this, i).getTypeAt(path) + or + result = this.getDefaultPositionalTypeArgument(i, path) + } + + /** + * Gets the type for this path for the type parameter `tp` at `path`, when the + * type parameter does not correspond directly to a type mention. + */ + private Type getTypeForTypeParameterAt(TypeParameter tp, TypePath path) { + exists(int i | + result = this.getPositionalTypeArgument(pragma[only_bind_into](i), path) and + tp = this.resolveRootType().getPositionalTypeParameter(pragma[only_bind_into](i)) + ) + or + // Handle the special syntactic sugar for function traits. The syntactic + // form is detected by the presence of a parenthesized argument list which + // is a mandatory part of the syntax [1]. + // + // For now we only support `FnOnce` as we can't support the "inherited" + // associated types of `Fn` and `FnMut` yet. + // + // [1]: https://doc.rust-lang.org/reference/paths.html#grammar-TypePathFn + exists(AnyFnTrait t, PathSegment s | + t = resolved and + s = this.getSegment() and + s.hasParenthesizedArgList() + | + tp = TTypeParamTypeParameter(t.getTypeParam()) and + result = s.getParenthesizedArgList().(TypeMention).getTypeAt(path) or - // When the `-> ...` return type is omitted, it defaults to `()`. - not s.hasRetType() and - result instanceof UnitType and + tp = TAssociatedTypeTypeParameter(t, any(FnOnceTrait tr).getOutputType()) and + ( + result = s.getRetType().getTypeRepr().(TypeMention).getTypeAt(path) + or + // When the `-> ...` return type is omitted, it defaults to `()`. + not s.hasRetType() and + result instanceof UnitType and + path.isEmpty() + ) + ) + or + // If `path` is the supertrait of a trait block then any associated types + // of the supertrait should be instantiated with the subtrait's + // corresponding copies. + // + // As an example, for + // ```rust + // trait Sub: Super { + // // ^^^^^ this + // ``` + // we do something to the effect of: + // ```rust + // trait Sub: Super + // ``` + // Where `Assoc` is an associated type of `Super` and `Assoc[Sub]` denotes + // the copy of the type parameter inherited by `Sub`. + exists(Trait subtrait, TypeAlias alias | + subtrait.getATypeBound().getTypeRepr().(PathTypeRepr).getPath() = this and + result = TAssociatedTypeTypeParameter(subtrait, alias) and + tp = TAssociatedTypeTypeParameter(resolved, alias) and path.isEmpty() ) - ) - or - // If `path` is the supertrait of a trait block then any associated types - // of the supertrait should be instantiated with the subtrait's - // corresponding copies. - // - // As an example, for - // ```rust - // trait Sub: Super { - // // ^^^^^ this - // ``` - // we do something to the effect of: - // ```rust - // trait Sub: Super - // ``` - // Where `Assoc` is an associated type of `Super` and `Assoc[Sub]` denotes - // the copy of the type parameter inherited by `Sub`. - exists(Trait subtrait, TypeAlias alias | - subtrait.getATypeBound().getTypeRepr().(PathTypeRepr).getPath() = this and - result = TAssociatedTypeTypeParameter(subtrait, alias) and - tp = TAssociatedTypeTypeParameter(resolved, alias) and - path.isEmpty() - ) - } + } + + bindingset[name] + private TypeAlias getResolvedAlias(string name) { + result = resolved.(TraitItemNode).getAssocItem(name) + } + + bindingset[name] + private TypeAlias getResolvedTraitAssocType(string name) { + result = resolved.(TraitItemNode).getASuccessor(name) + } + + /** Gets the type mention in this path for the type parameter `tp`, if any. */ + pragma[nomagic] + private TypeMention getTypeMentionImplForTypeParameter(TypeParameter tp) { + exists(TypeAlias alias, string name | + result = this.getAssocTypeArg(name) and + tp = TAssociatedTypeTypeParameter(resolved, alias) and + alias = this.getResolvedTraitAssocType(name) + ) + or + // If `path` is the trait of an `impl` block then any associated types + // defined in the `impl` block are type arguments to the trait. + // + // For instance, for a trait implementation like this + // ```rust + // impl MyTrait for MyType { + // ^^^^^^^ path + // type AssociatedType = i64 + // ^^^ result + // // ... + // } + // ``` + // the rhs. of the type alias is a type argument to the trait. + exists(ImplItemNode impl, TypeAlias alias, string name | + this = impl.getTraitPath() and + alias = impl.getASuccessor(name) and + result = alias.getTypeRepr() and + tp = TAssociatedTypeTypeParameter(resolved, this.getResolvedAlias(name)) + ) + } - bindingset[name] - private TypeAlias getResolvedAlias(string name) { - result = resolved.(TraitItemNode).getAssocItem(name) - } + pragma[nomagic] + private Type resolveRootType() { + result = TDataType(resolved) + or + exists(TraitItemNode trait | trait = resolved | + // If this is a `Self` path, then it resolves to the implicit `Self` + // type parameter, otherwise it is a trait bound. + if this = trait.getASelfPath() + then result = TSelfTypeParameter(trait) + else result = TTrait(trait) + ) + or + result = TTypeParamTypeParameter(resolved) + or + // Handles paths of the form `Self::AssocType` within a trait block + result = TAssociatedTypeTypeParameter(resolvePath(this.getQualifier()), resolved) + } - bindingset[name] - private TypeAlias getResolvedTraitAssocType(string name) { - result = resolved.(TraitItemNode).getASuccessor(name) + override Type resolvePathTypeAt(TypePath typePath) { + typePath.isEmpty() and + result = this.resolveRootType() + or + exists(TypeParameter tp, TypePath suffix | typePath = TypePath::cons(tp, suffix) | + result = this.getTypeForTypeParameterAt(tp, suffix) + or + result = this.getTypeMentionImplForTypeParameter(tp).getTypeAt(suffix) + ) + or + // When the path refers to a trait, then the implicit `Self` type parameter + // should be instantiated from the context. + exists(TypePath suffix | + result = this.getSelfTraitBoundArg().getTypeAt(suffix) and + typePath = TypePath::cons(TSelfTypeParameter(resolved), suffix) + ) + or + not this.getSegment().hasTraitTypeRepr() and + result = this.getSegment().getTypeRepr().(TypeMention).getTypeAt(typePath) + } } - /** Gets the type mention in this path for the type parameter `tp`, if any. */ pragma[nomagic] - private TypeMention getTypeMentionForTypeParameter(TypeParameter tp) { - exists(TypeAlias alias, string name | - result = this.getAssocTypeArg(name) and - tp = TAssociatedTypeTypeParameter(resolved, alias) and - alias = this.getResolvedTraitAssocType(name) - ) - or - // If `path` is the trait of an `impl` block then any associated types - // defined in the `impl` block are type arguments to the trait. - // - // For instance, for a trait implementation like this - // ```rust - // impl MyTrait for MyType { - // ^^^^^^^ path - // type AssociatedType = i64 - // ^^^ result - // // ... - // } - // ``` - // the rhs. of the type alias is a type argument to the trait. - exists(ImplItemNode impl, TypeAlias alias, string name | - this = impl.getTraitPath() and - alias = impl.getASuccessor(name) and - result = alias.getTypeRepr() and - tp = TAssociatedTypeTypeParameter(resolved, this.getResolvedAlias(name)) - ) + Type resolveImplSelfTypeAt(Impl i, TypePath path) { + result = i.getSelfTy().(TypeMention).getTypeAt(path) } - pragma[nomagic] - private Type resolveRootType() { - result = TDataType(resolved) - or - exists(TraitItemNode trait | trait = resolved | - // If this is a `Self` path, then it resolves to the implicit `Self` - // type parameter, otherwise it is a trait bound. - if this = trait.getASelfPath() - then result = TSelfTypeParameter(trait) - else result = TTrait(trait) - ) - or - result = TTypeParamTypeParameter(resolved) - or - result = TAssociatedTypeTypeParameter(resolvePath(this.getQualifier()), resolved) - } + class ImplSelfMention extends PathTypeMention { + private ImplItemNode impl; - override Type resolvePathTypeAt(TypePath typePath) { - typePath.isEmpty() and - result = this.resolveRootType() - or - exists(TypeParameter tp, TypePath suffix | typePath = TypePath::cons(tp, suffix) | - result = this.getTypeForTypeParameterAt(tp, suffix) - or - result = this.getTypeMentionForTypeParameter(tp).getTypeAt(suffix) - ) - or - // When the path refers to a trait, then the implicit `Self` type parameter - // should be instantiated from the context. - exists(TypePath suffix | - result = this.getSelfTraitBoundArg().getTypeAt(suffix) and - typePath = TypePath::cons(TSelfTypeParameter(resolved), suffix) - ) - or - not this.getSegment().hasTraitTypeRepr() and - result = this.getSegment().getTypeRepr().(TypeMention).getTypeAt(typePath) - } -} + ImplSelfMention() { this = impl.getASelfPath() } -pragma[nomagic] -Type resolveImplSelfTypeAt(Impl i, TypePath path) { - result = i.getSelfTy().(TypeMention).getTypeAt(path) -} + override Type resolvePathTypeAt(TypePath typePath) { + result = resolveImplSelfTypeAt(impl, typePath) + } + } -class ImplSelfMention extends PathTypeMention { - private ImplItemNode impl; + class PathTypeReprMention extends TypeMentionImpl, PathTypeRepr { + private PathTypeMention path; - ImplSelfMention() { this = impl.getASelfPath() } + PathTypeReprMention() { path = this.getPath() } - override Type resolvePathTypeAt(TypePath typePath) { - result = resolveImplSelfTypeAt(impl, typePath) + override Type getTypeAt(TypePath typePath) { result = path.getTypeAt(typePath) } } -} -class PathTypeReprMention extends TypeMention, PathTypeRepr { - private PathTypeMention path; + class ImplTraitTypeReprMention extends TypeMentionImpl instanceof ImplTraitTypeRepr { + override Type getTypeAt(TypePath typePath) { + typePath.isEmpty() and + result.(ImplTraitType).getImplTraitTypeRepr() = this + or + exists(ImplTraitTypeParameter tp | + this = tp.getImplTraitTypeRepr() and + typePath = TypePath::singleton(tp) and + result = TTypeParamTypeParameter(tp.getTypeParam()) + ) + } + } - PathTypeReprMention() { path = this.getPath() } + private TypeParameter pathGetTypeParameter(TypeAlias alias, int i) { + result = TTypeParamTypeParameter(alias.getGenericParamList().getTypeParam(i)) + } - override Type getTypeAt(TypePath typePath) { result = path.getTypeAt(typePath) } -} + // Used to represent implicit `Self` type arguments in traits and `impl` blocks, + // see `PathMention` for details. + class TypeParamMention extends TypeMentionImpl instanceof TypeParam { + override Type getTypeAt(TypePath typePath) { + typePath.isEmpty() and + result = TTypeParamTypeParameter(this) + } + } -class ImplTraitTypeReprMention extends TypeMention instanceof ImplTraitTypeRepr { - override Type getTypeAt(TypePath typePath) { - typePath.isEmpty() and - result.(ImplTraitType).getImplTraitTypeRepr() = this - or - exists(ImplTraitTypeParameter tp | - this = tp.getImplTraitTypeRepr() and - typePath = TypePath::singleton(tp) and - result = TTypeParamTypeParameter(tp.getTypeParam()) - ) + class TraitMention extends TypeMentionImpl instanceof TraitItemNode { + override Type getTypeAt(TypePath typePath) { + typePath.isEmpty() and + result = TTrait(this) + or + // The implicit `Self` type parameter occurs at the `Self` type parameter + // position. + typePath = TypePath::singleton(TSelfTypeParameter(this)) and + result = TSelfTypeParameter(this) + or + exists(TypeAlias alias | + typePath = TypePath::singleton(result) and + result = TAssociatedTypeTypeParameter(this, alias) + ) + or + exists(TypeParam tp | + tp = super.getTypeParam(_) and + typePath = TypePath::singleton(result) and + result = TTypeParamTypeParameter(tp) + ) + } } -} -private TypeParameter pathGetTypeParameter(TypeAlias alias, int i) { - result = TTypeParamTypeParameter(alias.getGenericParamList().getTypeParam(i)) -} + // NOTE: Since the implicit type parameter for the self type parameter never + // appears in the AST, we (somewhat arbitrarily) choose the name of a trait as a + // type mention. This works because there is a one-to-one correspondence between + // a trait and its name. + class SelfTypeParameterMention extends TypeMentionImpl instanceof Name { + Trait trait; -// Used to represent implicit `Self` type arguments in traits and `impl` blocks, -// see `PathMention` for details. -class TypeParamMention extends TypeMention instanceof TypeParam { - override Type getTypeAt(TypePath typePath) { - typePath.isEmpty() and - result = TTypeParamTypeParameter(this) + SelfTypeParameterMention() { trait.getName() = this } + + Trait getTrait() { result = trait } + + override Type getTypeAt(TypePath typePath) { + typePath.isEmpty() and + result = TSelfTypeParameter(trait) + } } -} -class TraitMention extends TypeMention instanceof TraitItemNode { - override Type getTypeAt(TypePath typePath) { - typePath.isEmpty() and - result = TTrait(this) - or - // The implicit `Self` type parameter occurs at the `Self` type parameter - // position. - typePath = TypePath::singleton(TSelfTypeParameter(this)) and - result = TSelfTypeParameter(this) - or - exists(TypeAlias alias | - typePath = TypePath::singleton(result) and - result = TAssociatedTypeTypeParameter(this, alias) - ) + /** + * Gets the type at `path` of the type being implemented in `i`, when + * `i` is an `impl` block, or the synthetic `Self` type parameter when + * `i` is a trait. + */ + pragma[nomagic] + Type resolveImplOrTraitType(ImplOrTraitItemNode i, TypePath path) { + result = resolveImplSelfTypeAt(i, path) or - exists(TypeParam tp | - tp = super.getTypeParam(_) and - typePath = TypePath::singleton(result) and - result = TTypeParamTypeParameter(tp) - ) + result = TSelfTypeParameter(i) and path.isEmpty() } -} - -// NOTE: Since the implicit type parameter for the self type parameter never -// appears in the AST, we (somewhat arbitrarily) choose the name of a trait as a -// type mention. This works because there is a one-to-one correspondence between -// a trait and its name. -class SelfTypeParameterMention extends TypeMention instanceof Name { - Trait trait; - - SelfTypeParameterMention() { trait.getName() = this } - Trait getTrait() { result = trait } - - override Type getTypeAt(TypePath typePath) { - typePath.isEmpty() and - result = TSelfTypeParameter(trait) + pragma[nomagic] + private ImplOrTraitItemNode getSelfParamEnclosingImplOrTrait(SelfParam self) { + self = result.getAnAssocItem().(Function).getSelfParam() } -} -/** - * Gets the type at `path` of the type being implemented in `i`, when - * `i` is an `impl` block, or the synthetic `Self` type parameter when - * `i` is a trait. - */ -pragma[nomagic] -Type resolveImplOrTraitType(ImplOrTraitItemNode i, TypePath path) { - result = resolveImplSelfTypeAt(i, path) - or - result = TSelfTypeParameter(i) and path.isEmpty() -} + /** + * An element used to represent the type of a `self` parameter that uses [shorthand + * syntax][1], which is sugar for an explicit annotation. + * + * [1]: https://doc.rust-lang.org/stable/reference/items/associated-items.html#r-associated.fn.method.self-pat-shorthands + */ + class ShorthandSelfParameterMention extends TypeMentionImpl instanceof SelfParam { + private ImplOrTraitItemNode encl; -pragma[nomagic] -private ImplOrTraitItemNode getSelfParamEnclosingImplOrTrait(SelfParam self) { - self = result.getAnAssocItem().(Function).getSelfParam() -} + ShorthandSelfParameterMention() { + not super.hasTypeRepr() and + encl = getSelfParamEnclosingImplOrTrait(this) and + ( + not encl instanceof Impl + or + // avoid generating a type mention if the type being implemented does not have a type mention + encl.(Impl).getSelfTy() instanceof TypeMentionImpl + ) + } -/** - * An element used to represent the type of a `self` parameter that uses [shorthand - * syntax][1], which is sugar for an explicit annotation. - * - * [1]: https://doc.rust-lang.org/stable/reference/items/associated-items.html#r-associated.fn.method.self-pat-shorthands - */ -class ShorthandSelfParameterMention extends TypeMention instanceof SelfParam { - private ImplOrTraitItemNode encl; - - ShorthandSelfParameterMention() { - not super.hasTypeRepr() and - encl = getSelfParamEnclosingImplOrTrait(this) and - ( - not encl instanceof Impl - or - // avoid generating a type mention if the type being implemented does not have a type mention - encl.(Impl).getSelfTy() instanceof TypeMention - ) - } + private Type resolveSelfType(TypePath path) { result = resolveImplOrTraitType(encl, path) } - private Type resolveSelfType(TypePath path) { result = resolveImplOrTraitType(encl, path) } + private RefType resolveSelfRefRootType() { + super.isRef() and + if super.isMut() then result instanceof RefMutType else result instanceof RefSharedType + } - private RefType resolveSelfRefRootType() { - super.isRef() and - if super.isMut() then result instanceof RefMutType else result instanceof RefSharedType + override Type getTypeAt(TypePath typePath) { + // `fn f(&self, ...)` + typePath.isEmpty() and + result = this.resolveSelfRefRootType() + or + exists(TypePath suffix | + result = this.resolveSelfType(suffix) and + typePath = + TypePath::cons(this.resolveSelfRefRootType().getPositionalTypeParameter(0), suffix) + ) + or + // `fn f(self, ...)` + not super.isRef() and + result = this.resolveSelfType(typePath) + } } - override Type getTypeAt(TypePath typePath) { - // `fn f(&self, ...)` - typePath.isEmpty() and - result = this.resolveSelfRefRootType() - or - exists(TypePath suffix | - result = this.resolveSelfType(suffix) and - typePath = TypePath::cons(this.resolveSelfRefRootType().getPositionalTypeParameter(0), suffix) - ) + pragma[nomagic] + TypeMention getSelfParamTypeMention(SelfParam self) { + result = self.(ShorthandSelfParameterMention) or - // `fn f(self, ...)` - not super.isRef() and - result = this.resolveSelfType(typePath) + result = self.getTypeRepr() } -} -pragma[nomagic] -TypeMention getSelfParamTypeMention(SelfParam self) { - result = self.(ShorthandSelfParameterMention) - or - result = self.getTypeRepr() -} + /** + * An element used to represent the implicit `()` return type of a function. + * + * Since the implicit type does not appear in the AST, we (somewhat arbitrarily) + * choose the name of the function as a type mention. This works because there + * is a one-to-one correspondence between a function and its name. + */ + class ShorthandReturnTypeMention extends TypeMentionImpl instanceof Name { + private Function f; -/** - * An element used to represent the implicit `()` return type of a function. - * - * Since the implicit type does not appear in the AST, we (somewhat arbitrarily) - * choose the name of the function as a type mention. This works because there - * is a one-to-one correspondence between a function and its name. - */ -class ShorthandReturnTypeMention extends TypeMention instanceof Name { - private Function f; + ShorthandReturnTypeMention() { + this = f.getName() and + not f.getRetType().hasTypeRepr() + } - ShorthandReturnTypeMention() { - this = f.getName() and - not f.getRetType().hasTypeRepr() + override Type getTypeAt(TypePath typePath) { + typePath.isEmpty() and + result instanceof UnitType + } } - override Type getTypeAt(TypePath typePath) { - typePath.isEmpty() and - result instanceof UnitType + pragma[nomagic] + TypeMention getReturnTypeMention(Function f) { + result.(ShorthandReturnTypeMention) = f.getName() + or + result = f.getRetType().getTypeRepr() } -} -pragma[nomagic] -TypeMention getReturnTypeMention(Function f) { - result.(ShorthandReturnTypeMention) = f.getName() - or - result = f.getRetType().getTypeRepr() -} + class DynTraitTypeReprMention extends TypeMentionImpl instanceof DynTraitTypeRepr { + private DynTraitType dynType; -class DynTraitTypeReprMention extends TypeMention instanceof DynTraitTypeRepr { - private DynTraitType dynType; + DynTraitTypeReprMention() { + // This excludes `DynTraitTypeRepr` elements where `getTrait` is not + // defined, i.e., where path resolution can't find a trait. + dynType.getTrait() = super.getTrait() + } - DynTraitTypeReprMention() { - // This excludes `DynTraitTypeRepr` elements where `getTrait` is not - // defined, i.e., where path resolution can't find a trait. - dynType.getTrait() = super.getTrait() - } + override Type getTypeAt(TypePath path) { + path.isEmpty() and + result = dynType + or + exists(DynTraitTypeParameter tp, TypePath path0, TypePath suffix | + dynType = tp.getDynTraitType() and + path = TypePath::cons(tp, suffix) and + result = super.getTypeBoundList().getBound(0).getTypeRepr().(TypeMention).getTypeAt(path0) and + path0.isCons(tp.getTraitTypeParameter(), suffix) + ) + } + } + + // We want a type of the form `dyn Trait` to implement `Trait`. If `Trait` has + // type parameters then `dyn Trait` has equivalent type parameters and the + // implementation should be abstracted over them. + // + // Intuitively we want something to the effect of: + // ``` + // impl Trait for (dyn Trait) + // ``` + // To achieve this: + // - `DynTypeAbstraction` is an abstraction over the type parameters of the trait. + // - `DynTypeBoundListMention` (this class) is a type mention which has `dyn + // Trait` at the root and which for every type parameter of `dyn Trait` has the + // corresponding type parameter of the trait. + // - `TraitMention` (which is used for other things as well) is a type mention + // for the trait applied to its own type parameters. + // + // We arbitrarily use the `TypeBoundList` inside `DynTraitTypeRepr` to encode + // this type mention, since it doesn't syntactically appear in the AST. This + // works because there is a one-to-one correspondence between a trait object and + // its list of type bounds. + class DynTypeBoundListMention extends TypeMentionImpl instanceof TypeBoundList { + private Trait trait; + + DynTypeBoundListMention() { + exists(DynTraitTypeRepr dyn | + // We only need this type mention when the `dyn Trait` is a type + // abstraction, that is, when it's "canonical" and used in + // `conditionSatisfiesConstraint`. + dyn instanceof DynTypeAbstraction and + this = dyn.getTypeBoundList() and + trait = dyn.getTrait() + ) + } - override Type getTypeAt(TypePath path) { - path.isEmpty() and - result = dynType - or - exists(DynTraitTypeParameter tp, TypePath path0, TypePath suffix | - dynType = tp.getDynTraitType() and - path = TypePath::cons(tp, suffix) and - result = super.getTypeBoundList().getBound(0).getTypeRepr().(TypeMention).getTypeAt(path0) and - path0.isCons(tp.getTraitTypeParameter(), suffix) - ) + override Type getTypeAt(TypePath path) { + path.isEmpty() and + result.(DynTraitType).getTrait() = trait + or + exists(DynTraitTypeParameter tp | + trait = tp.getTrait() and + path = TypePath::singleton(tp) and + result = tp.getTraitTypeParameter() + ) + } } -} -// We want a type of the form `dyn Trait` to implement `Trait`. If `Trait` has -// type parameters then `dyn Trait` has equivalent type parameters and the -// implementation should be abstracted over them. -// -// Intuitively we want something to the effect of: -// ``` -// impl Trait for (dyn Trait) -// ``` -// To achieve this: -// - `DynTypeAbstraction` is an abstraction over the type parameters of the trait. -// - `DynTypeBoundListMention` (this class) is a type mention which has `dyn -// Trait` at the root and which for every type parameter of `dyn Trait` has the -// corresponding type parameter of the trait. -// - `TraitMention` (which is used for other things as well) is a type mention -// for the trait applied to its own type parameters. -// -// We arbitrarily use the `TypeBoundList` inside `DynTraitTypeRepr` to encode -// this type mention, since it doesn't syntactically appear in the AST. This -// works because there is a one-to-one correspondence between a trait object and -// its list of type bounds. -class DynTypeBoundListMention extends TypeMention instanceof TypeBoundList { - private Trait trait; - - DynTypeBoundListMention() { - exists(DynTraitTypeRepr dyn | - // We only need this type mention when the `dyn Trait` is a type - // abstraction, that is, when it's "canonical" and used in - // `conditionSatisfiesConstraint`. - dyn instanceof DynTypeAbstraction and - this = dyn.getTypeBoundList() and - trait = dyn.getTrait() - ) + class NeverTypeReprMention extends TypeMentionImpl, NeverTypeRepr { + override Type getTypeAt(TypePath path) { result = TNeverType() and path.isEmpty() } } - override Type getTypeAt(TypePath path) { - path.isEmpty() and - result.(DynTraitType).getTrait() = trait - or - exists(DynTraitTypeParameter tp | - trait = tp.getTrait() and - path = TypePath::singleton(tp) and - result = tp.getTraitTypeParameter() - ) + class PtrTypeReprMention extends TypeMentionImpl instanceof PtrTypeRepr { + private PtrType resolveRootType() { + super.isConst() and result instanceof PtrConstType + or + super.isMut() and result instanceof PtrMutType + } + + override Type getTypeAt(TypePath path) { + path.isEmpty() and result = this.resolveRootType() + or + exists(TypePath suffix | + result = super.getTypeRepr().(TypeMention).getTypeAt(suffix) and + path = TypePath::cons(this.resolveRootType().getPositionalTypeParameter(0), suffix) + ) + } } } -class NeverTypeReprMention extends TypeMention, NeverTypeRepr { - override Type getTypeAt(TypePath path) { result = TNeverType() and path.isEmpty() } -} +private Type preGetAdditionalPathTypeAt(Path p, TypePath typePath) { none() } -class PtrTypeReprMention extends TypeMention instanceof PtrTypeRepr { - private PtrType resolveRootType() { - super.isConst() and result instanceof PtrConstType - or - super.isMut() and result instanceof PtrMutType - } +private module PreTypeMention = MkTypeMention; - override Type getTypeAt(TypePath path) { - path.isEmpty() and result = this.resolveRootType() +class PreTypeMention = PreTypeMention::TypeMention; + +/** + * Holds if `path` accesses an associated type `alias` from `trait` on a + * concrete type given by `tm`. + */ +predicate pathConcreteTypeAssocType(Path path, PreTypeMention tm, Trait trait, TypeAlias alias) { + exists(Path qualifier | + qualifier = path.getQualifier() and + not resolvePath(tm.(PathTypeRepr).getPath()) instanceof TypeParam + | + // path of the form `::AssocType` + // ^^^ tm ^^^^^^^^^ name + exists(string name | + name = path.getSegment().getIdentifier().getText() and + tm = qualifier.getSegment().getTypeRepr() and + trait = resolvePath(qualifier.getSegment().getTraitTypeRepr().getPath()) and + trait.(TraitItemNode).getAssocItem(name) = alias + ) or - exists(TypePath suffix | - result = super.getTypeRepr().(TypeMention).getTypeAt(suffix) and - path = TypePath::cons(this.resolveRootType().getPositionalTypeParameter(0), suffix) + // path of the form `Self::AssocType` within an `impl` block + // tm ^^^^ ^^^^^^^^^ name + exists(ImplItemNode impl | + alias = resolvePath(path) and + qualifier = impl.getASelfPath() and + tm = impl.(Impl).getSelfTy() and + trait.(TraitItemNode).getAnAssocItem() = alias ) + ) +} + +private module PathSatisfiesConstraint implements SatisfiesConstraintInputSig { + predicate relevantConstraint(PreTypeMention tm, Type constraint) { + pathConcreteTypeAssocType(_, tm, constraint.(TraitType).getTrait(), _) } } + +/** + * Gets the type of `path` at `typePath` when `path` accesses an associated type + * on a concrete type. + */ +private Type getPathConcreteAssocTypeAt(Path path, TypePath typePath) { + exists(PreTypeMention tm, TraitItemNode t, TypeAlias alias, TypePath path0 | + pathConcreteTypeAssocType(path, tm, t, alias) and + SatisfiesConstraint::satisfiesConstraintType(tm, + TTrait(t), path0, result) and + path0.isCons(TAssociatedTypeTypeParameter(t, alias), typePath) + ) +} + +import MkTypeMention diff --git a/rust/ql/test/library-tests/type-inference/associated_types.rs b/rust/ql/test/library-tests/type-inference/associated_types.rs index 332b1d554171..54006d0b3b5c 100644 --- a/rust/ql/test/library-tests/type-inference/associated_types.rs +++ b/rust/ql/test/library-tests/type-inference/associated_types.rs @@ -146,10 +146,10 @@ mod concrete_type_access_associated_type { c: as GetSet>::Output, d: as GetSet>::Output, ) { - let _a = a; // $ MISSING: type=_a:S3 - let _b = b; // $ MISSING: type=_b:i32 - let _c = c; // $ MISSING: type=_c:bool - let _d = d; // $ MISSING: type=_d:char + let _a = a; // $ type=_a:S3 + let _b = b; // $ type=_b:i32 + let _c = c; // $ type=_c:bool + let _d = d; // $ type=_d:char } // NOTE: The below seems like it should work, but is currently rejected by @@ -171,24 +171,24 @@ mod concrete_type_access_associated_type { impl Odd { // Odd::proj fn proj(&self) -> ::Output { - let x = Default::default(); // $ MISSING: target=default - x // $ MISSING: type=x:bool + let x = Default::default(); // $ target=default + x // $ type=x:bool } } impl Odd { // Odd::proj fn proj(&self) -> ::Output { - let x = Default::default(); // $ MISSING: target=default - x // $ MISSING: type=x:char + let x = Default::default(); // $ target=default + x // $ type=x:char } } pub fn test() { using_as(S3, 1, true, 'a'); // $ target=using_as - let _a = Odd(42i32).proj(); // $ target=Odd::proj MISSING: type=_a:bool - let _b = Odd(true).proj(); // $ target=Odd::proj MISSING: type=_b:char + let _a = Odd(42i32).proj(); // $ target=Odd::proj type=_a:bool + let _b = Odd(true).proj(); // $ target=Odd::proj type=_b:char } } @@ -266,7 +266,7 @@ mod equality_on_associated_type { T: GetSet, { let _a = x.get(); // $ type=_a:i32 target=GetSet::get - let _b = x.get2(); // $ target=AssocNameClash::get2 MISSING: type=_b:char + let _b = x.get2(); // $ target=AssocNameClash::get2 type=_b:char } } @@ -390,14 +390,14 @@ mod associated_type_in_supertrait { // Odd::get_content fn get_content(&self) -> Self::Output { // let _x = Self::get(self); - Default::default() // $ MISSING: target=default + Default::default() // $ target=default } } impl Subtrait for Odd { // Odd::get_content fn get_content(&self) -> Self::Output { - Default::default() // $ MISSING: target=default + Default::default() // $ target=default } } @@ -412,13 +412,13 @@ mod associated_type_in_supertrait { pub fn test() { let item1 = MyType(42i64); - let _content1 = item1.get_content(); // $ target=MyType::get_content MISSING: type=_content1:i64 + let _content1 = item1.get_content(); // $ target=MyType::get_content type=_content1:i64 let item2 = MyType(true); let _content2 = get_content(&item2); // $ target=get_content MISSING: type=_content2:bool - let _content3 = Odd(42i32).get_content(); // $ target=Odd::get_content MISSING: type=_content3:bool - let _content4 = Odd(true).get_content(); // $ target=Odd::get_content MISSING: type=_content4:char + let _content3 = Odd(42i32).get_content(); // $ target=Odd::get_content type=_content3:bool + let _content4 = Odd(true).get_content(); // $ target=Odd::get_content type=_content4:char } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 80ee3a2b1d54..bf56e3770214 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -68,13 +68,27 @@ inferCertainType | associated_types.rs:136:18:136:23 | "{:?}\\n" | TRef | {EXTERNAL LOCATION} | str | | associated_types.rs:136:18:136:32 | ...::_print(...) | | {EXTERNAL LOCATION} | () | | associated_types.rs:136:18:136:32 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:144:9:144:9 | a | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:145:9:145:9 | b | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:146:9:146:9 | c | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:147:9:147:9 | d | | {EXTERNAL LOCATION} | char | | associated_types.rs:148:7:153:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:149:13:149:14 | _a | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:149:18:149:18 | a | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:150:13:150:14 | _b | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:150:18:150:18 | b | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:151:13:151:14 | _c | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:151:18:151:18 | c | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:152:13:152:14 | _d | | {EXTERNAL LOCATION} | char | +| associated_types.rs:152:18:152:18 | d | | {EXTERNAL LOCATION} | char | | associated_types.rs:173:17:173:21 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:173:17:173:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:173:17:173:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:173:52:176:9 | { ... } | | {EXTERNAL LOCATION} | bool | | associated_types.rs:181:17:181:21 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:181:17:181:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:181:17:181:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:181:52:184:9 | { ... } | | {EXTERNAL LOCATION} | char | | associated_types.rs:187:19:192:5 | { ... } | | {EXTERNAL LOCATION} | () | | associated_types.rs:188:9:188:34 | using_as(...) | | {EXTERNAL LOCATION} | () | | associated_types.rs:188:25:188:28 | true | | {EXTERNAL LOCATION} | bool | @@ -186,15 +200,18 @@ inferCertainType | associated_types.rs:384:24:384:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:384:24:384:28 | SelfParam | TRef | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:384:24:384:28 | SelfParam | TRef.T | associated_types.rs:382:10:382:16 | T | +| associated_types.rs:384:47:386:9 | { ... } | | associated_types.rs:382:10:382:16 | T | | associated_types.rs:385:15:385:18 | self | | {EXTERNAL LOCATION} | & | | associated_types.rs:385:15:385:18 | self | TRef | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:385:15:385:18 | self | TRef.T | associated_types.rs:382:10:382:16 | T | | associated_types.rs:391:24:391:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:391:24:391:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:391:24:391:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | bool | | associated_types.rs:399:24:399:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:399:24:399:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:399:24:399:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | char | | associated_types.rs:404:33:404:36 | item | | {EXTERNAL LOCATION} | & | | associated_types.rs:404:33:404:36 | item | TRef | associated_types.rs:404:20:404:30 | T | | associated_types.rs:405:9:405:12 | item | | {EXTERNAL LOCATION} | & | @@ -4828,24 +4845,48 @@ inferType | associated_types.rs:136:26:136:27 | x6 | | associated_types.rs:13:1:14:10 | S2 | | associated_types.rs:136:26:136:32 | x6.m2() | | associated_types.rs:1:1:2:21 | Wrapper | | associated_types.rs:136:26:136:32 | x6.m2() | A | associated_types.rs:13:1:14:10 | S2 | +| associated_types.rs:144:9:144:9 | a | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:145:9:145:9 | b | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:146:9:146:9 | c | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:147:9:147:9 | d | | {EXTERNAL LOCATION} | char | | associated_types.rs:148:7:153:5 | { ... } | | {EXTERNAL LOCATION} | () | +| associated_types.rs:149:13:149:14 | _a | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:149:18:149:18 | a | | associated_types.rs:16:1:17:10 | S3 | +| associated_types.rs:150:13:150:14 | _b | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:150:18:150:18 | b | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:151:13:151:14 | _c | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:151:18:151:18 | c | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:152:13:152:14 | _d | | {EXTERNAL LOCATION} | char | +| associated_types.rs:152:18:152:18 | d | | {EXTERNAL LOCATION} | char | | associated_types.rs:173:17:173:21 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:173:17:173:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:173:17:173:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:173:52:176:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:174:17:174:17 | x | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:174:21:174:38 | ...::default(...) | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:175:13:175:13 | x | | {EXTERNAL LOCATION} | bool | | associated_types.rs:181:17:181:21 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:181:17:181:21 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:181:17:181:21 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:181:52:184:9 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:182:17:182:17 | x | | {EXTERNAL LOCATION} | char | +| associated_types.rs:182:21:182:38 | ...::default(...) | | {EXTERNAL LOCATION} | char | +| associated_types.rs:183:13:183:13 | x | | {EXTERNAL LOCATION} | char | | associated_types.rs:187:19:192:5 | { ... } | | {EXTERNAL LOCATION} | () | | associated_types.rs:188:9:188:34 | using_as(...) | | {EXTERNAL LOCATION} | () | | associated_types.rs:188:18:188:19 | S3 | | associated_types.rs:16:1:17:10 | S3 | | associated_types.rs:188:22:188:22 | 1 | | {EXTERNAL LOCATION} | i32 | | associated_types.rs:188:25:188:28 | true | | {EXTERNAL LOCATION} | bool | | associated_types.rs:188:31:188:33 | 'a' | | {EXTERNAL LOCATION} | char | +| associated_types.rs:190:13:190:14 | _a | | {EXTERNAL LOCATION} | bool | | associated_types.rs:190:18:190:27 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:190:18:190:27 | Odd(...) | OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:190:18:190:34 | ... .proj() | | {EXTERNAL LOCATION} | bool | | associated_types.rs:190:22:190:26 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:191:13:191:14 | _b | | {EXTERNAL LOCATION} | char | | associated_types.rs:191:18:191:26 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:191:18:191:26 | Odd(...) | OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:191:18:191:33 | ... .proj() | | {EXTERNAL LOCATION} | char | | associated_types.rs:191:22:191:25 | true | | {EXTERNAL LOCATION} | bool | | associated_types.rs:199:30:199:34 | thing | | associated_types.rs:199:19:199:27 | T | | associated_types.rs:200:9:200:13 | thing | | associated_types.rs:199:19:199:27 | T | @@ -4900,7 +4941,9 @@ inferType | associated_types.rs:268:13:268:14 | _a | | {EXTERNAL LOCATION} | i32 | | associated_types.rs:268:18:268:18 | x | | associated_types.rs:263:31:263:31 | T | | associated_types.rs:268:18:268:24 | x.get() | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:269:13:269:14 | _b | | {EXTERNAL LOCATION} | char | | associated_types.rs:269:18:269:18 | x | | associated_types.rs:263:31:263:31 | T | +| associated_types.rs:269:18:269:25 | x.get2() | | {EXTERNAL LOCATION} | char | | associated_types.rs:280:19:280:23 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:280:19:280:23 | SelfParam | TRef | associated_types.rs:276:5:287:5 | Self [trait MyTraitAssoc2] | | associated_types.rs:280:26:280:26 | a | | associated_types.rs:280:16:280:16 | A | @@ -5016,9 +5059,13 @@ inferType | associated_types.rs:391:24:391:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:391:24:391:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:391:24:391:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:391:47:394:9 | { ... } | | {EXTERNAL LOCATION} | bool | +| associated_types.rs:393:13:393:30 | ...::default(...) | | {EXTERNAL LOCATION} | bool | | associated_types.rs:399:24:399:28 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:399:24:399:28 | SelfParam | TRef | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:399:24:399:28 | SelfParam | TRef.OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:399:47:401:9 | { ... } | | {EXTERNAL LOCATION} | char | +| associated_types.rs:400:13:400:30 | ...::default(...) | | {EXTERNAL LOCATION} | char | | associated_types.rs:404:33:404:36 | item | | {EXTERNAL LOCATION} | & | | associated_types.rs:404:33:404:36 | item | TRef | associated_types.rs:404:20:404:30 | T | | associated_types.rs:405:9:405:12 | item | | {EXTERNAL LOCATION} | & | @@ -5038,8 +5085,10 @@ inferType | associated_types.rs:414:21:414:33 | MyType(...) | | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:414:21:414:33 | MyType(...) | T | {EXTERNAL LOCATION} | i64 | | associated_types.rs:414:28:414:32 | 42i64 | | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:415:13:415:21 | _content1 | | {EXTERNAL LOCATION} | i64 | | associated_types.rs:415:25:415:29 | item1 | | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:415:25:415:29 | item1 | T | {EXTERNAL LOCATION} | i64 | +| associated_types.rs:415:25:415:43 | item1.get_content() | | {EXTERNAL LOCATION} | i64 | | associated_types.rs:417:13:417:17 | item2 | | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:417:13:417:17 | item2 | T | {EXTERNAL LOCATION} | bool | | associated_types.rs:417:21:417:32 | MyType(...) | | associated_types.rs:368:5:368:24 | MyType | @@ -5050,11 +5099,15 @@ inferType | associated_types.rs:418:37:418:42 | &item2 | TRef.T | {EXTERNAL LOCATION} | bool | | associated_types.rs:418:38:418:42 | item2 | | associated_types.rs:368:5:368:24 | MyType | | associated_types.rs:418:38:418:42 | item2 | T | {EXTERNAL LOCATION} | bool | +| associated_types.rs:420:13:420:21 | _content3 | | {EXTERNAL LOCATION} | bool | | associated_types.rs:420:25:420:34 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:420:25:420:34 | Odd(...) | OddT | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:420:25:420:48 | ... .get_content() | | {EXTERNAL LOCATION} | bool | | associated_types.rs:420:29:420:33 | 42i32 | | {EXTERNAL LOCATION} | i32 | +| associated_types.rs:421:13:421:21 | _content4 | | {EXTERNAL LOCATION} | char | | associated_types.rs:421:25:421:33 | Odd(...) | | associated_types.rs:67:1:67:23 | Odd | | associated_types.rs:421:25:421:33 | Odd(...) | OddT | {EXTERNAL LOCATION} | bool | +| associated_types.rs:421:25:421:47 | ... .get_content() | | {EXTERNAL LOCATION} | char | | associated_types.rs:421:29:421:32 | true | | {EXTERNAL LOCATION} | bool | | associated_types.rs:435:16:435:20 | SelfParam | | {EXTERNAL LOCATION} | & | | associated_types.rs:435:16:435:20 | SelfParam | TRef | associated_types.rs:428:5:428:20 | ST | From 4dcb7c185e309829b9d315e92f9b628f094ddef0 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 26 Jan 2026 17:01:15 +0100 Subject: [PATCH 5/5] WIP FIX --- .../codeql/rust/internal/typeinference/TypeInference.qll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll index 4170874df5d6..fb0743357d64 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll @@ -1960,7 +1960,7 @@ private module MethodResolution { pragma[nomagic] predicate hasTypeQualifiedCandidate(ImplItemNode impl) { exists(getCallExprTypeQualifier(this, _)) and - CallExprImpl::getResolvedFunction(this) = impl.getASuccessor(_) + CallExprImpl::getResolvedFunction(this) = impl.getADescendant() } pragma[nomagic] @@ -4133,8 +4133,8 @@ private module Debug { Locatable getRelevantLocatable() { exists(string filepath, int startline, int startcolumn, int endline, int endcolumn | result.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and - filepath.matches("%/sqlx.rs") and - startline = [56 .. 60] + filepath.matches("%/main.rs") and + startline = [607 .. 609] ) }