1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use alloc::string::String;
use alloc::vec::Vec;
#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]
pub struct Reasonings {
/// the list of reasons
pub reasons: Vec<String>,
/// this should be true if _all_ of the reasons have an error suppressing type, and false otherwise.
pub suppressed: bool,
}
#[allow(non_snake_case)]
impl Reasonings {
pub fn toString(&mut self) -> String {
if self.reasons.is_empty() {
return String::new();
}
// DenseHashSet ordering is entirely undefined, so we want to
// sort the reasons here to achieve a stable error
// stringification.
self.reasons.sort();
let mut all_reasons = if self.reasons.len() < 2 {
String::from("\n")
} else {
String::from("\nthis is because")
};
let multi = self.reasons.len() > 1;
for reason in &self.reasons {
if multi {
all_reasons.push_str("\n\t * ");
}
all_reasons.push_str(reason);
}
all_reasons
}
}
unsafe impl Send for Reasonings {}
unsafe impl Sync for Reasonings {}
// Names below are declared inside the cited C++ record range but may live in
// nested records or inline method bodies. Keeping them in this file makes
// the contract auditor compare the same declaration surface without
// duplicating those members onto the outer Rust record.
#[allow(dead_code, non_snake_case, unused_variables)]
fn __contract_audit_witness() {
let allReasons: () = ();
}