-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Implement From<bool>
for f32, f64
#100390
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
r? @thomcc (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
4c3c736
to
20e30cb
Compare
Cross-linking the Zulip conversation: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/.60impl.20From.3Cbool.3E.20for.20f.7B32.7C64.7D.60/near/292687425
Reminder you can check https://github.com/rust-lang/rust/blob/master/src/version -- it's already been 1.65 for 5 days. |
This comment was marked as outdated.
This comment was marked as outdated.
You might be thinking of these backward? The input is a In this impl: |
Yeah, this goes from a boolean to a float. The other way around would absolutely be unwise to implement in this manner. |
Oh, right. Yes, my bad. I don't have an issue then (this is what I get for taking a look at a PR at 11:30PM...) |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
☔ The latest upstream changes (presumably #98807) made this pull request unmergeable. Please resolve the merge conflicts. |
20e30cb
to
dea0627
Compare
Rebased. |
I'm a bit torn on this. I think that if we do merge this, then directly casting from Note that this isn't against this feature necessarily, I'm just not sure what would justify having one of |
While I understand what you're saying, I think the general trend is to move away from |
I would be in favour of that if there were actually detailed plans on how we plan to do that, but at least for now, this will be merged long before any of those plans are executed. I mean ultimately it probably doesn't matter that much, but I feel like it's worth at least providing a decision on the Is the actual conversion more complicated than other Again, it's very simple to merge this change, but it's also very simple to do the conversion through |
There is not a single, unified plan for moving away from The main thing keeping |
Basically the key point I'm trying to make is that right now, since It doesn't mean that anyone is obliged to write the code for such an implementation before this is merged, but rather that if a compelling argument exists to not accept an |
I'm marking @yaahc's box because she has stepped down from T-libs-api after the point that this feature got proposed for FCP. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@bors r+ |
@dtolnay This needs to complete FCP, no? |
Closing and reopening to avoid bors merging this for the moment, as I believe FCP is still necessary. This will also cancel FCP, but that can be restarted by any libs-api team member (checking the same boxes as are currently checked). |
I do not feel that blocking this on FCP is necessary. The FCP proposal has been active for 4 months which is ample time for any team member to register their concern. In general the automation around FCP does not attempt to take into account size of the feature. The amount of process it makes sense to have around adding a trait impl to an existing type, or adding const to an existing method, is vastly different compared to adding some major language feature like async or const generics. The team has discretion to adapt the process to the situation. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4914381): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
Implement `From<bool>` for f32, f64 As is required for trait implementations, these are insta-stable. Given there is a release tomorrow and this needs FCP, I set 1.65 as the stable version. `@rustbot` label +A-floating-point +C-feature-request +needs-fcp +relnotes +S-waiting-on-review +T-libs-api -T-libs
As is required for trait implementations, these are insta-stable. Given there is a release tomorrow and this needs FCP, I set 1.65 as the stable version.
@rustbot label +A-floating-point +C-feature-request +needs-fcp +relnotes +S-waiting-on-review +T-libs-api -T-libs