#![cfg_attr(rustfmt, rustfmt_skip)]
use const_struct_version::StructVersion;
struct UnitStruct;
#[doc(hidden)]
const _: () = {
extern crate const_struct_version as _const_struct_version;
use _const_struct_version::__private::sha1::Digest as _;
#[automatically_derived]
impl _const_struct_version::StructVersion for UnitStruct {
fn version() -> String {
let mut hasher = _const_struct_version::__private::sha1::Sha1::new();
::alloc::__export::must_use({
let res = ::alloc::fmt::format(format_args!("{0:x}", hasher.finalize()));
res
})
}
}
};
impl UnitStruct {
fn version_cached() -> &'static str {
extern crate const_struct_version as _const_struct_version;
static VERSION: ::std::sync::OnceLock<String> = ::std::sync::OnceLock::new();
VERSION.get_or_init(|| <Self as _const_struct_version::StructVersion>::version())
}
}
struct UnitStruct2;
#[doc(hidden)]
const _: () = {
extern crate const_struct_version as _const_struct_version;
use _const_struct_version::__private::sha1::Digest as _;
#[automatically_derived]
impl _const_struct_version::StructVersion for UnitStruct2 {
fn version() -> String {
let mut hasher = _const_struct_version::__private::sha1::Sha1::new();
::alloc::__export::must_use({
let res = ::alloc::fmt::format(format_args!("{0:x}", hasher.finalize()));
res
})
}
}
};
impl UnitStruct2 {
fn version_cached() -> &'static str {
extern crate const_struct_version as _const_struct_version;
static VERSION: ::std::sync::OnceLock<String> = ::std::sync::OnceLock::new();
VERSION.get_or_init(|| <Self as _const_struct_version::StructVersion>::version())
}
}
fn test_unit_structs_give_same_hash() {
let version = <UnitStruct as StructVersion>::version();
let version2 = <UnitStruct2 as StructVersion>::version();
match (&version, &version2) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(
kind,
&*left_val,
&*right_val,
::core::option::Option::None,
);
}
}
};
}
#[rustc_main]
#[coverage(off)]
#[doc(hidden)]
pub fn main() -> () {
extern crate test;
test::test_main_static(&[])
}