| 1 | use quoterust-analyzer cargo quote 1.0.47 crate/::ToTokensrust-analyzer cargo quote 1.0.47 to_tokens/ToTokens#; |
| 2 | use synrust-analyzer cargo syn 2.0.119 crate/::{spannedrust-analyzer cargo syn 2.0.119 spanned/::Spannedrust-analyzer cargo syn 2.0.119 spanned/Spanned#, Metarust-analyzer cargo syn 2.0.119 attr/Meta#}; |
| 3 | |
| 4 | #[inline] |
| 5 | pub(craterust-analyzer cargo educe 0.6.0 crate/) fn union_without_unsaferust-analyzer cargo educe 0.6.0 trait_handlers/hash/panic/union_without_unsafe().(meta: &Metarust-analyzer cargo syn 2.0.119 attr/Meta#) -> synrust-analyzer cargo syn 2.0.119 crate/::Errorrust-analyzer cargo syn 2.0.119 error/Error# { |
| 6 | let mut s = meta.into_token_streamrust-analyzer cargo quote 1.0.47 to_tokens/ToTokens#into_token_stream().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(); |
| 7 | |
| 8 | match s.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() { |
| 9 | 4 => s.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().("(unsafe)"), |
| 10 | 6 => s.insert_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]insert_str().(10, "unsafe"), |
| 11 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 12 | } |
| 13 | |
| 14 | synrust-analyzer cargo syn 2.0.119 crate/::Errorrust-analyzer cargo syn 2.0.119 error/Error#::newrust-analyzer cargo syn 2.0.119 error/impl#[Error]new().( |
| 15 | meta.spanrust-analyzer cargo syn 2.0.119 spanned/impl#[T][Spanned]span().(), |
| 16 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 17 | "a union's `Hash` implementation is not precise, because it ignores the type of \ |
| 18 | fields\n* If your union doesn't care about that, use `#[educe({s})]` to implement \ |
| 19 | the `Hash` trait for it." |
| 20 | ), |
| 21 | ) |
| 22 | } |