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 16 pull requests #62294

Closed
wants to merge 63 commits into from

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

zackmdavis and others added 30 commits June 15, 2019 20:22
RFC 2457 declares: "A `non_ascii_idents` lint is added to the
compiler. This lint is allow by default."
This avoids reserving storage in generators for locals that are moved
out of (and not re-initialized) prior to yield points.
This commit moves a test out of libstd which is causing deadlocks on
musl on CI. Looks like the recent update in musl versions brings in some
internal updates to musl which makes `setgid` and `setuid` invalid to
call after a `fork` in a multithreaded program. The issue seen here is
that the child thread was attempting to grab a lock held by a
nonexistent thread, meaning that the child process simply deadlocked
causing the whole test to deadlock.

This commit moves the test to its own file with no threads which should
work.
Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure
tmandry and others added 17 commits July 1, 2019 12:19
Don't use lift to detect local types

This overlaps with rust-lang#61392.

r? @eddyb
…=Manishearth

`non_ascii_idents` lint (part of RFC 2457)

RFC 2457 [declares](https://github.com/rust-lang/rfcs/blob/121bbeff500c3274cea22c7e0ca176274d592646/text/2457-non-ascii-idents.md): "A `non_ascii_idents` lint is added to the compiler. This lint is allow by default."

(Part of rust-lang#55467.)

r? @Manishearth
…, r=matthewjasper

Don't store locals that have been moved from in generators

This avoids reserving storage in generators for locals that are moved
out of (and not re-initialized) prior to yield points. Fixes rust-lang#59123.

This adds a new dataflow analysis, `RequiresStorage`, to determine whether the storage of a local can be destroyed without being observed by the program. The rules are:

1. StorageLive(x) => mark x live
2. StorageDead(x) => mark x dead
3. If a local is moved from, _and has never had its address taken_, mark it dead
4. If (any part of) a local is initialized, mark it live'

This is used to determine whether to save a local in the generator object at all, as well as which locals can be overlapped in the generator layout.

Here's the size in bytes of all testcases included in the change, before and after the change:

async fn test    |Size before |Size after
-----------------|------------|----------
single           | 1028       | 1028
single_with_noop | 2056       | 1032
joined           | 5132       | 3084
joined_with_noop | 8208       | 3084

generator test              |Size before |Size after
----------------------------|------------|----------
move_before_yield           | 1028       | 1028
move_before_yield_with_noop | 2056       | 1032
overlap_move_points         | 3080       | 2056

## Future work

Note that there is a possible extension to this optimization, which modifies rule 3 to read: "If a local is moved from, _**and either has never had its address taken, or is Freeze and has never been mutably borrowed**_, mark it dead." This was discussed at length in rust-lang#59123 and then rust-lang#61849. Because this would cause some behavior to be UB which was not UB before, it's a step that needs to be taken carefully.

A more immediate priority for me is inlining `std::mem::size_of_val(&x)` so it becomes apparent that the address of `x` is not taken. This way, using `size_of_val` to look at the size of your inner futures does not affect the size of your outer future.

cc @cramertj @eddyb @Matthias247 @nikomatsakis @RalfJung @Zoxc
rustc: use a separate copy of P for HIR than for AST.

Note: this currently includes/is based on top of rust-lang#61987.

Like rust-lang#61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation.
There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle.

r? @petrochenkov cc @rust-lang/compiler
…2, r=eddyb

Remove io::Result from syntax::print

Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure
Add debug assertions to write_bytes and copy*

Looks like @nitnelave  went MIA in rust-lang#58783, so I am re-submitting their PR, tweaked just a bit. I took care to preserve commit authorship.

Cc rust-lang#53871
…links, r=docs

Add missing links for TryFrom docs

r? @rust-lang/docs
…s, r=petrochenkov

Move some tests in src/test/compile-fail -> src/test/ui

This is a subset of rust-lang#62113.

Hopefully everything here sticks, but if it doesn't I'll remove tests until it does.

r? @petrochenkov
std: Move a process test out of libstd

This commit moves a test out of libstd which is causing deadlocks on
musl on CI. Looks like the recent update in musl versions brings in some
internal updates to musl which makes `setgid` and `setuid` invalid to
call after a `fork` in a multithreaded program. The issue seen here is
that the child thread was attempting to grab a lock held by a
nonexistent thread, meaning that the child process simply deadlocked
causing the whole test to deadlock.

This commit moves the test to its own file with no threads which should
work.
…ks-into, r=docs

Add missing type urls in Into trait

r? @rust-lang/docs
import gdb for explicit access to gdb.current_objfile()
@Manishearth
Copy link
Member Author

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Jul 2, 2019

📌 Commit fddcb19 has been approved by Manishearth

@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 Jul 2, 2019
@bors
Copy link
Contributor

bors commented Jul 2, 2019

⌛ Testing commit fddcb19 with merge e25c0a86017dd4feff85aae02716234f1fd724a0...

@bors
Copy link
Contributor

bors commented Jul 2, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 2, 2019
@mati865
Copy link
Contributor

mati865 commented Jul 2, 2019

diff of stderr:

1	error: extern location for std does not exist: 
2	
3	error[E0463]: can't find crate for `std`
+	   |
+	   = note: the `i586-unknown-linux-gnu` target may not be installed
4	
5	error: aborting due to 2 previous errors
6	

Looks like introduced by #62177

@Centril Centril closed this Jul 2, 2019
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
@Manishearth Manishearth deleted the rollup-y7ejw2l branch June 22, 2020 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.