leo_errors/errors/static_analyzer/
static_analyzer_warning.rs1use crate::create_messages;
18
19use std::fmt::Display;
20
21create_messages!(
22 #[derive(Hash, Eq, PartialEq)]
24 StaticAnalyzerWarning,
25 code_mask: 4000i32,
26 code_prefix: "SAZ",
27
28 @formatted
29 some_paths_do_not_await_all_futures {
30 args: (num_total_paths: impl Display, num_unawaited_paths: impl Display),
31 msg: format!("Not all paths through the function await all futures. {num_unawaited_paths}/{num_total_paths} paths contain at least one future that is never awaited."),
32 help: Some("Ex: `f.await()` to await a future. Remove this warning by including the `--disable-conditional-branch-type-checking` flag.".to_string()),
33 }
34
35 @formatted
36 some_paths_contain_duplicate_future_awaits {
37 args: (num_total_paths: impl Display, num_duplicate_await_paths: impl Display),
38 msg: format!("Some paths through the function contain duplicate future awaits. {num_duplicate_await_paths}/{num_total_paths} paths contain at least one future that is awaited more than once."),
39 help: Some("Look at the times `.await()` is called, and try to reduce redundancies. Remove this warning by including the `--disable-conditional-branch-type-checking` flag.".to_string()),
40 }
41
42 @formatted
43 max_conditional_block_depth_exceeded {
44 args: (max: impl Display),
45 msg: format!("The type checker has exceeded the max depth of nested conditional blocks: {max}."),
46 help: Some("Re-run with a larger maximum depth using the `--conditional_block_max_depth` build option. Ex: `leo run main --conditional_block_max_depth 25`.".to_string()),
47 }
48
49 @formatted
50 future_not_awaited_in_order {
51 args: (future_name: impl Display),
52 msg: format!("The future `{}` is not awaited in the order in which they were passed in to the `async` function.", future_name),
53 help: Some("While it is not required for futures to be awaited in order, there is some specific behavior that arises, which may affect the semantics of your program. See `https://github.com/AleoNet/snarkVM/issues/2570` for more context.".to_string()),
54 }
55);