Skip to content

Clarify examples related to Sync and SyncView - #162621

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
tisonkun:patch-2
Sep 11, 2026
Merged

Clarify examples related to Sync and SyncView#162621
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
tisonkun:patch-2

Conversation

@tisonkun

@tisonkun tisonkun commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

View all comments

Updated examples to clarify the role of non-Sync fields and the functionality of SyncView.

This refers to #98407

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 11, 2026
@rustbot

rustbot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from Darksonn, JohnTitor, Mark-Simulacrum

@tisonkun tisonkun mentioned this pull request Sep 11, 2026
10 tasks
@rust-log-analyzer

This comment has been minimized.

Comment thread library/core/src/sync/sync_view.rs Outdated
Comment thread library/core/src/sync/sync_view.rs Outdated
/// ```
///
/// `SyncView` ensures the struct is `Sync` without stripping the future of its
/// `SyncView` makes the struct `Sync` without stripping the struct of its

@pthariensflame pthariensflame Sep 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// `SyncView` makes the struct `Sync` without stripping the struct of its
/// `SyncView` makes the value `Sync` without stripping the struct of its

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adopted. But I wonder if there is some references to teach more English or Rust's terminology to decide between words?

@joseph-gio joseph-gio Sep 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh I do feel like struct or type is more accurate here. value refers to a specific instantiation of a struct/type whose Sync-ness is entirely dependent on the syncness of its type. And it applies here especially since the "struct" in this case is contrasting with the "struct" mentioned a few lines earlier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, perhaps the best phrasing for both correctness and stylistic clarity would be “SyncView makes the type Sync without stripping it of its functionality…”.

@JohnTitor

Copy link
Copy Markdown
Member

@bors squash

@rust-bors

This comment has been minimized.

* Clarify examples related to `Sync` and `SyncView`

Updated examples to clarify the role of non-`Sync` fields and the functionality of `SyncView`.
* Apply suggestion from @tisonkun
* Update library/core/src/sync/sync_view.rs

Co-authored-by: Laine Taffin Altman <alexanderaltman@me.com>
@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🔨 3 commits were squashed into ea39610.

@JohnTitor JohnTitor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ea39610 has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 11, 2026
Clarify examples related to `Sync` and `SyncView`

Updated examples to clarify the role of non-`Sync` fields and the functionality of `SyncView`.

This refers to rust-lang#98407
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #162636 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 11, 2026
@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#162636), which was unapproved.

View changes since this unapproval

@tisonkun

Copy link
Copy Markdown
Contributor Author

Weird .. Let me see ..

Comment thread library/core/src/sync/sync_view.rs Outdated
@tisonkun
tisonkun requested a review from JohnTitor September 11, 2026 13:53
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 11, 2026
@tisonkun

Copy link
Copy Markdown
Contributor Author

Add ignore-wasm to the second example that uses thread::spawn. This follows how atomic.rs's example does.

This should work now. cc @JohnTitor @JonathanBrouwer

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=test-various

rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
Clarify examples related to `Sync` and `SyncView`


try-job: test-various
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 24a3d70 (24a3d70870e3c8133d74346197944fa19fe23452)
Base parent: ada41e1 (ada41e1ce81819f01577c0ee40ccbd6fc41384e8)

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r=JohnTitor

@rust-bors

rust-bors Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f47f54d has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 11, 2026
Clarify examples related to `Sync` and `SyncView`

Updated examples to clarify the role of non-`Sync` fields and the functionality of `SyncView`.

This refers to rust-lang#98407
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #161413 (mir-transform: Remove `is_optimization_stage`)
 - #161430 (Re-export `core::fmt::NumBuffer` in `alloc` (and `std`))
 - #162446 (Prevent `should-fail` to be used in `rustdoc-ui` testsuite)
 - #162621 (Clarify examples related to `Sync` and `SyncView`)
 - #162650 (Initialize mingw for all mingw targets)
 - #162651 (Remove needless test running instructions)
 - #162658 (Remove noras target docs mention)
@rust-bors
rust-bors Bot merged commit 69e0636 into rust-lang:main Sep 11, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 11, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 11, 2026
Rollup merge of #162621 - tisonkun:patch-2, r=JohnTitor

Clarify examples related to `Sync` and `SyncView`

Updated examples to clarify the role of non-`Sync` fields and the functionality of `SyncView`.

This refers to #98407
@tisonkun
tisonkun deleted the patch-2 branch September 11, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants