Skip to content

Commit 7ef418b

Browse files
Make ArchIndependentHasher publicly visible.
1 parent c52836c commit 7ef418b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/librustc/ty/util.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -392,25 +392,25 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
392392
}
393393
}
394394

395-
// When hashing a type this ends up affecting properties like symbol names. We
396-
// want these symbol names to be calculated independent of other factors like
397-
// what architecture you're compiling *from*.
398-
//
399-
// The hashing just uses the standard `Hash` trait, but the implementations of
400-
// `Hash` for the `usize` and `isize` types are *not* architecture independent
401-
// (e.g. they has 4 or 8 bytes). As a result we want to avoid `usize` and
402-
// `isize` completely when hashing. To ensure that these don't leak in we use a
403-
// custom hasher implementation here which inflates the size of these to a `u64`
404-
// and `i64`.
405-
//
406-
// The same goes for endianess: We always convert multi-byte integers to little
407-
// endian before hashing.
408-
struct ArchIndependentHasher<H> {
395+
/// When hashing a type this ends up affecting properties like symbol names. We
396+
/// want these symbol names to be calculated independent of other factors like
397+
/// what architecture you're compiling *from*.
398+
///
399+
/// The hashing just uses the standard `Hash` trait, but the implementations of
400+
/// `Hash` for the `usize` and `isize` types are *not* architecture independent
401+
/// (e.g. they has 4 or 8 bytes). As a result we want to avoid `usize` and
402+
/// `isize` completely when hashing. To ensure that these don't leak in we use a
403+
/// custom hasher implementation here which inflates the size of these to a `u64`
404+
/// and `i64`.
405+
///
406+
/// The same goes for endianess: We always convert multi-byte integers to little
407+
/// endian before hashing.
408+
pub struct ArchIndependentHasher<H> {
409409
inner: H,
410410
}
411411

412412
impl<H> ArchIndependentHasher<H> {
413-
fn new(inner: H) -> ArchIndependentHasher<H> {
413+
pub fn new(inner: H) -> ArchIndependentHasher<H> {
414414
ArchIndependentHasher { inner: inner }
415415
}
416416
}

0 commit comments

Comments
 (0)