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 13 pull requests #65009

Merged
merged 38 commits into from
Oct 2, 2019
Merged

Rollup of 13 pull requests #65009

merged 38 commits into from
Oct 2, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 2, 2019

Successful merges:

Failed merges:

r? @ghost

GuillaumeGomez and others added 30 commits October 1, 2019 10:32
Co-Authored-By: Oliver Scherer <[email protected]>
This is needed to dump graphviz results for the `IndirectlyMutableLocals` analysis.
This also tests that `&&[]` no longer causes an ICE in this PR (although
the test fails the borrow checker). This could be more complete.
We now use `DataflowResultsCursor` to get the dataflow state before
calls to `rustc_peek`. The original version used a custom implementation
that only looked at assignment statements. This also extends
`rustc_peek` to take arguments by-value as well as by-reference, and
allows *all* dataflow analyses, not just those dependent on `MoveData`,
to be inspected.
`const_prop()` now handles writing the Rvalue into the Place in the
stack frame for us. So if we're not supported to propagate that value,
we need to clear it.
SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
…ode, r=Centril

Fix unreachable_code warnings for try{} block ok-wrapped expressions

Fixes rust-lang#54165 and fixes rust-lang#63324.
…ichaelwoerister

Remove inlines from DepNode code
…t, r=nikomatsakis

regression test for 64453 borrow check error.

Fix rust-lang#64453
…komatsakis

Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions

r? @oli-obk
…ing, r=Mark-Simulacrum

Improve sidebar styling to make its integration easier

Part of rust-lang/docs.rs#417

Setting the height was an error: forcing the element bottom to be at the bottom allows to change to top of the sidebar.

r? @Mark-Simulacrum
…-obk

Make comment about dummy type a bit more clear
Don't mark borrows of zero-sized arrays as indirectly mutable

Resolves rust-lang#64945

r? @oli-obk
…r=alexcrichton

Fix typo while setting `compile-flags` in test

This test is meant to check for an ICE when generating debug info, but didn't actually pass `-g` due to the typo.

I also removed the `FIXME`, since this needs to actually be built (not just checked) to trigger the ICE.
…=oli-obk

Enable support for `IndirectlyMutableLocals` in `rustc_peek`

This PR allows `rustc_peek` tests to be written for the `IndirectlyMutableLocals` analysis implemented in rust-lang#64470. See any of the tests in [`test/ui/mir-dataflow`](https://github.com/rust-lang/rust/blob/master/src/test/ui/mir-dataflow/inits-1.rs) for an example.

Included in this PR is a major rewrite of the `rustc_peek` module. This was motivated by the differences between the `IndirectlyMutableLocals` analysis and the initialized places ones.

To properly test `IndirectlyMutableLocals`, we must pass locals by-value to `rustc_peek`, since any local that is not `Freeze` will be marked as indirectly mutable as soon as a reference to it is taken. Unfortunately, `UnsafeCell` is not `Copy`, so we can only do one `rustc_peek` on each value with interior mutability inside a test. I'm not sure how to deal with this restriction; perhaps I need to special case borrows preceding a call to `rustc_peek` in the analysis itself?

`rustc_peek` also assumed that the analysis was done on move paths and that its transfer function only needed to be applied at assignment statements. This PR removes both of those restrictions by adding a trait, `RustcPeekAt`, that controls how the peeked at `Place` maps to the current dataflow state and using a dataflow cursor to retrieve the state itself.

Finally, this PR adds a test which demonstrates some unsoundness in the `IndirectlyMutableLocals` analysis by converting a reference to a `Freeze` field to a reference to a `!Freeze` field by offsetting a pointer (or in this case transmuting a pointer to a ZST field with the same address as a `!Freeze` field). This does not represent a hole in the language proper, since this analysis is only used to validate `const` bodies, in which the unsound code will only compile with `-Zunleash-the-miri-inside-of-you`. Nevertheless, this should get fixed.

r? @oli-obk
Fix ICE rust-lang#64964

Fixes rust-lang#64964, which is an ICE with `await`ing in a method + incr-comp.
…p, r=oli-obk

[const-prop] Correctly handle locals that can't be propagated

`const_prop()` now handles writing the Rvalue into the Place in the
stack frame for us. So if we're not supposed to propagate that value,
we need to clear it.

r? @oli-obk

Fixes rust-lang#64970
…ing, r=Mark-Simulacrum

Remove rustdoc warning

Removes this warning:

```bash
    Finished release [optimized] target(s) in 2.62s
 Documenting core v0.0.0 (/home/imperio/rust/rust/src/libcore)
    Finished release [optimized] target(s) in 15.23s
 Documenting std v0.0.0 (/home/imperio/rust/rust/src/libstd)
    Finished release [optimized] target(s) in 17.30s
 Documenting proc_macro v0.0.0 (/home/imperio/rust/rust/src/libproc_macro)
    Finished release [optimized] target(s) in 2.36s
 Documenting test v0.0.0 (/home/imperio/rust/rust/src/libtest)
warning: `[0]` cannot be resolved, ignoring it...
    --> src/libtest/lib.rs:1112:41
     |
1112 |     /// supplied channel. Requires argv[0] to exist and point to the binary
     |                                         ^ cannot be resolved, ignoring
     |
     = note: `#[warn(intra_doc_link_resolution_failure)]` on by default
     = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

    Finished release [optimized] target(s) in 1.64s
Build completed successfully in 0:02:07
```
…evink

rustc book: nitpick SLP vectorization

SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
@Centril
Copy link
Contributor Author

Centril commented Oct 2, 2019

@bors r+ p=13 rollup=never

@bors
Copy link
Contributor

bors commented Oct 2, 2019

📌 Commit b961f96 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 Oct 2, 2019
@bors
Copy link
Contributor

bors commented Oct 2, 2019

⌛ Testing commit b961f96 with merge 2daa404...

bors added a commit that referenced this pull request Oct 2, 2019
Rollup of 13 pull requests

Successful merges:

 - #64581 (Fix unreachable_code warnings for try{} block ok-wrapped expressions)
 - #64850 (Remove inlines from DepNode code)
 - #64914 (regression test for 64453 borrow check error.)
 - #64922 (Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions)
 - #64948 (Improve sidebar styling to make its integration easier)
 - #64961 (Make comment about dummy type a bit more clear)
 - #64967 (Don't mark borrows of zero-sized arrays as indirectly mutable)
 - #64973 (Fix typo while setting `compile-flags` in test)
 - #64980 (Enable support for `IndirectlyMutableLocals` in `rustc_peek` )
 - #64989 (Fix ICE #64964)
 - #64991 ([const-prop] Correctly handle locals that can't be propagated)
 - #64995 (Remove rustdoc warning)
 - #64997 (rustc book: nitpick SLP vectorization)

Failed merges:

r? @ghost
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
@bors
Copy link
Contributor

bors commented Oct 2, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 2daa404 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 2, 2019
@bors bors merged commit b961f96 into rust-lang:master Oct 2, 2019
@Centril Centril deleted the rollup-06g05xj branch October 2, 2019 22:37
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.

10 participants