Josh Stone [Wed, 4 Sep 2019 23:02:31 +0000 (16:02 -0700)]
Assume non-git LLVM is fresh if the stamp file exists
Rustbuild usually writes the LLVM submodule commit in a stamp file, so
we can avoid rebuilding it unnecessarily. However, for builds from a
source tarball (non-git), we were assuming a rebuild is always needed.
This can cause a lot of extra work if any environment like `CFLAGS`
changed between steps like build and install, which are often separate
in distro builds.
Now we also write an empty stamp file if the git commit is unknown, and
its presence is trusted to indicate that no rebuild is needed. An info
message reports that this is happening, along with the stamp file path
that can be deleted to force a rebuild anyway.
Auto merge of #63825 - nathanwhit:check-run-results, r=Mark-Simulacrum
Allow checking of run-pass execution output in compiletest
Closes #63751
Adds a `check-run-results` flag to compiletest headers, which if enabled checks the output of the execution of a run-pass test's binary against expected output.
Auto merge of #63166 - ksqsf:master, r=alexcrichton
Add Result::cloned{,_err} and Result::copied{,_err}
This is a little nice addition to `Result`.
1. I'm not sure how useful are `cloned_err` and `copied_err`, but for the sake of completeness they are here.
2. Naming is similar to `map`/`map_err`. I thought about naming `cloned` as `cloned_ok` and add another method called `cloned` that clones both Ok and Err, but `cloned_ok` should be more prevalent than `cloned_both`.
The remote-test-client outputs a message of the form "uploaded
"<build_dir>/<executable_path>", waiting for result" onto stdout when
executing a test, which is then captured in the process result. This needs to be removed when
comparing the results of the run-pass test execution.
Auto merge of #64127 - Centril:rollup-dfgb9h8, r=Centril
Rollup of 5 pull requests
Successful merges:
- #64049 (Emit a single error on if expr with expectation and no else clause)
- #64056 (Account for arbitrary self types in E0599)
- #64058 (librustc_errors: Extract sugg/subst handling into method)
- #64071 (use just one name when parameters and fields are the same)
- #64104 (Emit error on intrinsic to fn ptr casts)
Rollup merge of #64104 - Mark-Simulacrum:intrinsic-fn-ptr-ice, r=estebank
Emit error on intrinsic to fn ptr casts
I'm not sure if a type error is the best way of doing this but it seemed like a relatively correct place to do it, and I expect this is a pretty rare case to hit anyway.
Rollup merge of #64058 - phansch:refactor_out_method, r=estebank
librustc_errors: Extract sugg/subst handling into method
An initial refactoring before working on #61809.
This moves the whole block into a method so that it can be reused in the
annotate-snippet emitter. The method is already used in the new emitter, but
there's no UI tests with suggestions included in this PR.
A first look at some UI tests with suggestions showed that there's some
more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the new output is closer to the
current one, so I opted to do that in a second step.
Auto merge of #63869 - GuillaumeGomez:fix-build-failure, r=Mark-Simulacrum
Fix build failure in case file doesn't exist
It fixes the following issue:
```bash
$ ./x.py test src/tools/linkchecker ./build/x86_64-apple-darwin/doc/ --stage 1
Updating only changed submodules
Submodules updated in 0.05 seconds
Finished dev [unoptimized] target(s) in 0.15s
thread 'main' panicked at 'source "/Users/imperio/rust/rust/build/x86_64-apple-darwin/doc/version_info.html" failed to get metadata: No such file or directory (os error 2)', src/build_helper/lib.rs:179:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failed to run: /Users/imperio/rust/rust/build/bootstrap/debug/bootstrap test src/tools/linkchecker ./build/x86_64-apple-darwin/doc/ --stage 1
Build completed unsuccessfully in 0:00:01
```
If the file doesn't exist, it makes sense anyway to just run the command in order to generate it.
Auto merge of #63561 - HeroicKatora:alloc-private-bytes, r=oli-obk
Make Allocation::bytes private
Fixes #62931.
Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic.
Ignores run-pass tests with the `check-run-results` flag enabled for the
wasm32-bare ("wasm32-unknown-unknown") target, as it does not support
printing to stdout/stderr.
Auto merge of #63870 - estebank:async-fn-call, r=oli-obk
Suggest call fn ctor passed as arg to fn with type param bounds
_Reviewer note: the relevant changes are in the second commit, the first is simple and mechanical, but verbose._
When forgetting to call a fn in an argument position to an fn that has a generic bound:
```rust
async fn foo() {}
fn bar(f: impl Future<Output=()>) {}
fn main() {
bar(foo); // <- should be `bar(foo());`
}
```
suggest calling it:
```
error[E0277]: the trait bound `fn() -> impl std::future::Future {foo}: std::future::Future` is not satisfied
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:5
|
LL | fn bar(f: impl Future<Output=()>) {}
| --------------------------------- required by `bar`
...
LL | bar(foo);
| ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}`
|
= help: it looks like you forgot to use parentheses to call the function: `foo()`
```
Auto merge of #64057 - Centril:rollup-nwtk2fb, r=Centril
Rollup of 5 pull requests
Successful merges:
- #63410 (Update BufWriter example to include call to flush())
- #64029 (Account for rounding errors when deciding the diagnostic boundaries)
- #64032 (rustdoc use -Ccodegen-units=1 by default for test compile)
- #64039 (Update sync condvar doc style)
- #64042 (Fix word repetition in str documentation)
Philipp Hansch [Sun, 1 Sep 2019 10:15:33 +0000 (12:15 +0200)]
librustc_errors: Extract sugg/subst handling into method
An initial refactoring before working on #61809.
This moves the whole block into a method so that it can be reused in the
annotate-snippet output. It's already used in the new emitter, but
there's no UI tests with suggestions included in this PR.
A first look at some UI tests with suggestions showed that there's some
more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the
new output is closer to the current one.
Rollup merge of #64032 - andjo403:codegen-units, r=Mark-Simulacrum
rustdoc use -Ccodegen-units=1 by default for test compile
as the test is small we do not want split up in multiple codegen units
and also as there is multiple test running at the same time this
will reduce the number of concurrent threads
tested the test time with `./x.py test src/libcore --doc`
for my 16 core 32 thread cpu i get about 6% faster execution
and my 2 core 4 thread cpu I get about 10% faster execution
Rollup merge of #63410 - johnterickson:master, r=joshtriplett
Update BufWriter example to include call to flush()
I was playing with a writing a Huffman encoder/decoder and was getting weird corruptions and truncations. I finally realized it was was because `BufWriter` was swallowing write errors 😬. I've found Rust to generally be explicit and err on the safe side, so I definitely found this unintuitive and not "rustic".
Esteban Küber [Sat, 31 Aug 2019 02:47:21 +0000 (19:47 -0700)]
Tweak terminal width trimming
Properly account for left margin when setting terminal width through
CLI flag and don't trim code by default if we can't get the terminal's
dimensions.
Andreas Jonson [Fri, 30 Aug 2019 19:26:04 +0000 (21:26 +0200)]
rustdoc use -Ccodegen-units=1 by default for test compile
as the test is small we do not want split up in multiple codegen units
and also as there is multiple test running at the same time this
will reduce the number of concurrent threads
Oliver Scherer [Sun, 19 May 2019 18:16:04 +0000 (20:16 +0200)]
Add a "diagnostic item" scheme
This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.
Rollup merge of #63979 - alexcrichton:remove-wasm-syscall, r=dtolnay
std: Remove the `wasm_syscall` feature
This commit removes the `wasm_syscall` feature from the
wasm32-unknown-unknown build of the standard library. This feature was
originally intended to allow an opt-in way to interact with the
operating system in a posix-like way but it was never stabilized.
Nowadays with the advent of the `wasm32-wasi` target that should
entirely replace the intentions of the `wasm_syscall` feature.
Rollup merge of #63956 - alexcrichton:fix-lto-all-cached, r=michaelwoerister
rustc: Handle modules in "fat" LTO more robustly
When performing a "fat" LTO the compiler has a whole mess of codegen
units that it links together. To do this it needs to select one module
as a "base" module and then link everything else into this module.
Previously LTO passes assume that there's at least one module in-memory
to link into, but nowadays that's not always true! With incremental
compilation modules may actually largely be cached and it may be
possible that there's no in-memory modules to work with.
This commit updates the logic of the LTO backend to handle modules a bit
more uniformly during a fat LTO. This commit immediately splits them
into two lists, one serialized and one in-memory. The in-memory list is
then searched for the largest module and failing that we simply
deserialize the first serialized module and link into that. This
refactoring avoids juggling three lists, two of which are serialized
modules and one of which is half serialized and half in-memory.