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

Stabilize const_float_classify #130157

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

eduardosm
Copy link
Contributor

@eduardosm eduardosm commented Sep 9, 2024

Tracking issue: #72505

Also reverts #114486

Closes #72505

Stabilized const API:

impl f32 {
    pub const fn is_nan(self) -> bool;
    pub const fn is_infinite(self) -> bool;
    pub const fn is_finite(self) -> bool;
    pub const fn is_subnormal(self) -> bool;
    pub const fn is_normal(self) -> bool;
    pub const fn classify(self) -> FpCategory;
    pub const fn is_sign_positive(self) -> bool;
    pub const fn is_sign_negative(self) -> bool;
}

impl f64 {
    pub const fn is_nan(self) -> bool;
    pub const fn is_infinite(self) -> bool;
    pub const fn is_finite(self) -> bool;
    pub const fn is_subnormal(self) -> bool;
    pub const fn is_normal(self) -> bool;
    pub const fn classify(self) -> FpCategory;
    pub const fn is_sign_positive(self) -> bool;
    pub const fn is_sign_negative(self) -> bool;
}

cc @rust-lang/wg-const-eval @rust-lang/libs-api

@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2024

r? @thomcc

rustbot has assigned @thomcc.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 9, 2024
@bors
Copy link
Contributor

bors commented Sep 12, 2024

☔ The latest upstream changes (presumably #130253) made this pull request unmergeable. Please resolve the merge conflicts.

@thomcc
Copy link
Member

thomcc commented Sep 12, 2024

I think libs-api needs to handle these?
r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 12, 2024
@rustbot rustbot assigned dtolnay and unassigned thomcc Sep 12, 2024
@dtolnay dtolnay added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2024
@RalfJung
Copy link
Member

Cc @rust-lang/wg-const-eval -- this is entirely harmless, the methods just all use already-stable const facilities.

(Team pings only work when an org member writes them, AFAIK.)

@tgross35
Copy link
Contributor

Also reverts #114486

Nit: could you put this PR link and/or the relevant commit SHAs in that commit message? It's currently just a title so no crosslinking.

@RalfJung
Copy link
Member

The PR link is in the PR description which bors will put into the merge commit message. So I think that will be covered.

@RalfJung
Copy link
Member

RalfJung commented Oct 4, 2024

FCP passed, so this is good to go. :)

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2024

📌 Commit c39ae56 has been approved by RalfJung

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 4, 2024
@bors
Copy link
Contributor

bors commented Oct 4, 2024

⌛ Testing commit c39ae56 with merge 14f303b...

@bors
Copy link
Contributor

bors commented Oct 4, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 14f303b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 4, 2024
@bors bors merged commit 14f303b into rust-lang:master Oct 4, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 4, 2024
@eduardosm eduardosm deleted the stabilize-const_float_classify branch October 4, 2024 20:54
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (14f303b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -0.8%)

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 2.9%)

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 771.465s -> 771.36s (-0.01%)
Artifact size: 342.03 MiB -> 342.03 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for #![feature(const_float_classify)]
8 participants