File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed
rust/ql/test/library-tests/type-inference Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -1224,6 +1224,21 @@ mod builtins {
12241224 }
12251225}
12261226
1227+ mod operators {
1228+ pub fn f ( ) {
1229+ let x = true && false ; // $ MISSING: type=x:bool
1230+ let y = true || false ; // $ MISSING: type=y:bool
1231+
1232+ let mut a;
1233+ if 34 == 33 {
1234+ let z = ( a = 1 ) ; // $ MISSING: type=z:() MISSING: type=a:i32
1235+ } else {
1236+ a = 2 ; // $ MISSING: type=a:i32
1237+ }
1238+ a; // $ MISSING: type=a:i32
1239+ }
1240+ }
1241+
12271242fn main ( ) {
12281243 field_access:: f ( ) ;
12291244 method_impl:: f ( ) ;
@@ -1242,4 +1257,5 @@ fn main() {
12421257 borrowed_typed:: f ( ) ;
12431258 try_expressions:: f ( ) ;
12441259 builtins:: f ( ) ;
1260+ operators:: f ( ) ;
12451261}
Original file line number Diff line number Diff line change @@ -1581,7 +1581,15 @@ inferType
15811581| main.rs:1222:17:1222:20 | true | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
15821582| main.rs:1223:13:1223:13 | f | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
15831583| main.rs:1223:17:1223:21 | false | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
1584- | main.rs:1229:5:1229:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo |
1585- | main.rs:1230:5:1230:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo |
1586- | main.rs:1230:20:1230:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
1587- | main.rs:1230:41:1230:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
1584+ | main.rs:1229:17:1229:20 | true | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
1585+ | main.rs:1229:25:1229:29 | false | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
1586+ | main.rs:1230:17:1230:20 | true | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
1587+ | main.rs:1230:25:1230:29 | false | | file:///BUILTINS/types.rs:3:1:5:16 | bool |
1588+ | main.rs:1233:12:1233:13 | 34 | | file:///BUILTINS/types.rs:12:1:12:15 | i32 |
1589+ | main.rs:1233:18:1233:19 | 33 | | file:///BUILTINS/types.rs:12:1:12:15 | i32 |
1590+ | main.rs:1234:26:1234:26 | 1 | | file:///BUILTINS/types.rs:12:1:12:15 | i32 |
1591+ | main.rs:1236:17:1236:17 | 2 | | file:///BUILTINS/types.rs:12:1:12:15 | i32 |
1592+ | main.rs:1244:5:1244:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo |
1593+ | main.rs:1245:5:1245:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo |
1594+ | main.rs:1245:20:1245:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
1595+ | main.rs:1245:41:1245:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo |
You can’t perform that action at this time.
0 commit comments