Uh oh!
There was an error while loading. Please reload this page.
std: Add Motor OS std library port - #147000
Conversation
rustbot
commented
Sep 24, 2025
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging. |
rustbot
commented
Sep 24, 2025
tgross35
commented
Sep 24, 2025
Is there any notable std functionality that isn't supported on this platform? Just skimming it, it seems like things are pretty complete (threads, systemtime, process, etc) Nominating for libs as this adds a new std target. @rustbot label +I-libs-nominated |
lasiotus
commented
Sep 24, 2025
I believe all major pieces are supported/implemented, including networking. Some specific things are not (yet) fully implemented, like FS links, or DNS lookup (at the moment, only "localhost" resolves to an IP address). On the other hand, tokio is ported via a mio port, which was not completely trivial... |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
Sep 25, 2025
☔ The latest upstream changes (presumably #147019) made this pull request unmergeable. Please resolve the merge conflicts. |
e2e23a1 to
f3884e2Compare
This comment has been minimized.
This comment has been minimized.
f3884e2 to
d8da6c0CompareAmanieu
commented
Oct 1, 2025
We discussed this in the @rust-lang/libs meeting and are happy to add std support for this target because it supports all major functionality of std. |
lasiotus
commented
Oct 2, 2025
Thanks, Amanieu! @tgross35 Trevor, how can I improve this PR to make it mergeable? |
tgross35
commented
Oct 2, 2025
It's on my list, I just haven't had a chance to do a thorough review yet (probably later this week) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Rollup of 7 pull requests Successful merges: - #147000 (std: Add Motor OS std library port) - #147732 (remove duplicate inline macro) - #147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - #147739 (Fix whitespace in rustfmt-excluded clippy file) - #147744 (miri subtree update) - #147751 (Use `bit_set::Word` in a couple more places.) - #147752 (style-guide: fix typo for empty struct advice) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 7 pull requests Successful merges: - #147000 (std: Add Motor OS std library port) - #147732 (remove duplicate inline macro) - #147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - #147739 (Fix whitespace in rustfmt-excluded clippy file) - #147744 (miri subtree update) - #147751 (Use `bit_set::Word` in a couple more places.) - #147752 (style-guide: fix typo for empty struct advice) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #144438 (Guard HIR lowered contracts with `contract_checks`) - #147000 (std: Add Motor OS std library port) - #147576 (Fix ICE on offsetted ZST pointer) - #147732 (remove duplicate inline macro) - #147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - #147744 (miri subtree update) - #147751 (Use `bit_set::Word` in a couple more places.) - #147752 (style-guide: fix typo for empty struct advice) - #147773 (`is_ascii` on an empty string or slice returns true) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #147000 - moturus:motor-os_stdlib_pr, r=tgross35 std: Add Motor OS std library port Motor OS was added as a no-std Tier-3 target in [PR 146848](#146848) as x86_64-unknown-motor. This PR adds the std library for Motor OS. While the PR may seem large, all it does is proxy std pal calls to [moto-rt](https://crates.io/crates/moto-rt). Where there is some non-trivial code (e.g. thread::spawn), it is quite similar, often identical, to what other platforms do.
| impl OsStringExt for OsString { | ||
| #[inline] | ||
| fn as_str(&self) -> &str { | ||
| self.to_str().unwrap() |
There was a problem hiding this comment.
If Motor OS strings are guaranteed UTF-8, why not do str::from_utf8_unchecked(self.as_encoded_bytes())?
Shouldn't this be into_string; otherwise it's redundant to OsStrExt?
There was a problem hiding this comment.
But I suppose we can't rely on OS strings remaining UTF-8, since there's no UTF-8-guaranteed variant of OsString. (The user could push arbitrary bytes)
There was a problem hiding this comment.
Maybe this is an argument for a UTF-8 OsString, but I'd also never heard of Motor OS, so maybe it's not worth the extra implementation cost.
There was a problem hiding this comment.
Maybe this is an argument for a UTF-8 OsString, but [...] maybe it's not worth the extra implementation cost.
Yes, OsString currently is not platform specific in Rust, but just bytes. So while Motor OS is very much Rust-first, and Rust strings are UTF-8, there is no guarantee that bytes in OsString are actually UTF-8, so unwrap() seems appropriate here.
I'd also never heard of Motor OS [...]
Feel free to play around and post your impressions on Motor OS github (I'll need to update the building instructions doc, now that this PR is in).
There was a problem hiding this comment.
I wrote more about my thoughts on this in #147797
Update the docs to reflect that [Motor OS std library PR](rust-lang#147000) has been merged.
Update the docs to reflect that [Motor OS std library PR](rust-lang#147000) has been merged.
Update the docs to reflect that [Motor OS std library PR](rust-lang#147000) has been merged.
docs: update Motor OS target docs Update the docs to reflect that [Motor OS std library PR](rust-lang#147000) has been merged.
motor: Add new `set_times` stubs Motor OS `std` support (rust-lang#147000) and `set_times`/`set_times_nofollow` (rust-lang#147468) were merged around the same time, so Motor OS is missing this API and currently fails to build. cc `@lasiotus`
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144438 (Guard HIR lowered contracts with `contract_checks`) - rust-lang/rust#147000 (std: Add Motor OS std library port) - rust-lang/rust#147576 (Fix ICE on offsetted ZST pointer) - rust-lang/rust#147732 (remove duplicate inline macro) - rust-lang/rust#147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - rust-lang/rust#147744 (miri subtree update) - rust-lang/rust#147751 (Use `bit_set::Word` in a couple more places.) - rust-lang/rust#147752 (style-guide: fix typo for empty struct advice) - rust-lang/rust#147773 (`is_ascii` on an empty string or slice returns true) r? `@ghost` `@rustbot` modify labels: rollup
…ss35 std: Add Motor OS std library port Motor OS was added as a no-std Tier-3 target in [PR 146848](rust-lang#146848) as x86_64-unknown-motor. This PR adds the std library for Motor OS. While the PR may seem large, all it does is proxy std pal calls to [moto-rt](https://crates.io/crates/moto-rt). Where there is some non-trivial code (e.g. thread::spawn), it is quite similar, often identical, to what other platforms do.
motor: Add new `set_times` stubs Motor OS `std` support (rust-lang#147000) and `set_times`/`set_times_nofollow` (rust-lang#147468) were merged around the same time, so Motor OS is missing this API and currently fails to build. cc `@lasiotus`
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144438 (Guard HIR lowered contracts with `contract_checks`) - rust-lang/rust#147000 (std: Add Motor OS std library port) - rust-lang/rust#147576 (Fix ICE on offsetted ZST pointer) - rust-lang/rust#147732 (remove duplicate inline macro) - rust-lang/rust#147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - rust-lang/rust#147744 (miri subtree update) - rust-lang/rust#147751 (Use `bit_set::Word` in a couple more places.) - rust-lang/rust#147752 (style-guide: fix typo for empty struct advice) - rust-lang/rust#147773 (`is_ascii` on an empty string or slice returns true) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144438 (Guard HIR lowered contracts with `contract_checks`) - rust-lang/rust#147000 (std: Add Motor OS std library port) - rust-lang/rust#147576 (Fix ICE on offsetted ZST pointer) - rust-lang/rust#147732 (remove duplicate inline macro) - rust-lang/rust#147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - rust-lang/rust#147744 (miri subtree update) - rust-lang/rust#147751 (Use `bit_set::Word` in a couple more places.) - rust-lang/rust#147752 (style-guide: fix typo for empty struct advice) - rust-lang/rust#147773 (`is_ascii` on an empty string or slice returns true) r? `@ghost` `@rustbot` modify labels: rollup
docs: update Motor OS target docs Update the docs to reflect that [Motor OS std library PR](rust-lang/rust#147000) has been merged.
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144438 (Guard HIR lowered contracts with `contract_checks`) - rust-lang/rust#147000 (std: Add Motor OS std library port) - rust-lang/rust#147576 (Fix ICE on offsetted ZST pointer) - rust-lang/rust#147732 (remove duplicate inline macro) - rust-lang/rust#147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - rust-lang/rust#147744 (miri subtree update) - rust-lang/rust#147751 (Use `bit_set::Word` in a couple more places.) - rust-lang/rust#147752 (style-guide: fix typo for empty struct advice) - rust-lang/rust#147773 (`is_ascii` on an empty string or slice returns true) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144438 (Guard HIR lowered contracts with `contract_checks`) - rust-lang/rust#147000 (std: Add Motor OS std library port) - rust-lang/rust#147576 (Fix ICE on offsetted ZST pointer) - rust-lang/rust#147732 (remove duplicate inline macro) - rust-lang/rust#147738 (Don't highlight `let` expressions as having type `bool` in let-chain error messages) - rust-lang/rust#147744 (miri subtree update) - rust-lang/rust#147751 (Use `bit_set::Word` in a couple more places.) - rust-lang/rust#147752 (style-guide: fix typo for empty struct advice) - rust-lang/rust#147773 (`is_ascii` on an empty string or slice returns true) r? `@ghost` `@rustbot` modify labels: rollup
Motor OS was added as a no-std Tier-3 target in
PR 146848 as x86_64-unknown-motor.
This PR adds the std library for Motor OS.
While the PR may seem large, all it does is proxy
std pal calls to moto-rt. Where there is some non-trivial
code (e.g. thread::spawn), it is quite similar, often
identical, to what other platforms do.