Skip to content

Make sync::raw::Sem use Unsafe to manage mutability instead of *() #14708

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

Merged
merged 1 commit into from
Jun 7, 2014

Conversation

gereeter
Copy link
Contributor

@gereeter gereeter commented Jun 6, 2014

Currently, Sem, which is used as a building block for all the blocking primitives, uses a very ugly hack to implement Share and be able to mutate the stored WaitQueue by hiding it all behind a transmuted *(). This PR replaces all that ugly machinery with Unsafe. Beyond being cleaner and not requiring transmute, this removes an allocation in the creation and removes an indirection for access.

bors added a commit that referenced this pull request Jun 7, 2014
Currently, `Sem`, which is used as a building block for all the blocking primitives, uses a very ugly hack to implement `Share` and be able to mutate the stored `WaitQueue` by hiding it all behind a `transmute`d `*()`. This PR replaces all that ugly machinery with `Unsafe`. Beyond being cleaner and not requiring `transmute`, this removes an allocation in the creation and removes an indirection for access.
@bors bors closed this Jun 7, 2014
@bors bors merged commit f2f1991 into rust-lang:master Jun 7, 2014
@gereeter gereeter deleted the faster-sem branch December 17, 2015 01:29
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 13, 2025
…lang#14708)

changelog: [`doc_suspicious_footnotes`]: lint for text that looks like a
footnote reference but has no definition

This is an alternative to rust-lang#137803,
meant to address the concerns about false positives.

This lint only fires when the apparent footnote reference has a name
that's made from pure ASCII digits. This choice is justified by running
lintcheck on the top 200 crates, plus the clippy default set:

1. [I ran
lintcheck](https://gist.github.com/notriddle/59072476c9c1fd569fee421270dad665)
with a modded version of this lint that didn't check for digits only. It
produced a false positive warning on a line in mdbook that had a regex,
and no true positives at all.
2. [I also ran
lintcheck](https://gist.github.com/notriddle/74eb8c9e1939b9f5c5549bf1d4fa238a)
with a custom lint that fired on any valid footnote reference with a
non-ascii-digit name. `cargo` uses one in its job_queue module, and
that's all it found.

cc @GuillaumeGomez
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.

3 participants