Skip to content

Commit 61d809b

Browse files
committed
Rust: Add another type inference test
1 parent e587541 commit 61d809b

File tree

3 files changed

+364
-348
lines changed

3 files changed

+364
-348
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
multipleResolvedTargets
22
| main.rs:2223:9:2223:31 | ... .my_add(...) |
33
| main.rs:2225:9:2225:29 | ... .my_add(...) |
4-
| main.rs:2723:13:2723:17 | x.f() |
4+
| main.rs:2733:13:2733:17 | x.f() |

rust/ql/test/library-tests/type-inference/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,13 @@ mod block_types {
26362636
}
26372637

26382638
mod context_typed {
2639+
#[derive(Default)]
2640+
struct S;
2641+
2642+
impl S {
2643+
fn f(self) {}
2644+
}
2645+
26392646
pub fn f() {
26402647
let x = None; // $ type=x:T.i32
26412648
let x: Option<i32> = x;
@@ -2683,6 +2690,9 @@ mod context_typed {
26832690

26842691
let y = Default::default(); // $ type=y:i32 target=default
26852692
x.push(y); // $ target=push
2693+
2694+
let s = Default::default(); // $ MISSING: target=default type=s:S
2695+
S::f(s); // $ target=f
26862696
}
26872697
}
26882698

0 commit comments

Comments
 (0)