Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework generic paths for associated functions: T::function() #288

Closed
rust-highfive opened this issue Sep 24, 2014 · 1 comment
Closed

Rework generic paths for associated functions: T::function() #288

rust-highfive opened this issue Sep 24, 2014 · 1 comment

Comments

@rust-highfive
Copy link

Issue by bjz
Sunday Jun 02, 2013 at 00:22 GMT

For earlier discussion, see rust-lang/rust#6894

This issue was labelled with: B-RFC, P-high in the Rust repository


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().

@alexcrichton
Copy link
Member

I believe this has since been implemented, so closing.

withoutboats pushed a commit to withoutboats/rfcs that referenced this issue Jan 15, 2017
Unify `future::Ok`, `future::Err`, and `feature::FutureResult`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants