1
Fork 0

Specialize implementations

Implementations in stdlib are now optimized as they were before.
This commit is contained in:
Jacob Pratt 2021-04-02 00:58:45 -04:00
parent a875876027
commit bc2f0fb5a9
No known key found for this signature in database
GPG key ID: B80E19E4662B5AA4
17 changed files with 403 additions and 109 deletions

View file

@ -6,6 +6,7 @@
#![feature(unboxed_closures)]
#![feature(test)]
#![feature(fn_traits)]
#![feature(trusted_step)]
pub mod bit_set;
pub mod vec;

View file

@ -204,6 +204,9 @@ macro_rules! newtype_index {
}
}
// Safety: The implementation of `Step` upholds all invariants.
unsafe impl ::std::iter::TrustedStep for $type {}
impl From<$type> for u32 {
#[inline]
fn from(v: $type) -> u32 {