@@ -18,20 +18,17 @@ use triomphe::Arc;
1818pub mod symbols;
1919
2020// some asserts for layout compatibility
21- const _: ( ) = assert ! ( std :: mem :: size_of:: <Box <str >>( ) == std :: mem :: size_of:: <& str >( ) ) ;
22- const _: ( ) = assert ! ( std :: mem :: align_of:: <Box <str >>( ) == std :: mem :: align_of:: <& str >( ) ) ;
21+ const _: ( ) = assert ! ( size_of:: <Box <str >>( ) == size_of:: <& str >( ) ) ;
22+ const _: ( ) = assert ! ( align_of:: <Box <str >>( ) == align_of:: <& str >( ) ) ;
2323
24- const _: ( ) = assert ! ( std :: mem :: size_of:: <Arc <Box <str >>>( ) == std :: mem :: size_of:: <&&str >( ) ) ;
25- const _: ( ) = assert ! ( std :: mem :: align_of:: <Arc <Box <str >>>( ) == std :: mem :: align_of:: <&&str >( ) ) ;
24+ const _: ( ) = assert ! ( size_of:: <Arc <Box <str >>>( ) == size_of:: <&&str >( ) ) ;
25+ const _: ( ) = assert ! ( align_of:: <Arc <Box <str >>>( ) == align_of:: <&&str >( ) ) ;
2626
27- const _: ( ) =
28- assert ! ( std:: mem:: size_of:: <* const * const str >( ) == std:: mem:: size_of:: <TaggedArcPtr >( ) ) ;
29- const _: ( ) =
30- assert ! ( std:: mem:: align_of:: <* const * const str >( ) == std:: mem:: align_of:: <TaggedArcPtr >( ) ) ;
27+ const _: ( ) = assert ! ( size_of:: <* const * const str >( ) == size_of:: <TaggedArcPtr >( ) ) ;
28+ const _: ( ) = assert ! ( align_of:: <* const * const str >( ) == align_of:: <TaggedArcPtr >( ) ) ;
3129
32- const _: ( ) = assert ! ( std:: mem:: size_of:: <Arc <Box <str >>>( ) == std:: mem:: size_of:: <TaggedArcPtr >( ) ) ;
33- const _: ( ) =
34- assert ! ( std:: mem:: align_of:: <Arc <Box <str >>>( ) == std:: mem:: align_of:: <TaggedArcPtr >( ) ) ;
30+ const _: ( ) = assert ! ( size_of:: <Arc <Box <str >>>( ) == size_of:: <TaggedArcPtr >( ) ) ;
31+ const _: ( ) = assert ! ( align_of:: <Arc <Box <str >>>( ) == align_of:: <TaggedArcPtr >( ) ) ;
3532
3633/// A pointer that points to a pointer to a `str`, it may be backed as a `&'static &'static str` or
3734/// `Arc<Box<str>>` but its size is that of a thin pointer. The active variant is encoded as a tag
@@ -49,9 +46,7 @@ impl TaggedArcPtr {
4946 const BOOL_BITS : usize = true as usize ;
5047
5148 const fn non_arc ( r : & ' static & ' static str ) -> Self {
52- assert ! (
53- mem:: align_of:: <& ' static & ' static str >( ) . trailing_zeros( ) as usize > Self :: BOOL_BITS
54- ) ;
49+ assert ! ( align_of:: <& ' static & ' static str >( ) . trailing_zeros( ) as usize > Self :: BOOL_BITS ) ;
5550 // SAFETY: The pointer is non-null as it is derived from a reference
5651 // Ideally we would call out to `pack_arc` but for a `false` tag, unfortunately the
5752 // packing stuff requires reading out the pointer to an integer which is not supported
@@ -64,9 +59,7 @@ impl TaggedArcPtr {
6459 }
6560
6661 fn arc ( arc : Arc < Box < str > > ) -> Self {
67- assert ! (
68- mem:: align_of:: <& ' static & ' static str >( ) . trailing_zeros( ) as usize > Self :: BOOL_BITS
69- ) ;
62+ assert ! ( align_of:: <& ' static & ' static str >( ) . trailing_zeros( ) as usize > Self :: BOOL_BITS ) ;
7063 Self {
7164 packed : Self :: pack_arc (
7265 // Safety: `Arc::into_raw` always returns a non null pointer
@@ -131,8 +124,8 @@ impl fmt::Debug for Symbol {
131124 }
132125}
133126
134- const _: ( ) = assert ! ( std :: mem :: size_of:: <Symbol >( ) == std :: mem :: size_of:: <NonNull <( ) >>( ) ) ;
135- const _: ( ) = assert ! ( std :: mem :: align_of:: <Symbol >( ) == std :: mem :: align_of:: <NonNull <( ) >>( ) ) ;
127+ const _: ( ) = assert ! ( size_of:: <Symbol >( ) == size_of:: <NonNull <( ) >>( ) ) ;
128+ const _: ( ) = assert ! ( align_of:: <Symbol >( ) == align_of:: <NonNull <( ) >>( ) ) ;
136129
137130static MAP : OnceLock < DashMap < SymbolProxy , ( ) , BuildHasherDefault < FxHasher > > > = OnceLock :: new ( ) ;
138131
0 commit comments