File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -227,13 +227,13 @@ rustc_index::newtype_index! {
227
227
// We guarantee field order. Note that the order is essential here, see below why.
228
228
pub struct DefId {
229
229
// cfg-ing the order of fields so that the `DefIndex` which is high entropy always ends up in
230
- // the lower bits no matter the endianness. This allows the compiler to turn that `Hash` impl
230
+ // the higher bits no matter the endianness. This allows the compiler to turn that `Hash` impl
231
231
// into a direct call to `u64::hash(_)`.
232
232
#[ cfg( not( all( target_pointer_width = "64" , target_endian = "big" ) ) ) ]
233
- pub index : DefIndex ,
234
- pub krate : CrateNum ,
233
+ pub krate : DefIndex ,
234
+ pub index : CrateNum ,
235
235
#[ cfg( all( target_pointer_width = "64" , target_endian = "big" ) ) ]
236
- pub index : DefIndex ,
236
+ pub krate : DefIndex ,
237
237
}
238
238
239
239
// To ensure correctness of incremental compilation,
@@ -248,15 +248,15 @@ impl !PartialOrd for DefId {}
248
248
//
249
249
// ```
250
250
// +-1--------------31-+-32-------------63-+
251
- // ! index ! krate !
251
+ // ! krate ! index !
252
252
// +-------------------+-------------------+
253
253
// ```
254
254
//
255
255
// On 64-bit big-endian systems, this compiles to a 64-bit rotation by 32 bits, or a 64-bit load.
256
256
#[ cfg( target_pointer_width = "64" ) ]
257
257
impl Hash for DefId {
258
258
fn hash < H : Hasher > ( & self , h : & mut H ) {
259
- ( ( ( self . krate . as_u32 ( ) as u64 ) << 32 ) | ( self . index . as_u32 ( ) as u64 ) ) . hash ( h)
259
+ ( ( ( self . index . as_u32 ( ) as u64 ) << 32 ) | ( self . krate . as_u32 ( ) as u64 ) ) . hash ( h)
260
260
}
261
261
}
262
262
You can’t perform that action at this time.
0 commit comments