Skip to content

Commit 5b5074e

Browse files
committed
Rust: Add another type inference test
1 parent 55eb9fb commit 5b5074e

File tree

2 files changed

+1234
-1225
lines changed

2 files changed

+1234
-1225
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,11 @@ mod method_call_type_conversion {
11071107
// implicit dereference handling doesn't affect nested borrows.
11081108
let t = x7.m1(); // $ method=m1 type=t:& type=t:&T.S2
11091109
println!("{:?}", x7);
1110+
1111+
let x9 : String = "Hello".to_string(); // $ type=x9:String
1112+
// Implicit `String` -> `str` conversion happense via the `Deref` trait:
1113+
// https://doc.rust-lang.org/std/string/struct.String.html#deref.
1114+
let u = x9.parse::<u32>(); // $ MISSING: method=parse type=u:T.u32
11101115
}
11111116
}
11121117

0 commit comments

Comments
 (0)