File tree Expand file tree Collapse file tree 3 files changed +345
-84
lines changed
rust/ql/test/library-tests/type-inference Expand file tree Collapse file tree 3 files changed +345
-84
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,6 @@ multipleResolvedTargets
3030| main.rs:2642:13:2642:31 | ...::from(...) |
3131| main.rs:2643:13:2643:31 | ...::from(...) |
3232| main.rs:2644:13:2644:31 | ...::from(...) |
33+ | main.rs:3067:13:3067:17 | x.f() |
3334| pattern_matching.rs:273:13:273:27 | * ... |
3435| pattern_matching.rs:273:14:273:27 | * ... |
Original file line number Diff line number Diff line change @@ -3036,6 +3036,39 @@ mod context_typed {
30363036 }
30373037}
30383038
3039+ mod literal_overlap {
3040+ trait MyTrait {
3041+ fn f ( self ) -> Self ;
3042+ }
3043+
3044+ impl MyTrait for i32 {
3045+ // i32f
3046+ fn f ( self ) -> Self {
3047+ self
3048+ }
3049+ }
3050+
3051+ impl MyTrait for usize {
3052+ // usizef
3053+ fn f ( self ) -> Self {
3054+ self
3055+ }
3056+ }
3057+
3058+ impl < T > MyTrait for & T {
3059+ // Reff
3060+ fn f ( self ) -> Self {
3061+ self
3062+ }
3063+ }
3064+
3065+ pub fn f ( ) -> usize {
3066+ let mut x = 0 ;
3067+ x = x. f ( ) ; // $ target=usizef $ SPURIOUS: target=i32f target=Reff
3068+ x
3069+ }
3070+ }
3071+
30393072mod blanket_impl;
30403073mod closure;
30413074mod dereference;
You can’t perform that action at this time.
0 commit comments