Rust: Repair the test annotations.

This commit is contained in:
Geoffrey White
2025-06-23 13:12:53 +01:00
parent 8c848ac019
commit 4530e85c93
2 changed files with 10 additions and 18 deletions

View File

@@ -1914,23 +1914,23 @@ mod loops {
for s in &mut strings1 {} // $ MISSING: type=s:&T.str
for s in strings1 {} // $ type=s:str
let strings2 = [
let strings2 = [ // $ type=strings2:[T;...].String
String::from("foo"),
String::from("bar"),
String::from("baz"),
]; // $ type=strings2:[T;...].String
];
for s in strings2 {} // $ type=s:String
let strings3 = &[
let strings3 = &[ // $ type=strings3:&T.[T;...].String
String::from("foo"),
String::from("bar"),
String::from("baz"),
]; // $ type=strings3:&T.[T;...].String
];
for s in strings3 {} // $ MISSING: type=s:String
let callables = [MyCallable::new(), MyCallable::new(), MyCallable::new()]; // $ MISSING: type=callables:[T;...].MyCallable; 3
for c in callables {
// $ type=c:MyCallable
for c in callables // $ type=c:MyCallable
{
let result = c.call(); // $ type=result:i64 method=call
}
@@ -1941,10 +1941,10 @@ mod loops {
let range = 0..10; // $ MISSING: type=range:Range type=range:Idx.i32
for i in range {} // $ MISSING: type=i:i32
let range1 = std::ops::Range {
let range1 = std::ops::Range { // $ type=range1:Range type=range1:Idx.u16
start: 0u16,
end: 10u16,
}; // $ type=range1:Range type=range1:Idx.u16
};
for u in range1 {} // $ MISSING: type=u:u16
// for loops with containers
@@ -1986,8 +1986,8 @@ mod loops {
// while loops
let mut a: i64 = 0; // $ type=a:i64
while a < 10 {
// $ method=lt type=a:i64
while a < 10 // $ method=lt type=a:i64
{
a += 1; // $ type=a:i64 method=add_assign
}
}

View File

@@ -3004,11 +3004,3 @@ inferType
| main.rs:1999:41:1999:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
| main.rs:2015:5:2015:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
testFailures
| main.rs:1921:12:1921:44 | //... | Missing result: type=strings2:[T;...].String |
| main.rs:1928:12:1928:47 | //... | Missing result: type=strings3:&T.[T;...].String |
| main.rs:1933:13:1933:34 | //... | Missing result: type=c:MyCallable |
| main.rs:1947:12:1947:53 | //... | Missing result: type=range1:Idx.u16 |
| main.rs:1947:12:1947:53 | //... | Missing result: type=range1:Range |
| main.rs:1989:15:1989:20 | ... < ... | Unexpected result: method=lt |
| main.rs:1990:13:1990:37 | //... | Missing result: method=lt |
| main.rs:1990:13:1990:37 | //... | Missing result: type=a:i64 |