Skip to content

Conversation

@bjoernager
Copy link
Contributor

@bjoernager bjoernager commented Sep 7, 2025

Tracking issue: #116909.

This PR re-exports f16 and f128 into core::primitive.

IIRC we already have unstable re-exports in other places of the standard library.

C.c. @joseluis.

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

r? @jhpratt

rustbot has assigned @jhpratt.
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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 7, 2025
@bjoernager
Copy link
Contributor Author

@rustbot label +T-libs-api -T-libs

r? libs-api

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 7, 2025
@rustbot rustbot assigned dtolnay and unassigned jhpratt Sep 7, 2025
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtolnay
Copy link
Member

dtolnay commented Sep 7, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 7, 2025

📌 Commit 3981f98 has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2025
@tgross35
Copy link
Contributor

tgross35 commented Sep 7, 2025

Did you double check that this doesn't allow escaping the feature gates? That was the reason we didn't do this at one point #116909 (comment)

@tgross35 tgross35 added the F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` label Sep 7, 2025
@bjoernager
Copy link
Contributor Author

bjoernager commented Sep 7, 2025

I assumed that this would behave like the unstable re-exports that we already have (from a quick search I can find BorrowedBuf as one example). I did verify those, but not this one directly, no.

@dtolnay
Copy link
Member

dtolnay commented Sep 7, 2025

Yeah, sure enough. Good catch. This surprisingly compiles:

use core::primitive::f16;

fn main() {
    let _: f16;
}

It would be good to instead add a placeholder comment in library/core/src/primitive.rs indicating that we know we want this re-export but cannot have it until the type is stable (or the stability checking is fixed).

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 7, 2025
@bjoernager
Copy link
Contributor Author

I suppose that this will have to wait in the meantime.

@bjoernager bjoernager closed this Sep 7, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` 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.

6 participants