rust-lang / rust-lang/nomicon

example uses deprecated `compare_and_swap`

Open
#382 0 comments 2 reactions 1 assignee View on GitHub

@JohnTitor is already working on this.

Since Oct 20, 2022.

Dominant language
CSS
Stars
2.3k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

This page says:
while lock.compare_and_swap(false, true, Ordering::Acquire) { }

The problem:
pub fn compare_and_swap (&self, current: bool, new: bool, order: Ordering) -> [bool] is deprecated.

Request:
update the example to make it applicable for latest version of Rust

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.