@@ -63,8 +63,8 @@ macro_rules! define_impl {
63
63
slice: & mut [ $elemty] ,
64
64
offset: usize ,
65
65
) {
66
- use std :: mem:: size_of;
67
- use std :: ptr;
66
+ use core :: mem:: size_of;
67
+ use core :: ptr;
68
68
69
69
ptr:: copy_nonoverlapping(
70
70
& self as * const $name as * const u8 ,
@@ -83,8 +83,8 @@ macro_rules! define_impl {
83
83
slice: & [ $elemty] ,
84
84
offset: usize ,
85
85
) -> $name {
86
- use std :: mem:: size_of;
87
- use std :: ptr;
86
+ use core :: mem:: size_of;
87
+ use core :: ptr;
88
88
89
89
let mut x = $name:: splat( 0 as $elemty) ;
90
90
ptr:: copy_nonoverlapping(
@@ -133,7 +133,7 @@ macro_rules! define_from {
133
133
impl From <$from> for $to {
134
134
#[ inline( always) ]
135
135
fn from( f: $from) -> $to {
136
- unsafe { :: std :: mem:: transmute( f) }
136
+ unsafe { :: core :: mem:: transmute( f) }
137
137
}
138
138
}
139
139
) +
@@ -143,75 +143,75 @@ macro_rules! define_from {
143
143
macro_rules! define_common_ops {
144
144
( $( $ty: ident) ,+) => {
145
145
$(
146
- impl :: std :: ops:: Add for $ty {
146
+ impl :: core :: ops:: Add for $ty {
147
147
type Output = Self ;
148
148
#[ inline( always) ]
149
149
fn add( self , other: Self ) -> Self {
150
150
unsafe { simd_add( self , other) }
151
151
}
152
152
}
153
153
154
- impl :: std :: ops:: Sub for $ty {
154
+ impl :: core :: ops:: Sub for $ty {
155
155
type Output = Self ;
156
156
#[ inline( always) ]
157
157
fn sub( self , other: Self ) -> Self {
158
158
unsafe { simd_sub( self , other) }
159
159
}
160
160
}
161
161
162
- impl :: std :: ops:: Mul for $ty {
162
+ impl :: core :: ops:: Mul for $ty {
163
163
type Output = Self ;
164
164
#[ inline( always) ]
165
165
fn mul( self , other: Self ) -> Self {
166
166
unsafe { simd_mul( self , other) }
167
167
}
168
168
}
169
169
170
- impl :: std :: ops:: Div for $ty {
170
+ impl :: core :: ops:: Div for $ty {
171
171
type Output = Self ;
172
172
#[ inline( always) ]
173
173
fn div( self , other: Self ) -> Self {
174
174
unsafe { simd_div( self , other) }
175
175
}
176
176
}
177
177
178
- impl :: std :: ops:: Rem for $ty {
178
+ impl :: core :: ops:: Rem for $ty {
179
179
type Output = Self ;
180
180
#[ inline( always) ]
181
181
fn rem( self , other: Self ) -> Self {
182
182
unsafe { simd_rem( self , other) }
183
183
}
184
184
}
185
185
186
- impl :: std :: ops:: AddAssign for $ty {
186
+ impl :: core :: ops:: AddAssign for $ty {
187
187
#[ inline( always) ]
188
188
fn add_assign( & mut self , other: Self ) {
189
189
* self = * self + other;
190
190
}
191
191
}
192
192
193
- impl :: std :: ops:: SubAssign for $ty {
193
+ impl :: core :: ops:: SubAssign for $ty {
194
194
#[ inline( always) ]
195
195
fn sub_assign( & mut self , other: Self ) {
196
196
* self = * self - other;
197
197
}
198
198
}
199
199
200
- impl :: std :: ops:: MulAssign for $ty {
200
+ impl :: core :: ops:: MulAssign for $ty {
201
201
#[ inline( always) ]
202
202
fn mul_assign( & mut self , other: Self ) {
203
203
* self = * self * other;
204
204
}
205
205
}
206
206
207
- impl :: std :: ops:: DivAssign for $ty {
207
+ impl :: core :: ops:: DivAssign for $ty {
208
208
#[ inline( always) ]
209
209
fn div_assign( & mut self , other: Self ) {
210
210
* self = * self / other;
211
211
}
212
212
}
213
213
214
- impl :: std :: ops:: RemAssign for $ty {
214
+ impl :: core :: ops:: RemAssign for $ty {
215
215
#[ inline( always) ]
216
216
fn rem_assign( & mut self , other: Self ) {
217
217
* self = * self % other;
@@ -225,28 +225,28 @@ macro_rules! define_common_ops {
225
225
macro_rules! define_shifts {
226
226
( $ty: ident, $elem: ident, $( $by: ident) ,+) => {
227
227
$(
228
- impl :: std :: ops:: Shl <$by> for $ty {
228
+ impl :: core :: ops:: Shl <$by> for $ty {
229
229
type Output = Self ;
230
230
#[ inline( always) ]
231
231
fn shl( self , other: $by) -> Self {
232
232
unsafe { simd_shl( self , $ty:: splat( other as $elem) ) }
233
233
}
234
234
}
235
- impl :: std :: ops:: Shr <$by> for $ty {
235
+ impl :: core :: ops:: Shr <$by> for $ty {
236
236
type Output = Self ;
237
237
#[ inline( always) ]
238
238
fn shr( self , other: $by) -> Self {
239
239
unsafe { simd_shr( self , $ty:: splat( other as $elem) ) }
240
240
}
241
241
}
242
242
243
- impl :: std :: ops:: ShlAssign <$by> for $ty {
243
+ impl :: core :: ops:: ShlAssign <$by> for $ty {
244
244
#[ inline( always) ]
245
245
fn shl_assign( & mut self , other: $by) {
246
246
* self = * self << other;
247
247
}
248
248
}
249
- impl :: std :: ops:: ShrAssign <$by> for $ty {
249
+ impl :: core :: ops:: ShrAssign <$by> for $ty {
250
250
#[ inline( always) ]
251
251
fn shr_assign( & mut self , other: $by) {
252
252
* self = * self >> other;
@@ -260,7 +260,7 @@ macro_rules! define_shifts {
260
260
macro_rules! define_float_ops {
261
261
( $( $ty: ident) ,+) => {
262
262
$(
263
- impl :: std :: ops:: Neg for $ty {
263
+ impl :: core :: ops:: Neg for $ty {
264
264
type Output = Self ;
265
265
#[ inline( always) ]
266
266
fn neg( self ) -> Self {
@@ -274,7 +274,7 @@ macro_rules! define_float_ops {
274
274
macro_rules! define_signed_integer_ops {
275
275
( $( $ty: ident) ,+) => {
276
276
$(
277
- impl :: std :: ops:: Neg for $ty {
277
+ impl :: core :: ops:: Neg for $ty {
278
278
type Output = Self ;
279
279
#[ inline( always) ]
280
280
fn neg( self ) -> Self {
@@ -288,48 +288,48 @@ macro_rules! define_signed_integer_ops {
288
288
macro_rules! define_integer_ops {
289
289
( $( ( $ty: ident, $elem: ident) ) ,+) => {
290
290
$(
291
- impl :: std :: ops:: Not for $ty {
291
+ impl :: core :: ops:: Not for $ty {
292
292
type Output = Self ;
293
293
#[ inline( always) ]
294
294
fn not( self ) -> Self {
295
295
$ty:: splat( !0 ) ^ self
296
296
}
297
297
}
298
298
299
- impl :: std :: ops:: BitAnd for $ty {
299
+ impl :: core :: ops:: BitAnd for $ty {
300
300
type Output = Self ;
301
301
#[ inline( always) ]
302
302
fn bitand( self , other: Self ) -> Self {
303
303
unsafe { simd_and( self , other) }
304
304
}
305
305
}
306
- impl :: std :: ops:: BitOr for $ty {
306
+ impl :: core :: ops:: BitOr for $ty {
307
307
type Output = Self ;
308
308
#[ inline( always) ]
309
309
fn bitor( self , other: Self ) -> Self {
310
310
unsafe { simd_or( self , other) }
311
311
}
312
312
}
313
- impl :: std :: ops:: BitXor for $ty {
313
+ impl :: core :: ops:: BitXor for $ty {
314
314
type Output = Self ;
315
315
#[ inline( always) ]
316
316
fn bitxor( self , other: Self ) -> Self {
317
317
unsafe { simd_xor( self , other) }
318
318
}
319
319
}
320
- impl :: std :: ops:: BitAndAssign for $ty {
320
+ impl :: core :: ops:: BitAndAssign for $ty {
321
321
#[ inline( always) ]
322
322
fn bitand_assign( & mut self , other: Self ) {
323
323
* self = * self & other;
324
324
}
325
325
}
326
- impl :: std :: ops:: BitOrAssign for $ty {
326
+ impl :: core :: ops:: BitOrAssign for $ty {
327
327
#[ inline( always) ]
328
328
fn bitor_assign( & mut self , other: Self ) {
329
329
* self = * self | other;
330
330
}
331
331
}
332
- impl :: std :: ops:: BitXorAssign for $ty {
332
+ impl :: core :: ops:: BitXorAssign for $ty {
333
333
#[ inline( always) ]
334
334
fn bitxor_assign( & mut self , other: Self ) {
335
335
* self = * self ^ other;
@@ -341,12 +341,12 @@ macro_rules! define_integer_ops {
341
341
u8 , u16 , u32 , u64 , usize ,
342
342
i8 , i16 , i32 , i64 , isize ) ;
343
343
344
- impl :: std :: fmt:: LowerHex for $ty {
345
- fn fmt( & self , f: & mut :: std :: fmt:: Formatter )
346
- -> :: std :: fmt:: Result {
344
+ impl :: core :: fmt:: LowerHex for $ty {
345
+ fn fmt( & self , f: & mut :: core :: fmt:: Formatter )
346
+ -> :: core :: fmt:: Result {
347
347
write!( f, "{}(" , stringify!( $ty) ) ?;
348
- let n = :: std :: mem:: size_of_val( self )
349
- / :: std :: mem:: size_of:: <$elem>( ) ;
348
+ let n = :: core :: mem:: size_of_val( self )
349
+ / :: core :: mem:: size_of:: <$elem>( ) ;
350
350
for i in 0 ..n {
351
351
if i > 0 {
352
352
write!( f, ", " ) ?;
0 commit comments