mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Add another type inference test
This commit is contained in:
@@ -2862,6 +2862,17 @@ mod block_types {
|
||||
fn f3() -> i32 {
|
||||
return 0;
|
||||
} // should only have type `i32`, not `()`
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn f4(cond: bool) -> i32 {
|
||||
let a = { // $ MISSING: certainType=a:()
|
||||
if cond {
|
||||
return 12;
|
||||
};
|
||||
};
|
||||
println!("a: {:?}", a);
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
mod blanket_impl;
|
||||
|
||||
@@ -6474,48 +6474,60 @@ inferType
|
||||
| main.rs:2859:9:2859:9 | 0 | | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2862:20:2864:5 | { ... } | | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2863:16:2863:16 | 0 | | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2872:11:2907:1 | { ... } | | file://:0:0:0:0 | () |
|
||||
| main.rs:2873:5:2873:21 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2874:5:2874:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2875:5:2875:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2875:20:2875:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2875:41:2875:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2876:5:2876:35 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2877:5:2877:41 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2878:5:2878:45 | ...::test(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2879:5:2879:30 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2880:5:2880:33 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2881:5:2881:21 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2882:5:2882:27 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2883:5:2883:32 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2884:5:2884:23 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2885:5:2885:36 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2886:5:2886:35 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2887:5:2887:29 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2888:5:2888:23 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2889:5:2889:24 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2890:5:2890:17 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2891:5:2891:18 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2892:5:2892:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
|
||||
| main.rs:2892:5:2892:15 | ...::f(...) | Output | file://:0:0:0:0 | () |
|
||||
| main.rs:2893:5:2893:19 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2894:5:2894:17 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2895:5:2895:14 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2896:5:2896:27 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2897:5:2897:15 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2898:5:2898:43 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2899:5:2899:15 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2900:5:2900:17 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2901:5:2901:23 | ...::test(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2902:5:2902:41 | ...::test_all_patterns(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2903:5:2903:49 | ...::box_patterns(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2904:5:2904:20 | ...::test(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2905:5:2905:20 | ...::f(...) | | {EXTERNAL LOCATION} | Box |
|
||||
| main.rs:2905:5:2905:20 | ...::f(...) | A | {EXTERNAL LOCATION} | Global |
|
||||
| main.rs:2905:5:2905:20 | ...::f(...) | T | main.rs:2787:5:2789:5 | dyn MyTrait |
|
||||
| main.rs:2905:5:2905:20 | ...::f(...) | T.dyn(T) | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2905:16:2905:19 | true | | {EXTERNAL LOCATION} | bool |
|
||||
| main.rs:2906:5:2906:23 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2867:11:2867:14 | cond | | {EXTERNAL LOCATION} | bool |
|
||||
| main.rs:2867:30:2875:5 | { ... } | | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2869:13:2871:13 | if cond {...} | | file://:0:0:0:0 | () |
|
||||
| main.rs:2869:16:2869:19 | cond | | {EXTERNAL LOCATION} | bool |
|
||||
| main.rs:2870:24:2870:25 | 12 | | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2873:18:2873:26 | "a: {:?}\\n" | | file://:0:0:0:0 | & |
|
||||
| main.rs:2873:18:2873:26 | "a: {:?}\\n" | &T | {EXTERNAL LOCATION} | str |
|
||||
| main.rs:2873:18:2873:29 | ...::_print(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2873:18:2873:29 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
|
||||
| main.rs:2873:18:2873:29 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
|
||||
| main.rs:2873:18:2873:29 | { ... } | | file://:0:0:0:0 | () |
|
||||
| main.rs:2874:9:2874:9 | 0 | | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2883:11:2918:1 | { ... } | | file://:0:0:0:0 | () |
|
||||
| main.rs:2884:5:2884:21 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2885:5:2885:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2886:5:2886:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2886:20:2886:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2886:41:2886:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
|
||||
| main.rs:2887:5:2887:35 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2888:5:2888:41 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2889:5:2889:45 | ...::test(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2890:5:2890:30 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2891:5:2891:33 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2892:5:2892:21 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2893:5:2893:27 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2894:5:2894:32 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2895:5:2895:23 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2896:5:2896:36 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2897:5:2897:35 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2898:5:2898:29 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2899:5:2899:23 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2900:5:2900:24 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2901:5:2901:17 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2902:5:2902:18 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2903:5:2903:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
|
||||
| main.rs:2903:5:2903:15 | ...::f(...) | Output | file://:0:0:0:0 | () |
|
||||
| main.rs:2904:5:2904:19 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2905:5:2905:17 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2906:5:2906:14 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2907:5:2907:27 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2908:5:2908:15 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2909:5:2909:43 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2910:5:2910:15 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2911:5:2911:17 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2912:5:2912:23 | ...::test(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2913:5:2913:41 | ...::test_all_patterns(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2914:5:2914:49 | ...::box_patterns(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2915:5:2915:20 | ...::test(...) | | file://:0:0:0:0 | () |
|
||||
| main.rs:2916:5:2916:20 | ...::f(...) | | {EXTERNAL LOCATION} | Box |
|
||||
| main.rs:2916:5:2916:20 | ...::f(...) | A | {EXTERNAL LOCATION} | Global |
|
||||
| main.rs:2916:5:2916:20 | ...::f(...) | T | main.rs:2787:5:2789:5 | dyn MyTrait |
|
||||
| main.rs:2916:5:2916:20 | ...::f(...) | T.dyn(T) | {EXTERNAL LOCATION} | i32 |
|
||||
| main.rs:2916:16:2916:19 | true | | {EXTERNAL LOCATION} | bool |
|
||||
| main.rs:2917:5:2917:23 | ...::f(...) | | file://:0:0:0:0 | () |
|
||||
| pattern_matching.rs:13:26:133:1 | { ... } | | {EXTERNAL LOCATION} | Option |
|
||||
| pattern_matching.rs:13:26:133:1 | { ... } | T | file://:0:0:0:0 | () |
|
||||
| pattern_matching.rs:14:9:14:13 | value | | {EXTERNAL LOCATION} | Option |
|
||||
|
||||
Reference in New Issue
Block a user