Skip to content

Commit d452696

Browse files
committed
Rust: Add test with fn trait syntax without return type
1 parent 636bbe3 commit d452696

File tree

2 files changed

+162
-150
lines changed

2 files changed

+162
-150
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ mod fn_once_trait {
3636
let _return = f(true); // $ type=_return:i64
3737
}
3838

39+
fn return_type_omitted<F: FnOnce(bool)>(f: F) {
40+
let _return = f(true); // $ MISSING: type=_return:()
41+
}
42+
3943
fn argument_type<F: FnOnce(bool) -> i64>(f: F) {
4044
let arg = Default::default(); // $ target=default type=arg:bool
4145
f(arg);

0 commit comments

Comments
 (0)