You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pretty.push_str(format!("\"index out of bounds: the length is {{}} but the index is {{}}\", {pretty_len}, {pretty_index}").as_str());
123
+
pretty
124
+
}
125
+
AssertMessage::Overflow(BinOp::Add, l, r) => {
126
+
let pretty_l = pretty_operand(l);
127
+
let pretty_r = pretty_operand(r);
128
+
pretty.push_str(format!("\"attempt to compute `{{}} + {{}}`, which would overflow\", {pretty_l}, {pretty_r}").as_str());
129
+
pretty
130
+
}
131
+
AssertMessage::Overflow(BinOp::Sub, l, r) => {
132
+
let pretty_l = pretty_operand(l);
133
+
let pretty_r = pretty_operand(r);
134
+
pretty.push_str(format!("\"attempt to compute `{{}} - {{}}`, which would overflow\", {pretty_l}, {pretty_r}").as_str());
135
+
pretty
136
+
}
137
+
AssertMessage::Overflow(BinOp::Mul, l, r) => {
138
+
let pretty_l = pretty_operand(l);
139
+
let pretty_r = pretty_operand(r);
140
+
pretty.push_str(format!("\"attempt to compute `{{}} * {{}}`, which would overflow\", {pretty_l}, {pretty_r}").as_str());
141
+
pretty
142
+
}
143
+
AssertMessage::Overflow(BinOp::Div, l, r) => {
144
+
let pretty_l = pretty_operand(l);
145
+
let pretty_r = pretty_operand(r);
146
+
pretty.push_str(format!("\"attempt to compute `{{}} / {{}}`, which would overflow\", {pretty_l}, {pretty_r}").as_str());
147
+
pretty
148
+
}
149
+
AssertMessage::Overflow(BinOp::Rem, l, r) => {
150
+
let pretty_l = pretty_operand(l);
151
+
let pretty_r = pretty_operand(r);
152
+
pretty.push_str(format!("\"attempt to compute `{{}} % {{}}`, which would overflow\", {pretty_l}, {pretty_r}").as_str());
153
+
pretty
154
+
}
155
+
AssertMessage::Overflow(BinOp::Shr, _, r) => {
156
+
let pretty_r = pretty_operand(r);
157
+
pretty.push_str(
158
+
format!("\"attempt to shift right by `{{}}`, which would overflow\", {pretty_r}")
159
+
.as_str(),
160
+
);
161
+
pretty
162
+
}
163
+
AssertMessage::Overflow(BinOp::Shl, _, r) => {
164
+
let pretty_r = pretty_operand(r);
165
+
pretty.push_str(
166
+
format!("\"attempt to shift left by `{{}}`, which would overflow\", {pretty_r}")
167
+
.as_str(),
168
+
);
169
+
pretty
170
+
}
171
+
AssertMessage::OverflowNeg(op) => {
172
+
let pretty_op = pretty_operand(op);
173
+
pretty.push_str(
174
+
format!("\"attempt to negate `{{}}`, which would overflow\", {pretty_op}").as_str(),
175
+
);
176
+
pretty
177
+
}
178
+
AssertMessage::DivisionByZero(op) => {
179
+
let pretty_op = pretty_operand(op);
180
+
pretty.push_str(format!("\"attempt to divide `{{}}` by zero\", {pretty_op}").as_str());
181
+
pretty
182
+
}
183
+
AssertMessage::RemainderByZero(op) => {
184
+
let pretty_op = pretty_operand(op);
185
+
pretty.push_str(
186
+
format!("\"attempt to calculate the remainder of `{{}}` with a divisor of zero\", {pretty_op}").as_str(),
187
+
);
188
+
pretty
189
+
}
190
+
AssertMessage::ResumedAfterReturn(_) => {
191
+
format!("attempt to resume a generator after completion")
192
+
}
193
+
AssertMessage::ResumedAfterPanic(_) => format!("attempt to resume a panicked generator"),
194
+
AssertMessage::MisalignedPointerDereference{ required, found } => {
195
+
let pretty_required = pretty_operand(required);
196
+
let pretty_found = pretty_operand(found);
197
+
pretty.push_str(format!("\"misaligned pointer dereference: address must be a multiple of {{}} but is {{}}\",{pretty_required}, {pretty_found}").as_str());
0 commit comments