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 10 pull requests #59300

Closed
wants to merge 31 commits into from
Closed

Rollup of 10 pull requests #59300

wants to merge 31 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 19, 2019

Successful merges:

Failed merges:

r? @ghost

matthewjasper and others added 30 commits March 3, 2019 20:34
This also ensure that dropping a generator won't leak upvars if dropping
one of them panics
There are two moments when a BufRead object needs to empty it's internal
buffer:

- In a seek call;
- In a read call when all data in the internal buffer had been already
  consumed and the output buffer has a greater or equal size than the
  internal buffer.

In both cases, the buffer was not being properly emptied, but only
marked as consumed (self.pos = self.cap). That should be no problem if
the inner reader is only Read, but if it is Seek as well, then it's
possible to access the data in the buffer by using the seek_relative
method. In order to prevent this from happening, both self.pos and
self.cap should be set to 0.

Two test cases were added to detect that failure:

- test_buffered_reader_invalidated_after_read
- test_buffered_reader_invalidated_after_seek

Both tests are very similar to each other. The inner reader contains the
following data: [5, 6, 7, 0, 1, 2, 3, 4]. The buffer capacity is 3
bytes.

- First, we call fill_buffer, which loads [5, 6, 7] into the internal
  buffer, and then consume those 3 bytes.
- Then we either read the 5 remaining bytes in a single read call or we
  move to the end of the stream by calling seek. In both cases the
  buffer should be emptied to prevent the previous data [5, 6, 7] from
  being read.
- We now call seek_relative(-2) and read two bytes, which should give us
  the last 2 bytes of the stream: [3, 4].

Before this commit, the the seek_relative method would consider that
we're still in the range of the internal buffer, so instead of fetching
data from the inner reader, it would return the two last bytes that were
incorrectly still in the buffer: [6, 7]. Therefore, the test would fail.

Now, when seek_relative is called the buffer is empty. So the expected
data [3, 4] is fetched from the inner reader and the test passes.
The pause instruction requires SSE2 but was being unconditionally used
on targets without it, resulting in undefined behavior.

This PR fixes that by only using the pause intrinsic if SSE2 is available.

It also removes the inline assembly which was not required since these
instructions are available in core::arch, and extends support of
the spin_loop hint to arm targets with the v6 feature which also
support the yield instruction.

Closes rust-lang#59237 .
When failing to parse struct-like enum variants, the ADT gets recorded
as having no fields. Record that we have actually recovered during
parsing of this variant to avoid complaing about non-existing fields
when actually using it.
…cks, r=davidtwco

Fixes for the generator transform

* Moves cleanup annotations in pretty printed MIR so that they can be tested
* Correctly determines which drops are in cleanup blocks when elaborating generator drops
* Use the correct state for poisoning a generator

Closes rust-lang#58892
…iplett

Add new test case for possible bug in BufReader

When reading a large chunk from a BufReader, if all the bytes from the buffer have been already consumed, the internal buffer is bypassed entirely. However, it is not invalidated, and it's possible to access its contents using the `seek_relative` method, because it tries to reuse the existing buffer.
…uietMisdreavus

Add default keyword handling in rustdoc

Fixes rust-lang#58898.

r? @QuietMisdreavus
…alexcrichton

Refactor tools/build-mainfest

I saw some duplication in rust-lang#58990 and got an itch... Will likely need to be rebased when that lands. Hopefully the PR should have zero semantic changes...

r? @alexcrichton
…r=steveklabnik

Update and clean up several parts of CONTRIBUTING.md
Remove inline assembly from hint::spin_loop

This PR removes the inline assembly which was not required since these
instructions are available in core::arch, and extends support of
the spin_loop hint to arm targets with the v6 feature which also
support the yield instruction.
…chenkov

Use a valid name for graphviz graphs

Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
Make meta-item API compatible with `LocalInternedString::get` soundness fix

r? @Zoxc
…etrochenkov

Do not complain about non-existing fields after parse recovery

When failing to parse struct-like enum variants, the ADT gets recorded
as having no fields. Record that we have actually recovered during
parsing of this variant to avoid complaing about non-existing fields
when actually using it.

Fix rust-lang#57361.
Do not encode gensymed imports in metadata

(Unless they are underscore `_` imports which are re-gensymed on crate loading, see rust-lang#56392.)

We cannot encode gensymed imports properly in metadata and if we encode them improperly, we can get erroneous name conflicts downstream.
Gensymed imports are produced by the compiler, so we control their set, and can be sure that none of them needs being encoded for use from other crates.

A workaround that fixes rust-lang#59243.
@Centril
Copy link
Contributor Author

Centril commented Mar 19, 2019

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Mar 19, 2019

📌 Commit 080332b 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 Mar 19, 2019
@bors
Copy link
Contributor

bors commented Mar 20, 2019

⌛ Testing commit 080332b with merge 98e7502420246e33a3b8e19aef7d9595fadb4033...

@bors
Copy link
Contributor

bors commented Mar 20, 2019

💔 Test failed - checks-travis

@rust-highfive
Copy link
Collaborator

The job dist-mips-linux of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:26:46]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:26:50] error: unused import: `arch`
[00:26:50]  --> src/libcore/hint.rs:5:6
[00:26:50]   |
[00:26:50] 5 | use {arch, intrinsics};
[00:26:50]   |
[00:26:50]   = note: `-D unused-imports` implied by `-D warnings`
[00:26:50] 
[00:26:51]    Compiling compiler_builtins v0.1.5
---
travis_time:end:04505ab0:start=1553054805465290997,finish=1553054805473411469,duration=8120472
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0840c6d2
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0dd4d810
travis_time:start:0dd4d810
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1019de4d
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@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 Mar 20, 2019
@Centril Centril closed this Mar 20, 2019
@Centril Centril deleted the rollup branch March 20, 2019 21:02
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
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.

10 participants