Module zerocopy::util::polyfills

source ·
Expand description

Since we support multiple versions of Rust, there are often features which have been stabilized in the most recent stable release which do not yet exist (stably) on our MSRV. This module provides polyfills for those features so that we can write more “modern” code, and just remove the polyfill once our MSRV supports the corresponding feature. Without this, we’d have to write worse/more verbose code and leave TODO comments sprinkled throughout the codebase to update to the new pattern once it’s stabilized.

Each trait is imported as _ at the crate root; each polyfill should “just work” at usage sites.

Traits§