Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2200cf1

Browse files
committedFeb 8, 2021
avoid &mut on the read path since it now allows concurrent readers
1 parent 406fd3a commit 2200cf1

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/sys/unix

1 file changed

+1
-1
lines changed
 

‎library/std/src/sys/unix/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ pub unsafe fn environ() -> *mut *const *const c_char {
491491
extern "C" {
492492
static mut environ: *const *const c_char;
493493
}
494-
&mut environ
494+
ptr::addr_of_mut!(environ)
495495
}
496496

497497
pub unsafe fn env_rwlock(readonly: bool) -> RWLockGuard {

0 commit comments

Comments
 (0)
Please sign in to comment.