use crate::create_messages;
use std::fmt::{Debug, Display};
create_messages!(
FlattenError,
code_mask: 3000i32,
code_prefix: "FLA",
@formatted
binary_overflow {
args: (left: impl Display, op: impl Display, right: impl Display, right_type: impl Display),
msg: format!("The const operation `{left}{} {op} {right}{right_type}` causes an overflow.", 0u32),
help: None,
}
// TODO: This error is unused.
@formatted
unary_overflow {
args: (left: impl Display, op: impl Display),
msg: format!("The const operation `{left}{} {op}` causes an overflow.", 0u32),
help: None,
}
/// For when a loop uses a negative value.
@formatted
loop_has_neg_value {
args: (value: impl Display),
msg: format!(
"The loop has a negative loop bound `{value}`.",
),
help: None,
}
/// For when a u128 value cannot be converted into an i128.
@formatted
u128_to_i128 {
args: (value: impl Display),
msg: format!(
"The value `{value}` cannot be converted into an i128.",
),
help: None,
}
);