-
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
Extract sys::args::Args
implementation to sys_common
#84503
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Edit: this has been resolved by relying on |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #84525) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #84115) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #85036) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #84967) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #87580) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage: |
Seems reasonable to me; r=me with conflicts addressed. |
Ping again from triage: |
Closing this as inactive |
After #84413 and #84179 I have been looking into if code for
sys::args::Args
could be de-duplicated, as it was essentially the same on every platform: a wrapper type implementing!Send + !Sync + Debug + Iterator + ExactIterator + DoubleEndedIterator
(although note that onwindows
andsgx
the types are currently not!Send + !Sync
).This PR makes
sys::args::Args
a type alias (forvec::IntoIter
/) and extracts the wrapper type toEmpty
/Clone<Iter<'static>>
depending on the platformsys_common
.Alternatively, the wrapper type could be removed entirely and the type aliases used directly (i.e. only the first commit of this PR), since they are wrapped by
std::env::ArgsOs
anyway. These type aliases are not!Send + !Sync
, but I don't know how much of a problem that would be sinceArgsOs
implements!Send + !Sync
explicitly and currentlysys::windows::args::Args
andsys::sgx::args::Args
are alreadySend
andSync
.