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 7 pull requests #68225

Closed
wants to merge 30 commits into from

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

Mark-Simulacrum and others added 30 commits January 1, 2020 15:22
This fixes a bug where after calling pad_integral with appropriate flags, the
fill and alignment flags would be set to '0' and 'Right' and left as such even
after exiting pad_integral, which meant that future calls on the same Formatter
would get incorrect flags reported.

This is quite difficult to observe in practice, as almost all formatting
implementations in practice don't call `Display::fmt` directly, but rather use
`write!` or a similar macro, which means that they cannot observe the effects of
the wrong flags (as `write!` creates a fresh Formatter instance). However, we
include a test case.
Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.
This avoids a strange linker error that we get with only "--emit=mir"
and "check-pass"
…on unevaluated consts

which requires a lot of unnecessary work to evaluate them further down the line.
This is primarily updating the `curl` dependency, but also went ahead
and applied a few updates for other packages that Cargo depends on.
…dependent on the

number of bits within consts.
…ation, r=oli-obk

Add unreachable propagation mir optimization pass

@oli-obk suggested we create a MIR pass that optimizes away basic blocks that lead only to basic blocks with terminator kind **unreachable**. This is a first take on this, which we started with @gilescope at RustFest Impl Days.

The test currently fails when the compiled program runs (undefined behaviour). Is there a way to avoid running the compiled program?
…al, r=dtolnay

Reset Formatter flags on exit from pad_integral

This fixes a bug where after calling pad_integral with appropriate flags, the
fill and alignment flags would be set to '0' and 'Right' and left as such even
after exiting pad_integral, which meant that future calls on the same Formatter
would get incorrect flags reported.

This is quite difficult to observe in practice, as almost all formatting
implementations in practice don't call `Display::fmt` directly, but rather use
`write!` or a similar macro, which means that they cannot observe the effects of
the wrong flags (as `write!` creates a fresh Formatter instance). However, we
include a test case.

A manual check leads me to believe this is the only case where we failed to reset the flags appropriately, but I could have missed something.
…, r=matthewjasper,oli-obk

Don't run const propagation on items with inconsistent bounds

Fixes rust-lang#67696

Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.
…rk-Simulacrum

Update some of Cargo's dependencies

This is primarily updating the `curl` dependency, but also went ahead
and applied a few updates for other packages that Cargo depends on.
Clean up some diagnostics by making them more consistent

In general:

- Diagnostic should start with a lowercase letter.
- Diagnostics should not end with a full stop.
- Ellipses contain three dots.
- Backticks should encode Rust code.

I also reworded a couple of messages to make them read more clearly.

It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics.

r? @Centril
perf: Eagerly convert literals to consts

Previousely even literal constants were being converted to an `Unevaluted` constant for evaluation later. This seems unecessary as no more information is needed to be able to convert the literal to a mir constant.

Hopefully this will also minimise the performance impact of rust-lang#67717, as far less constant evaluations are needed.
@Dylan-DPC-zz
Copy link
Author

@bors r+ p=7 rollup=never

@bors
Copy link
Contributor

bors commented Jan 14, 2020

📌 Commit e083990 has been approved by Dylan-DPC

@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 Jan 14, 2020
@Dylan-DPC-zz Dylan-DPC-zz added the rollup A PR which is a rollup label Jan 14, 2020
@JohnTitor
Copy link
Member

image

Homu doesn't seem to get up...
@bors retry

@bors
Copy link
Contributor

bors commented Jan 14, 2020

⌛ Testing commit e083990 with merge 694966a78c33cbcffdae0daa98039475fbcbf6ec...

@rust-highfive
Copy link
Collaborator

The job dist-powerpc-linux of your PR failed (pretty log, 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.
2020-01-15T00:54:44.5946188Z [RUSTC-TIMING] rustfmt test:false 12.009
2020-01-15T00:54:47.7791839Z [RUSTC-TIMING] rustfmt_format_diff test:false 3.923
2020-01-15T00:54:51.8097372Z [RUSTC-TIMING] git_rustfmt test:false 7.209
2020-01-15T00:54:51.8125294Z     Finished release [optimized] target(s) in 8m 21s
2020-01-15T00:54:51.8327559Z duplicate artifacts found when compiling a tool, this typically means that something was recompiled because a transitive dependency has different features activated than in a previous build:
2020-01-15T00:54:51.8329838Z the following dependencies are duplicated although they have the same features enabled:
2020-01-15T00:54:51.8330071Z the following dependencies have different features:
2020-01-15T00:54:51.8330071Z the following dependencies have different features:
2020-01-15T00:54:51.8330640Z   syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)
2020-01-15T00:54:51.8332040Z     `rustfmt` additionally enabled features {"full"} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/powerpc-unknown-linux-gnu/release/deps/libsyn-c46f31f7c0d3689b.rlib"
2020-01-15T00:54:51.8332651Z     `cargo` additionally enabled features {} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/powerpc-unknown-linux-gnu/release/deps/libsyn-e2851189709bbdb1.rlib"
2020-01-15T00:54:51.8332942Z 
2020-01-15T00:54:51.8333730Z to fix this you will probably want to edit the local src/tools/rustc-workspace-hack/Cargo.toml crate, as that will update the dependency graph to ensure that these crates all share the same feature set
2020-01-15T00:54:51.8334292Z thread 'main' panicked at 'tools should not compile multiple copies of the same crate', src/bootstrap/tool.rs:195:13
2020-01-15T00:54:51.8372166Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host powerpc-unknown-linux-gnu --target powerpc-unknown-linux-gnu
2020-01-15T00:54:51.8372532Z Build completed unsuccessfully in 1:19:46
2020-01-15T00:54:51.8413280Z == clock drift check ==
2020-01-15T00:54:51.8428130Z   local time: Wed Jan 15 00:54:51 UTC 2020
2020-01-15T00:54:51.8428130Z   local time: Wed Jan 15 00:54:51 UTC 2020
2020-01-15T00:54:52.0327230Z   network time: Wed, 15 Jan 2020 00:54:52 GMT
2020-01-15T00:54:52.0329446Z == end clock drift check ==
2020-01-15T00:54:53.2112117Z 
2020-01-15T00:54:53.2194637Z ##[error]Bash exited with code '1'.
2020-01-15T00:54:53.2230608Z ##[section]Starting: Checkout
2020-01-15T00:54:53.2232283Z ==============================================================================
2020-01-15T00:54:53.2232369Z Task         : Get sources
2020-01-15T00:54:53.2232430Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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
Copy link
Contributor

bors commented Jan 15, 2020

💔 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 Jan 15, 2020
@Dylan-DPC-zz
Copy link
Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 15, 2020
@Dylan-DPC-zz
Copy link
Author

@bors r-

closing this in favour of a fresher rollup

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 15, 2020
@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-r7694q2 branch January 15, 2020 06:30
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-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.