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