use crate::prelude::*;
#[diagnostic::on_unimplemented(
message = "Cannot add `{Rhs}` to `{Self}` in logic",
label = "no implementation for `{Self} + {Rhs}` in logic"
)]
pub trait AddLogic<Rhs = Self> {
type Output;
#[logic]
#[requires(false)]
fn add_logic(self, other: Rhs) -> Self::Output;
}
#[diagnostic::on_unimplemented(
message = "Cannot subtract `{Rhs}` from `{Self}` in logic",
label = "no implementation for `{Self} - {Rhs}` in logic"
)]
pub trait SubLogic<Rhs = Self> {
type Output;
#[logic]
#[requires(false)]
fn sub_logic(self, other: Rhs) -> Self::Output;
}
#[diagnostic::on_unimplemented(
message = "Cannot multiply `{Self}` by `{Rhs}` in logic",
label = "no implementation for `{Self} * {Rhs}` in logic"
)]
pub trait MulLogic<Rhs = Self> {
type Output;
#[logic]
#[requires(false)]
fn mul_logic(self, other: Rhs) -> Self::Output;
}
#[diagnostic::on_unimplemented(
message = "Cannot divide `{Self}` by `{Rhs}` in logic",
label = "no implementation for `{Self} / {Rhs}` in logic"
)]
pub trait DivLogic<Rhs = Self> {
type Output;
#[logic]
#[requires(false)]
fn div_logic(self, other: Rhs) -> Self::Output;
}
#[diagnostic::on_unimplemented(
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}` in logic",
label = "no implementation for `{Self} % {Rhs}` in logic"
)]
pub trait RemLogic<Rhs = Self> {
type Output;
#[logic]
#[requires(false)]
fn rem_logic(self, other: Rhs) -> Self::Output;
}
#[diagnostic::on_unimplemented(
message = "cannot apply unary operator `-` to type `{Self}`",
label = "cannot apply unary operator `-` in logic"
)]
pub trait NegLogic {
type Output;
#[logic]
#[requires(false)]
fn neg_logic(self) -> Self::Output;
}