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

Rollup of 9 pull requests #70747

Merged
merged 29 commits into from
Apr 3, 2020
Merged

Rollup of 9 pull requests #70747

merged 29 commits into from
Apr 3, 2020

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Apr 3, 2020

Successful merges:

Failed merges:

r? @ghost

Vytautas Astrauskas and others added 29 commits March 31, 2020 12:24
This was used by the old framework that was removed in rust-lang#69644.
Fmt code

Update tests

Modify msg

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
Use associated numeric consts in documentation

Now when the associated constants on int/float types are stabilized and the recommended way of accessing said constants (rust-lang#68952). We can start using it in this repository, and recommend it via documentation example code.

This PR is the reincarnation of rust-lang#67913 minus the actual adding + stabilization of said constants. (EDIT: Now it's only changing the documentation. So users will see the new consts, but we don't yet update the internal code)

Because of how fast bit rot happens to PRs that touch this many files, it does not try to replace 100% of the old usage of the constants in the entire repo, but a good chunk of them.
…=varkor

Update the description of the ticket to point at RFC 1721

Fixes rust-lang#70538.

My first PR to rust. So please let me know if I'm doing something wrong.
…fix, r=Amanieu

Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new

While working on concurrency support for Miri, I found that the `libstd::syn::unix::Thread::new` method has two potential problems: double-free and undefined behaviour.

**Double-free** could occur if the following events happened (credit for pointing this out goes to @RalfJung):

1.  The call to `pthread_create` successfully launched a new thread that executed to completion and deallocated `p`.
2.  The call to `pthread_attr_destroy` returned a non-zero value causing the `assert_eq!` to panic.
3.  Since `mem::forget(p)` was not yet executed, the destructor of `p` would be executed and cause a double-free.

As far as I understand, this code also violates the stacked-borrows aliasing rules and thus would result in **undefined behaviour** if these rules were adopted.  The problem is that the ownership of `p` is passed to the newly created thread before the call to `mem::forget`. Since the call to `mem::forget` is still a call, it counts as a use of `p` and triggers UB.

This pull request changes the code to use `mem::ManuallyDrop` instead of `mem::forget`. As a consequence, in case of a panic, `p` would be potentially leaked, which while undesirable is probably better than double-free or undefined behaviour.
Remove duplicated code in trait selection
…eanup, r=nikomatsakis

Remove unused graphviz emitter

This was only used by the old dataflow framework that was removed in rust-lang#69644.
Place TLS initializers with relocations in .tdata

Should fix rust-lang#70673, although I'm not sure how to test this. Perhaps @joshlf could find a MCVE?

Also adds more context to the FIXME.

r? @oli-obk
@Centril
Copy link
Contributor Author

Centril commented Apr 3, 2020

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented Apr 3, 2020

📌 Commit 4c41ea3 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 3, 2020
@Centril Centril added the rollup A PR which is a rollup label Apr 3, 2020
@bors
Copy link
Contributor

bors commented Apr 3, 2020

⌛ Testing commit 4c41ea3 with merge 74bd074...

@bors
Copy link
Contributor

bors commented Apr 3, 2020

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 74bd074 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 3, 2020
@bors bors merged commit 74bd074 into rust-lang:master Apr 3, 2020
@Centril Centril deleted the rollup-2vx9bve branch April 3, 2020 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants