impl_stable_traits_for_trivial_type in rustc_data_structures::stable_hash - Rust
Description: Implement StableHash by just calling `Hash::hash()`. Also implement `StableOrd` for the type since that has the same requirements.

Skip to main content

## impl_stable_traits_for_trivial_type

# Macro impl_stable_traits_for_trivial_type

Source

    macro_rules! impl_stable_traits_for_trivial_type {
        ($t:ty) => { ... };
    }

Expand description

Implement StableHash by just calling `Hash::hash()`. Also implement `StableOrd` for the type since that has the same requirements.

WARNING This is only valid for types that really don’t need any context for fingerprinting. But it is easy to misuse this macro (see #96013 for examples). Therefore this macro is not exported and should only be used in the limited cases here in this module.

Use `#[derive(StableHash)]` instead.