Use common Timestamp impl in Hermit (attempt 2)#154234
Use common Timestamp impl in Hermit (attempt 2)#154234rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
878bcf6 to
a5006e0
Compare
|
|
|
r? Mark-Simulacrum |
This comment has been minimized.
This comment has been minimized.
a5006e0 to
178882d
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
|
||
| fn clock_gettime(clock: hermit_abi::clockid_t) -> Timespec { | ||
| let mut t = hermit_abi::timespec { tv_sec: 0, tv_nsec: 0 }; | ||
| let _ = unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }; |
There was a problem hiding this comment.
Why are we ignoring the error here? In unix/time.rs we panic if there's an error, probably should match that here?
cvt(unsafe { clock_gettime64(clock, t.as_mut_ptr()) }).unwrap();
There was a problem hiding this comment.
It was ignored before, so I did not include it in this PR which moves files and does not change semantics.
rust/library/std/src/sys/time/hermit.rs
Line 13 in fda6d37
Should I include unwrap in this PR?
There was a problem hiding this comment.
Let's merge this and if you can file a followup (maybe check for other similar discrepancies too) that would be good. Thanks!
|
Reminder, once the PR becomes ready for a review, use |
|
@bors r+ rollup |
Rollup of 9 pull requests Successful merges: - #154357 (uefi: extend comment for TcpStream Send impl) - #154410 (Clean up the API for opening/checking incremental-compilation files ) - #154081 (format safety doc of Rc/Arc::from_raw/from_raw_in) - #154110 (Change "error finalizing incremental compilation" text and emit it as a note, not a warning) - #154196 (Make `Ipv6Addr::multicast_scope()` exhaustive) - #154221 (`vec::as_mut_slice()`: use lowercase "isize" in safety comment) - #154234 (Use common Timestamp impl in Hermit (attempt 2)) - #154396 (chore(deps): update rust crate tar to v0.4.45) - #154488 (Revert "Unstable book options parser")
Rollup of 9 pull requests Successful merges: - #154357 (uefi: extend comment for TcpStream Send impl) - #154410 (Clean up the API for opening/checking incremental-compilation files ) - #154081 (format safety doc of Rc/Arc::from_raw/from_raw_in) - #154110 (Change "error finalizing incremental compilation" text and emit it as a note, not a warning) - #154196 (Make `Ipv6Addr::multicast_scope()` exhaustive) - #154221 (`vec::as_mut_slice()`: use lowercase "isize" in safety comment) - #154234 (Use common Timestamp impl in Hermit (attempt 2)) - #154396 (chore(deps): update rust crate tar to v0.4.45) - #154488 (Revert "Unstable book options parser")
Rollup merge of #154234 - stepancheg:hermit-timespec, r=Mark-Simulacrum Use common Timestamp impl in Hermit (attempt 2) The goal is to have less code to maintain, so to be able to make changes easier. Previous attempt #148847 was asked to postpone because there was restructure of code, which is complete now. r? joboet
…mulacrum Panic in Hermit clock_gettime Follow-up to rust-lang#154234. r? @Mark-Simulacrum
The goal is to have less code to maintain, so to be able to make changes easier.
Previous attempt #148847 was asked to postpone because there was restructure of code, which is complete now.
r? joboet