bors [Wed, 1 May 2019 17:24:11 +0000 (17:24 +0000)]
Auto merge of #60435 - Centril:rollup-aa5lmuw, r=Centril
Rollup of 7 pull requests
Successful merges:
- #60287 (Use references for variances_of)
- #60327 (Search for incompatible universes in borrow errors)
- #60330 (Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1)
- #60366 (build-gcc: Create missing cc symlink)
- #60369 (Support ZSTs in DispatchFromDyn)
- #60404 (Implement `BorrowMut<str>` for `String`)
- #60417 (Rename hir::ExprKind::Use to ::DropTemps and improve docs.)
bors [Wed, 1 May 2019 12:21:04 +0000 (12:21 +0000)]
Auto merge of #60137 - eddyb:rustdoc-rm-def-ctor-hax, r=petrochenkov
rustdoc: remove def_ctor hack.
~~No longer necessary since we have `describe_def`.~~
Turns out `def_ctor` was used in conjunction with abusing `tcx.type_of(def_id)` working on both type definitions and `impl`s (specifically, of builtin types), but also reimplementing a lot of the logic that `Clean` already provides on `Ty` / `ty::TraitRef`.
The first commit now does the minimal refactor to keep it working, while the second commit contains the rest of the refactor I started (parts of which I'm not sure we need to keep).
Rollup merge of #60366 - lzutao:patch-1, r=pietroalbini
build-gcc: Create missing cc symlink
This PR mostly fixes build error caused by using rustc docker images
to build [rustup][1] (with the error: ``linker `cc` not found``).
I don't know why gcc build script doesn't install cc hard link by default.
In build log, with `make SHELL='sh -x' install`, gcc build script installs c++
hard link but not `cc` one:
```bash
if test "" != "yes" ; then \
rm -f /rustroot/bin/g++; \
/usr/bin/install -c xg++ /rustroot/bin/g++; \
chmod a+x /rustroot/bin/g++; \
rm -f /rustroot/bin/c++; \
( cd /rustroot/bin && \
ln g++ c++ ); \
if [ -f cc1plus ] ; then \
if [ ! -f g++-cross ] ; then \
rm -f /rustroot/bin/x86_64-unknown-linux-gnu-g++; \
( cd /rustroot/bin && \
ln g++ x86_64-unknown-linux-gnu-g++ ); \
rm -f /rustroot/bin/x86_64-unknown-linux-gnu-c++; \
( cd /rustroot/bin && \
ln c++ x86_64-unknown-linux-gnu-c++ ); \
fi ; \
fi; \
fi
```
This might be fixed downstream by manually creating cc hard link
or setting `RUSTFLAGS="-C linker=gcc"` as [suggested by @mati865][2].
But I find it better to fix it upstream in this PR.
Auto merge of #60204 - jethrogb:jb/rtunwrap-debug-print, r=alexcrichton
Debug-print error when using rtunwrap
When I added this macro a while back I didn't have a way to make it print the failure for all types that you might want to unwrap. Now, I came up with a solution.
Auto merge of #60262 - michaelwoerister:pgo-preinlining-pass, r=alexcrichton
PGO: Add a run-make test that makes sure that PGO profiling data is used by the compiler during optimizations.
From the tests comment section:
```
# This test makes sure that PGO profiling data leads to cold functions being
# marked as `cold` and hot functions with `inlinehint`.
# The test program contains an `if` were actual execution only ever takes the
# `else` branch. Accordingly, we expect the function that is never called to
# be marked as cold.
```
Rollup merge of #60382 - Manishearth:revert-code-font, r=GuillaumeGomez
Revert "Update Source Code Pro fonts to version 2.030"
Temporary fix for https://github.com/rust-lang/rust/issues/60365
https://github.com/rust-lang/rust/pull/60146 updated all fonts (not just the fonts that were buggy), however it looks like the new Source Code Pro is buggy.
We should test this out of tree: `cargo doc` on anything, replace the font in `target/doc`, and use `python -m SimpleHTTPServer` to see what's going on.
Rollup merge of #60344 - Aaron1011:fix/tower-hyper, r=eddyb
Don't try to render auto-trait bounds with any inference variables
Previously, we checked if the target of a projection type was itself an
inference variable. However, for Rustdoc rendering purposes, there's no
distinction between an inference variable ('_') and a type containing
one (e.g. (MyStruct<u8, _>)) - we don't want to render either of them.
Fixes #60269
Due to the complexity of the original bug, which spans three different
crates (hyper, tower-hyper, and tower), I have been unable to create a
minimized reproduction for the issue.
Auto merge of #60389 - Centril:rollup-nefreyr, r=Centril
Rollup of 4 pull requests
Successful merges:
- #59869 (SGX target: implemented vectored I/O)
- #60238 (Update rustfmt to 1.2.2)
- #60276 (Cleanup the MIR visitor)
- #60380 (Fix line number display in source view)
Rollup merge of #60276 - matthewjasper:cleanup-mir-visitor, r=estebank
Cleanup the MIR visitor
* Remove useless `BasicBlock` parameters on methods with `Location`s.
* Prefer `visit_terminator_kind` to `visit_terminator`.
* Remove `Region` from PlaceContexts. `visit_rvalue` should be used when the region is important.
* Remove unused visitor methods.
Auto merge of #60006 - nnethercote:json-for-pipelining, r=alexcrichton
In JSON output, emit a directive after metadata is generated.
To implement pipelining, Cargo needs to know when metadata generation is
finished. This is done via a new JSON "directive".
Unfortunately, metadata file writing currently occurs very late during
compilation, so pipelining won't produce a speed-up. Moving metadata
file writing earlier will be a follow-up.
In JSON output, emit a directive after metadata is generated.
To implement pipelining, Cargo needs to know when metadata generation is
finished. This commit adds code to do that. Unfortunately, metadata file
writing currently occurs very late during compilation, so pipelining
won't produce a speed-up. Moving metadata file writing earlier will be a
follow-up.
The change involves splitting the existing `Emitter::emit` method in
two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`.
The JSON directives look like this:
```
{"directive":"metadata file written: liba.rmeta"}
```
The functionality is behind the `-Z emit-directives` option, and also
requires `--error-format=json`.
Auto merge of #60377 - Centril:rollup-42fxe9u, r=Centril
Rollup of 9 pull requests
Successful merges:
- #59946 (Fix equivalent string in escape_default docs)
- #60256 (Option::flatten)
- #60305 (hir: remove LoweredNodeId)
- #60334 (Stabilized vectored IO)
- #60353 (Add test not to forget resolved ICE)
- #60356 (Stabilize str::as_mut_ptr)
- #60358 (Clarify the short explanation of E0207)
- #60359 (resolve: Consider erroneous imports used to avoid duplicate diagnostics)
- #60360 (Add test case for labeled break in const assignment)
Rollup merge of #60358 - nickolay:patch-1, r=GuillaumeGomez
Clarify the short explanation of E0207
After being greatly improved in #33692, https://doc.rust-lang.org/error-index.html#E0207 uses terminology from the related RFC, which is different from the [reference](https://doc.rust-lang.org/reference/items/implementations.html), e.g. "self type" instead of "implementing type" and "trait reference" instead of "implemented trait".
It probably makes no difference to an experienced reader, but for a newbie like me it added to the confusion as you can't look up the definition of the terms being used and can't be sure you've guessed correctly...
I would also move the link to RFC to the top, as it seems to be the only doc that attempts to explain what the third criteria entails), but it seems to go against the accepted style.
Rollup merge of #60334 - sfackler:stable-iovec, r=alexcrichton
Stabilized vectored IO
This renames `std::io::IoVec` to `std::io::IoSlice` and
`std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes
`std::io::IoSlice`, `std::io::IoSliceMut`,
`std::io::Read::read_vectored`, and `std::io::Write::write_vectored`.