File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
rust/ql/test/library-tests/type-inference Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -3213,6 +3213,14 @@ pub mod pattern_matching {
3213
3213
}
3214
3214
}
3215
3215
3216
+ mod closures {
3217
+ pub fn f ( ) {
3218
+ Some ( 1 ) . map ( |x| {
3219
+ let x = x; // $ MISSING: type=x:i32
3220
+ println ! ( "{x}" ) ;
3221
+ } ) ; // $ method=map
3222
+ }
3223
+ }
3216
3224
fn main ( ) {
3217
3225
field_access:: f ( ) ; // $ method=f
3218
3226
method_impl:: f ( ) ; // $ method=f
@@ -3242,4 +3250,5 @@ fn main() {
3242
3250
tuples:: f ( ) ; // $ method=f
3243
3251
dereference:: test ( ) ; // $ method=test
3244
3252
pattern_matching:: test_all_patterns ( ) ; // $ method=test_all_patterns
3253
+ closures:: f ( ) // $ method=f
3245
3254
}
Original file line number Diff line number Diff line change @@ -5396,9 +5396,17 @@ inferType
5396
5396
| main.rs:3186:42:3186:48 | guard_x | | {EXTERNAL LOCATION} | i32 |
5397
5397
| main.rs:3188:13:3188:13 | _ | | {EXTERNAL LOCATION} | i32 |
5398
5398
| main.rs:3193:9:3193:11 | f(...) | | {EXTERNAL LOCATION} | Option |
5399
- | main.rs:3218:5:3218:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo |
5400
- | main.rs:3219:5:3219:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo |
5401
- | main.rs:3219:20:3219:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
5402
- | main.rs:3219:41:3219:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
5403
- | main.rs:3235:5:3235:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
5399
+ | main.rs:3218:9:3218:15 | Some(...) | | {EXTERNAL LOCATION} | Option |
5400
+ | main.rs:3218:9:3218:15 | Some(...) | T | {EXTERNAL LOCATION} | i32 |
5401
+ | main.rs:3218:9:3221:10 | ... .map(...) | | {EXTERNAL LOCATION} | Option |
5402
+ | main.rs:3218:14:3218:14 | 1 | | {EXTERNAL LOCATION} | i32 |
5403
+ | main.rs:3220:22:3220:26 | "{x}\\n" | | file://:0:0:0:0 | & |
5404
+ | main.rs:3220:22:3220:26 | "{x}\\n" | &T | {EXTERNAL LOCATION} | str |
5405
+ | main.rs:3220:22:3220:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
5406
+ | main.rs:3220:22:3220:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
5407
+ | main.rs:3226:5:3226:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo |
5408
+ | main.rs:3227:5:3227:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo |
5409
+ | main.rs:3227:20:3227:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
5410
+ | main.rs:3227:41:3227:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
5411
+ | main.rs:3243:5:3243:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
5404
5412
testFailures
You can’t perform that action at this time.
0 commit comments