bors [Tue, 6 Nov 2018 18:58:31 +0000 (18:58 +0000)]
Auto merge of #53996 - sekineh:thumb-run, r=japaric
[CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded]
## What's included?
- Run a `thumbv7m-none-eabi` binary using `qemu-system-arm`
- We are using `cortex-m-rt = "=0.5.4"` which does not use `proc_macro`.
(reason: stage2 build of rustc does not work well with `proc_macro` in `run-make` phase.)
- We are using GNU LD for now.
## Blocker
All resolved.
- ~[Waiting] `#[panic_handler]` is not available in stable.~
- [Merged] https://github.com/rust-lang/rust/pull/53619
- ~[Waiting] https://github.com/japaric/lm3s6965evb: does not compile on stable.~
- [OK] dependent crate ~`panic-abort`~ `panic-halt`: already moved to use `#[panic_handler]`.
## Update
`#[panic_handler]` will be stabilized in Rust 1.30.
kennytm [Tue, 6 Nov 2018 07:21:10 +0000 (15:21 +0800)]
Rollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix
NLL Diagnostic Review 3: Missing errors for borrows of union fields
Fixes #55675.
This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.
kennytm [Tue, 6 Nov 2018 07:21:01 +0000 (15:21 +0800)]
Rollup merge of #55601 - petrochenkov:featissue, r=pnkfelix
Fix tracking issue numbers for some unstable features
And also remove deprecated unstable `#[panic_implementation]` attribute that was superseded by stable `#[panic_handler]` and doesn't have an open tracking issue.
kennytm [Tue, 6 Nov 2018 07:20:59 +0000 (15:20 +0800)]
Rollup merge of #55597 - alexcrichton:thread-local-inner, r=KodrAus
std: Enable usage of `thread_local!` through imports
The `thread_local!` macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
`#![no_std]` crate imported `std` and tried to use `thread_local!` it
would fail due to missing a lookup of an internal macro.
This commit switches the macro to instead use `$crate` to invoke other
macros, ensuring that it'll work when `thread_local!` is imported alone.
bors [Tue, 6 Nov 2018 04:04:33 +0000 (04:04 +0000)]
Auto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler
std: Improve codegen size of accessing TLS
Some code in the TLS implementation in libstd stores `Some(val)` into an
`&mut Option<T>` (effectively) and then pulls out `&T`, but it currently
uses `.unwrap()` which can codegen into a panic even though it can never
panic. With sufficient optimizations enabled (like LTO) the compiler can
see through this but this commit helps it along in normal mode
(`--release` with Cargo by default) to avoid codegen'ing the panic path.
This ends up improving the optimized codegen on wasm by ensuring that a
call to panic pulling in more file size doesn't stick around.
bors [Tue, 6 Nov 2018 01:20:58 +0000 (01:20 +0000)]
Auto merge of #55106 - petrhosek:fuchsia-lld, r=alexcrichton
Use lld directly for Fuchsia target
Fuchsia already uses lld as the default linker, so there's no reason
to always invoke it through Clang, instead we can simply invoke lld
directly and pass the set of flags that matches Clang.
Petr Hosek [Tue, 16 Oct 2018 00:27:07 +0000 (17:27 -0700)]
Use lld directly for Fuchsia target
Fuchsia already uses lld as the default linker, so there's no reason
to always invoke it through Clang, instead we can simply invoke lld
directly and pass the set of flags that matches Clang.
bors [Mon, 5 Nov 2018 19:29:57 +0000 (19:29 +0000)]
Auto merge of #55410 - nagisa:atomic-align, r=pnkfelix
Correct alignment of atomic types and (re)add Atomic{I,U}128
This is a updated https://github.com/rust-lang/rust/pull/53514 to also make atomic types `repr(C)` as per comment in https://github.com/rust-lang/rust/pull/53514#issuecomment-431042767.
Use `// revisions` in the dropck-eyepatch tests instead of relying on compare-mode=nll.
NLL has increased precision in its analysis of drop order, and we want
the test annotations to deliberately reflect this by having fewer
ERROR annotations for NLL than for AST-borrowck. The best way to get
this effect is via `// revisions`.
As a drive-by, also added uses of all the borrows just to make it
clear that NLL isn't somehow sidestepping things by using shorter
borrows than you might have otherwise expected. (Of course, the added
uses do not make all that much difference since the relevant types all
declare `impl Drop` and thus those drops have implicit uses anyway.)
This is a variant of `ui/borrowck/borrowck-closures-mut-of-imm.rs`
that I used to help identify what changes I needed to make to the
latter file in order to recover its instances of E0524 under NLL.
(Basically this test includes the changes you'd need to make to
`ui/borrowck/borrowck-closures-mut-of-imm.rs` in order to get rid of
occurrences of E0596. And then I realized that one needs to add
invocations of the closures in order to properly extend the mutable
reborrows in a manner such that NLL will roughly match AST-borrowck.)
"""
I believe that test can be removed outright. It'd be impossible for a
new change to go through that breaks this kind of output without it
being picked up by multiple other `stderr` tests. This is an artifact
of the transition period to the "new" output style.
"""
Remove `println!`'s from `ui/issues/issue-52126-assign-op-invariance.rs`
This is not strictly necessary to make this test "more robust with
respect to NLL"; its just an attempt to narrow the scope of the test
and focus on its core.
Switch to using revisions in borrowck-lend-flow-loop.rs
Most of the time we want to robustify tests, but in this case this
test is deliberately encoding artifacts of AST-borrowck. So instead
of adding artificial uses that would obscure the aspects of
AST-borrowck that are being tests, we instead use revisions and then
mark the cases that apply to NLL as well as AST-borrowck.
bors [Mon, 5 Nov 2018 09:48:46 +0000 (09:48 +0000)]
Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomez
rustdoc: refactor: centralize all command-line argument parsing
This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation.
One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time.
One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.
````
rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference)
Fix typo
Improve clippy_dev help text
RIIR update lints: Generate lint group registrations
Test clippy_dev on CI and fix test
RIIR update lints: Generate modules section
````
````
rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference)
Fix typo
Improve clippy_dev help text
RIIR update lints: Generate lint group registrations
Test clippy_dev on CI and fix test
RIIR update lints: Generate modules section
````
bors [Sun, 4 Nov 2018 18:56:43 +0000 (18:56 +0000)]
Auto merge of #55665 - eddyb:by-ref-layout-of, r=oli-obk
rustc_target: pass contexts by reference, not value.
`LayoutOf` now takes `&self` instead of `self`, and so does every method generic over a context that implements `LayoutOf` and/or other traits, like `HasDataLayout`, `HasTyCtxt`, etc.
Originally using by-value `Copy` types was relevant because `TyCtxt` was one of those types, but now `TyCtxt::layout_of` is separate from `LayoutOf`, and `TyCtxt` is not an often used layout context.
Passing these context by reference is a lot nicer for miri, which has `self: &mut EvalContext`, and needed `f(&self)` (that is, creating `&&mut EvalContext` references) for layout purposes.
Now, the `&mut EvalContext` can be passed to a function expecting `&C`, directly.
This should help with #54012 / #55627 (to not need `where &'a T::Cx: LayoutOf` bounds).
r? @nikomatsakis or @oli-obk or @nagisa cc @sunfishcode
David Wood [Sun, 4 Nov 2018 17:36:30 +0000 (18:36 +0100)]
Update test to force error under NLL.
In each of the three cases in this test, there is a mutable borrow
of some field of the union and then a shared borrow of some other field
immediately following.
Under NLL, the mutable borrow is killed straight away as it isn't
used later - therefore not causing a conflict with the shared borrow.
This commit adds a use of the first mutable borrow to force the intended
errors to appear under NLL.
bors [Sun, 4 Nov 2018 09:45:49 +0000 (09:45 +0000)]
Auto merge of #55432 - zackmdavis:single_life, r=nikomatsakis
single life
* structured ~~autofixable~~ (well, pending #53934 and rust-lang-nursery/rustfix#141) suggestions for the single-use-lifetimes lint in the case of function and method reference args
* don't consider the anonymous lifetime `'_` as "single-use" (it's intended for exactly this sort of thing)
bors [Sat, 3 Nov 2018 14:51:05 +0000 (14:51 +0000)]
Auto merge of #55646 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests
Successful merges:
- #54162 (Hide default impls items)
- #55555 (Make `-Z ls` list the actual filename of external dependencies)
- #55567 (add test for deriving Debug on uninhabited enum)
- #55568 (test that rustdoc doesn't overflow on a big enum)
- #55598 (publish-toolstate: ping maintainers when a tool builds again)
Guillaume Gomez [Sat, 3 Nov 2018 12:40:37 +0000 (13:40 +0100)]
Rollup merge of #55568 - durka:rustdoc-big-enum, r=nikomatsakis
test that rustdoc doesn't overflow on a big enum
Adds a test to close #25295. The test case depended on `enum_primitive` so I just basically pulled its source into an auxiliary file, is that the right way to do it?
Guillaume Gomez [Sat, 3 Nov 2018 12:40:34 +0000 (13:40 +0100)]
Rollup merge of #55555 - aidanhs:aphs-better-z-ls, r=alexcrichton
Make `-Z ls` list the actual filename of external dependencies
The hash is pointless for external consumers - extra_filename is the thing that actually gets used, per https://github.com/rust-lang/rust/blob/ca2639e/src/librustc_metadata/locator.rs#L312-L313
bors [Sat, 3 Nov 2018 09:33:10 +0000 (09:33 +0000)]
Auto merge of #55238 - alexcrichton:rm-jemalloc, r=estebank
Remove the `alloc_jemalloc` crate
This commit removes the `alloc_jemalloc` crate from the standard library and all related configuration. We will no longer be shipping this unstable crate. Rationale for this is provided on https://github.com/rust-lang/rust/issues/36963 and the many linked issues, but I can inline rationale here if desired!
We currently rely on jemalloc for increased perf in the Rust compiler, however. [This perf run shows](https://perf.rust-lang.org/compare.html?start=74ff7dcb1388e60a613cd6050bcd372a3cc4998b&end=7e7928dc0340d79b404e93f0c79eb4b946c1d669&stat=wall-time) that if we switch to glibc 2.23's allocator that it's slower than jemalloc across many benchmarks. [This perf run, however](https://perf.rust-lang.org/compare.html?start=22cc2ae8057d14e980b7c784e1eb2eee26b59e7d&end=10c95ccfa7a7adc12f4e608621ca29f9b98eed29), shows that if we use `jemalloc-sys` from crates.io then rustc actually gets faster across all benchmarks! (presumably because it has a more recent version of jemalloc than our submodule).
As a result, it's expected that this doesn't regress any code (as it's just removing an unstable crate) and it should actually improve rustc performance because it updates jemalloc.
bors [Sat, 3 Nov 2018 06:50:19 +0000 (06:50 +0000)]
Auto merge of #55363 - pietroalbini:update-cargo-vendor, r=Mark-Simulacrum
Bump cargo-vendor version
Currently we pin `cargo-vendor` to 0.1.4, which doesn't set the `User-Agent` HTTP header. crates.io is going to require that header in the near future, so this PR bumps the pinned version of the crate to the latest one (which correctly sets the header).