Skip to content

Commit b63849b

Browse files
committed
Unimplement Send and Sync for all platform args
Although unnecessary, as `env::Args` and `env::ArgsOs` provide these negative impls, this makes all platforms consistent and more locally clear.
1 parent 13e6873 commit b63849b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

library/std/src/sys/args/sgx.rs

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ pub struct Args {
3737
iter: slice::Iter<'static, OsString>,
3838
}
3939

40+
impl !Send for Args {}
41+
impl !Sync for Args {}
42+
4043
impl fmt::Debug for Args {
4144
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4245
self.iter.as_slice().fmt(f)

library/std/src/sys/args/unsupported.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pub fn args() -> Args {
77
Args {}
88
}
99

10+
impl !Send for Args {}
11+
impl !Sync for Args {}
12+
1013
impl fmt::Debug for Args {
1114
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1215
f.debug_list().finish()

library/std/src/sys/args/zkvm.rs

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ pub fn args() -> Args {
1515
Args { i_forward: 0, i_back: 0, count }
1616
}
1717

18+
impl !Send for Args {}
19+
impl !Sync for Args {}
20+
1821
impl Args {
1922
/// Use sys_argv to get the arg at the requested index. Does not check that i is less than argc
2023
/// and will not return if the index is out of bounds.

0 commit comments

Comments
 (0)