paholg / typenum

Compile time numbers in Rust.
https://crates.io/crates/typenum
Other
513 stars 45 forks source link

Marking `Unsigned` as `'static` #170

Closed tspiteri closed 3 years ago

tspiteri commented 3 years ago

Some bytemuck traits like Pod have a 'static constraint. When implementing such traits for types having an Unsigned type parameter, I have to add a 'static constraint. For example

impl <T: 'static + Unsigned> Pod for MyType<T> {}

Since Unsigned should only be implemented for internal types, and all these types are 'static, can the Unsigned types be marked as 'static?

And if the answer is yes, are there any other marker traits that should receive the same treatment?

If the answer is yes, I could write a PR.

paholg commented 3 years ago

Sure! Integer and Bit could use the same treatment.