@@ -120,9 +120,9 @@ macro_rules! forward_ref_unop {
120
120
}
121
121
}
122
122
123
- // implements the binary operator "&T op U"
124
- // based on "T + U" where T and U are expected `Copy`able
125
- macro_rules! forward_ref_val_binop {
123
+ // implements binary operators "&T op U", "T op &U", "&T op & U"
124
+ // based on "T op U" where T and U are expected to be `Copy`able
125
+ macro_rules! forward_ref_binop {
126
126
( impl $imp: ident, $method: ident for $t: ty, $u: ty) => {
127
127
#[ unstable]
128
128
impl <' a> $imp<$u> for & ' a $t {
@@ -133,13 +133,7 @@ macro_rules! forward_ref_val_binop {
133
133
$imp:: $method( * self , other)
134
134
}
135
135
}
136
- }
137
- }
138
136
139
- // implements the binary operator "T op &U"
140
- // based on "T + U" where T and U are expected `Copy`able
141
- macro_rules! forward_val_ref_binop {
142
- ( impl $imp: ident, $method: ident for $t: ty, $u: ty) => {
143
137
#[ unstable]
144
138
impl <' a> $imp<& ' a $u> for $t {
145
139
type Output = <$t as $imp<$u>>:: Output ;
@@ -149,13 +143,7 @@ macro_rules! forward_val_ref_binop {
149
143
$imp:: $method( self , * other)
150
144
}
151
145
}
152
- }
153
- }
154
146
155
- // implements the binary operator "&T op &U"
156
- // based on "T + U" where T and U are expected `Copy`able
157
- macro_rules! forward_ref_ref_binop {
158
- ( impl $imp: ident, $method: ident for $t: ty, $u: ty) => {
159
147
#[ unstable]
160
148
impl <' a, ' b> $imp<& ' a $u> for & ' b $t {
161
149
type Output = <$t as $imp<$u>>:: Output ;
@@ -168,16 +156,6 @@ macro_rules! forward_ref_ref_binop {
168
156
}
169
157
}
170
158
171
- // implements binary operators "&T op U", "T op &U", "&T op &U"
172
- // based on "T + U" where T and U are expected `Copy`able
173
- macro_rules! forward_ref_binop {
174
- ( impl $imp: ident, $method: ident for $t: ty, $u: ty) => {
175
- forward_ref_val_binop! { impl $imp, $method for $t, $u }
176
- forward_val_ref_binop! { impl $imp, $method for $t, $u }
177
- forward_ref_ref_binop! { impl $imp, $method for $t, $u }
178
- }
179
- }
180
-
181
159
/// The `Add` trait is used to specify the functionality of `+`.
182
160
///
183
161
/// # Example
0 commit comments