Closed
Description
This issue formalizes @pcwalton's RFC on the mailing list. This was also discussed in the 2013-05-14 meeting and in #6087. Steps towards this have already been made in #6462.
Whilst this is not a high priority change at the moment (understandably there are far bigger fish to fry), this is a semi-common question on the IRC and I think it's good if we have some place to redirect questions to.
Instead of the current:
Real::pi::<float>()
this change would allow you to do:
float::pi()
or
type T = float;
T::pi()
This could also allow for neat things like a generic SizeOf
trait: T::size_of()
, which is far nicer than the current size_of::<T>()
. Or maybe there could be an Init
trait for default initializers: T::init()
.