Refactor & improve handling of overloaded binary operators

Fixes #9971. Also records them as method resolutions, which we could use
later.
This commit is contained in:
Florian Diebold 2021-08-22 17:21:47 +02:00
parent c8fd4fd410
commit 424dda8113
11 changed files with 317 additions and 261 deletions

View file

@ -34,6 +34,7 @@
//! derive:
//! fmt: result
//! bool_impl: option, fn
//! add:
pub mod marker {
// region:sized
@ -302,6 +303,14 @@ pub mod ops {
}
pub use self::try_::{ControlFlow, FromResidual, Try};
// endregion:try
// region:add
#[lang = "add"]
pub trait Add<Rhs = Self> {
type Output;
fn add(self, rhs: Rhs) -> Self::Output;
}
// endregion:add
}
// region:eq