-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Move Duration to libcore (and remove deprecated Duration::span) #30594
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
acdfd75
to
cb09b5e
Compare
cc @rust-lang/libs |
Travis failure: https://travis-ci.org/rust-lang/rust/builds/99159735#L6416 I'm tentatively on board with this, but since libcore is stable now, we'll have to make sure we'll never want to add functionality that libcore can't support. |
It seems like it would be nice to have |
cb09b5e
to
601e52d
Compare
Pushed a fix, |
This (having different set of functionality in core vs std for the same type) is not specific to For |
I think Travis is stuck in a loop. I pushed hours ago and it’s now showing "Elapsed time 11 min 19 sec", but it was 20 minutes or so earlier. |
☔ The latest upstream changes (presumably #30458) made this pull request unmergeable. Please resolve the merge conflicts. |
… so that Duration can be moved into libcore. The removal will hit stable in 1.7 at the soonest, while 1.6 already has the deprecation warning.
601e52d
to
ac249c1
Compare
It's applicable to whatever types we like, but not something anyone has much of an appetite for doing. We did it for primitive types primarily because you hit them so early when learning Rust that extension traits seemed really problematic. I agree with @huonw that ideally we'd have it unstable in |
Re stability: sounds reasonable. I’ve pushed a commit that I think does this. |
@SimonSapin Can you add a test for stability in |
I think that lots of stability portions in the compiler don't expect a stable type with an unstable parent so it may not work out in terms of ensuring all usage through libcore is gated. For example all the method usage will be stable in libcore, it's just the module itself that's unstable. (which I forget how it affects the stability checking of a path like |
☔ The latest upstream changes (presumably #30883) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm going to flag for libs team discussion. |
The libs team discussed this PR during triage today, and the conclusion was to close this for now. Currently we think that moving a type from std to libcore needs motivation aside from "it can be done", as there are stabilization ramifications to moving into libcore rather than sticking with std (e.g. it's much harder to add functionality that requires std). It was also brought up that this may not be too useful as the only member of |
The
Duration::span
removal will hit stable in 1.7 at the soonest, while 1.6 already has the deprecation warning.