Skip to content
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

Lock free implementations of MessageQueue and SleeperList #10080

Merged
merged 11 commits into from
Oct 28, 2013

Conversation

brson
Copy link
Contributor

@brson brson commented Oct 26, 2013

Rebase and update of #9710

bors added a commit that referenced this pull request Oct 28, 2013
@bors bors closed this Oct 28, 2013
@bors bors merged commit a849c47 into rust-lang:master Oct 28, 2013
@emberian
Copy link
Member

@brson are there any perf numbers for this?

@pmarcelll pmarcelll mentioned this pull request Sep 18, 2016
@Manishearth
Copy link
Member

For people spelunking licenses in the future, the license inherited for the C++ code referenced here was fixed in #42149, the PR author is the original author of that C++ code.

flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 31, 2023
`unwrap_or_else_default` -> `unwrap_or_default` and improve resulting lint

Resolves rust-lang#10080 (though it doesn't implement exactly what's described there)

This PR does the following:
1. Merges `unwrap_or_else_default.rs`'s code into `or_fun_call.rs`
2. Extracts the code to handle `unwrap_or(/* default value */)` and similar, and moves it into `unwrap_or_else_default`
3. Implements the missing functionality from rust-lang#9342, e.g.,, to handle `or_insert_with(Default::default)`
4. Renames `unwrap_or_else_default` to `unwrap_or_default` (since the "new" lint handles both `unwrap_or` and `unwrap_or_else`, it seemed sensible to use the shortened name)

This PR is currently two commits. The first implements 1-3, the second implements 4.

A word about 2: the `or_fun_call` lint currently produces warnings like the following:
```
error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:56:14
   |
LL |     with_new.unwrap_or(Vec::new());
   |              ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
```
To me, such warnings look like they should come from `unwrap_or_else_default`, not `or_fun_call`, especially since `or_fun_call` is [in the nursery](rust-lang/rust-clippy#9829).

---

changelog: Move: Renamed `unwrap_or_else_default` to [`unwrap_or_default`]
[rust-lang#10120](rust-lang/rust-clippy#10120)
changelog: Enhancement: [`unwrap_or_default`]: Now handles more functions, like `or_insert_with`
[rust-lang#10120](rust-lang/rust-clippy#10120)
<!-- changelog_checked-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants