Skip to content

Commit 4530e85

Browse files
committed
Rust: Repair the test annotations.
1 parent 8c848ac commit 4530e85

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,23 +1914,23 @@ mod loops {
19141914
for s in &mut strings1 {} // $ MISSING: type=s:&T.str
19151915
for s in strings1 {} // $ type=s:str
19161916

1917-
let strings2 = [
1917+
let strings2 = [ // $ type=strings2:[T;...].String
19181918
String::from("foo"),
19191919
String::from("bar"),
19201920
String::from("baz"),
1921-
]; // $ type=strings2:[T;...].String
1921+
];
19221922
for s in strings2 {} // $ type=s:String
19231923

1924-
let strings3 = &[
1924+
let strings3 = &[ // $ type=strings3:&T.[T;...].String
19251925
String::from("foo"),
19261926
String::from("bar"),
19271927
String::from("baz"),
1928-
]; // $ type=strings3:&T.[T;...].String
1928+
];
19291929
for s in strings3 {} // $ MISSING: type=s:String
19301930

19311931
let callables = [MyCallable::new(), MyCallable::new(), MyCallable::new()]; // $ MISSING: type=callables:[T;...].MyCallable; 3
1932-
for c in callables {
1933-
// $ type=c:MyCallable
1932+
for c in callables // $ type=c:MyCallable
1933+
{
19341934
let result = c.call(); // $ type=result:i64 method=call
19351935
}
19361936

@@ -1941,10 +1941,10 @@ mod loops {
19411941
let range = 0..10; // $ MISSING: type=range:Range type=range:Idx.i32
19421942
for i in range {} // $ MISSING: type=i:i32
19431943

1944-
let range1 = std::ops::Range {
1944+
let range1 = std::ops::Range { // $ type=range1:Range type=range1:Idx.u16
19451945
start: 0u16,
19461946
end: 10u16,
1947-
}; // $ type=range1:Range type=range1:Idx.u16
1947+
};
19481948
for u in range1 {} // $ MISSING: type=u:u16
19491949

19501950
// for loops with containers
@@ -1986,8 +1986,8 @@ mod loops {
19861986
// while loops
19871987

19881988
let mut a: i64 = 0; // $ type=a:i64
1989-
while a < 10 {
1990-
// $ method=lt type=a:i64
1989+
while a < 10 // $ method=lt type=a:i64
1990+
{
19911991
a += 1; // $ type=a:i64 method=add_assign
19921992
}
19931993
}

rust/ql/test/library-tests/type-inference/type-inference.expected

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,11 +3004,3 @@ inferType
30043004
| main.rs:1999:41:1999:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
30053005
| main.rs:2015:5:2015:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
30063006
testFailures
3007-
| main.rs:1921:12:1921:44 | //... | Missing result: type=strings2:[T;...].String |
3008-
| main.rs:1928:12:1928:47 | //... | Missing result: type=strings3:&T.[T;...].String |
3009-
| main.rs:1933:13:1933:34 | //... | Missing result: type=c:MyCallable |
3010-
| main.rs:1947:12:1947:53 | //... | Missing result: type=range1:Idx.u16 |
3011-
| main.rs:1947:12:1947:53 | //... | Missing result: type=range1:Range |
3012-
| main.rs:1989:15:1989:20 | ... < ... | Unexpected result: method=lt |
3013-
| main.rs:1990:13:1990:37 | //... | Missing result: method=lt |
3014-
| main.rs:1990:13:1990:37 | //... | Missing result: type=a:i64 |

0 commit comments

Comments
 (0)