-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Ability to specify self parameter in static method call #8888
Comments
1 |
Is this related to #6894? |
Nominating |
1.0, high |
Although I initially proposed this syntax, it sure is ugly. I am still worried we're making a mistake by not supporting 'C style'. |
This is also related to the question of whether we want to support multiparameter typeclasses in their full generality. |
Shouldn’t this be just |
@SimonSapin not currently; see #6894 |
@pnkfelix So, we can’t do |
@SimonSapin yeah, we want to support |
I think we want to do this for 1.0. It came up in a recent weekly meeting. Our plan, I think, is to keep supporting the Nominating, presuming that it will get P-high. |
Wait, this is already P-high ... |
Ah, the description didn't cover the |
The |
This removes the `Primitive::{bits, bytes, is_signed}` methods and removes the operator trait constraints, for the reasons outlined below: - The `Primitive::{bits, bytes}` associated functions were originally added to reflect the existing `BITS` and `BYTES` statics included in the numeric modules. These statics are only exist as a workaround for Rust's lack of CTFE, and should probably be deprecated in the future in favor of using the `std::mem::size_of` function (see rust-lang#11621). - `Primitive::is_signed` seems to be of little utility and does not seem to be used anywhere in the Rust compiler or libraries. It is also rather ugly to call due to the `Option<Self>` workaround for rust-lang#8888. - The operator trait constraints are already covered by the `Num` trait.
As part of #10387, this removes the `Primitive::{bits, bytes, is_signed}` methods and removes the trait's operator trait constraints for the reasons outlined below: - The `Primitive::{bits, bytes}` associated functions were originally added to reflect the existing `BITS` and `BYTES`statics included in the numeric modules. These statics are only exist as a workaround for Rust's lack of CTFE, and should be deprecated in the future in favor of using the `std::mem::size_of` function (see #11621). - `Primitive::is_signed` seems to be of little utility and does not seem to be used anywhere in the Rust compiler or libraries. It is also rather ugly to call due to the `Option<Self>` workaround for #8888. - The operator trait constraints are already covered by the `Num` trait.
This removes the `Primitive::{bits, bytes, is_signed}` methods and removes the operator trait constraints, for the reasons outlined below: - The `Primitive::{bits, bytes}` associated functions were originally added to reflect the existing `BITS` and `BYTES` statics included in the numeric modules. These statics are only exist as a workaround for Rust's lack of CTFE, and should probably be deprecated in the future in favor of using the `std::mem::size_of` function (see rust-lang#11621). - `Primitive::is_signed` seems to be of little utility and does not seem to be used anywhere in the Rust compiler or libraries. It is also rather ugly to call due to the `Option<Self>` workaround for rust-lang#8888. - The operator trait constraints are already covered by the `Num` trait.
working on this |
@nick29581 Do you know what the state of this is? I feel like I haven't heard much about it. Does UFCS solve it? |
@brson Yes, UFCS should solve this. I'm not sure who is implementing now. |
Note that UFCS is not considered 1.0 blocking, but this issue is. Nominating: we need to decide whether this functionality blocks 1.0 or not. (Also, this ticket can likely be closed as a dup of #16293). |
Would reassign as P-high, not on 1.0 milestone. But really, just closing as dupe of #16293. |
The commit 8693943 removed the ability for us to do:
@pcwalton has proposed that we add support for expressing the
Self
type of a static method with:but I've heard that we haven't settled on this syntax yet.
The text was updated successfully, but these errors were encountered: