-
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
Stabilize duration_float #62756
Stabilize duration_float #62756
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
r? @dtolnay |
Ping from Triage. Hi, @dtolnay, pinging you to check on the status of a review for this PR. |
I'm personally in favor of stabilizing these functions, so I'm going to propose such. @rfcbot fcp merge The major new APIs here that I would proposed for stabilization are: impl Duration {
pub fn as_secs_f64(&self) -> f64;
pub fn as_secs_f32(&self) -> f32;
pub fn from_secs_f64(secs: f64) -> Duration; // panics on overflow
pub fn from_secs_f32(secs: f32) -> Duration; // panics on overflow
} then using those new APIs implementations are provided for: impl Duration {
pub fn mul_f64(self, rhs: f64) -> Duration; // panics on overflow
pub fn mul_f32(self, rhs: f32) -> Duration; // panics on overflow
pub fn div_f64(self, rhs: f64) -> Duration;
pub fn div_f32(self, rhs: f32) -> Duration;
} ... and finally there are these two methods which also use impl Duration {
pub fn div_duration_f64(self, rhs: Duration) -> f64;
pub fn div_duration_f32(self, rhs: Duration) -> f32;
} |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. 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. |
What should I do with |
If others agree that we shouldn't stabilize the methods then yeah I think it's fine to just remove them. |
@alexcrichton Certainly there's a use case for |
Note that I'm not saying that they're not useful nor that we should never stabilize. I don't think they fit into the pattern of the other stabilizations so I think it's worthwhile to consider them separately from these initial stabilizations. Sounds like we shouldn't remove them though, we'll just want to open a new tracking issue for those specific methods. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
How come the impl Div<f32> for Duration {...}
impl Div<f64> for Duration {...}
impl Mul<f32> for Duration {...}
impl Mul<f64> for Duration {...} There might be an obvious answer that I missed. But I can't see anyone discussing/proposing this in the PRs leading up to this stabilization. |
Thanks @newpavlov, I interpret that message as the libs team wanting the EDIT: I see in a later comment that at least Alex argued that the |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
@bors: r+ |
📌 Commit 4281e61 has been approved by |
…excrichton Stabilize duration_float Closes: rust-lang#54361
Stabilize duration_float Closes: #54361
☀️ Test successful - checks-azure |
📣 Toolstate changed by #62756! Tested on commit be8bbb0. 🎉 rustc-guide on linux: test-fail → test-pass (cc @mark-i-m @spastorino, @rust-lang/infra). |
Tested on commit rust-lang/rust@be8bbb0. Direct link to PR: <rust-lang/rust#62756> 🎉 rustc-guide on linux: test-fail → test-pass (cc @mark-i-m @spastorino, @rust-lang/infra).
Closes: #54361