The paragraph described a case where we can't optimize away repetitive
dynamic stack allocation. However, as arielb1 pointed out, it can
actually optimizable by dynamically delaying the stack unwinding.
This way the process we get by calling rust-{gdb,lldb} is an actual
{gdb,lldb} instance and not (perhaps surprisingly) a script waiting for
the debugger process to finish. Thus, sending a SIGINT to the spawned
process stops execution of the child, for example.
std: stop backtracing when the frames are full
This is a defensive measure to mitigate the infinite unwind loop seen in #53372. That case will still repeatedly unwind `__rust_try`, but now it will at least stop when `cx.frames` is full.
r? @alexcrichton
[NLL] Returns are interesting for free regions
Based on #53088 - creating now to get feedback.
Closes#51175
* Make assigning to the return type interesting.
* Use "returning this value" instead of "return" in error messages.
* Prefer one of the explanations that we have a name for to a generic interesting cause in some cases.
* Treat causes that involve the destination of a call like assignments.
Non-naive implementation of `VecDeque.append`
Replaces the old, simple implementation with a more manual (and **unsafe** 😱) one. I've added 1 more test and verified that it covers all 6 code paths in the function.
This new implementation was about 60% faster than the old naive one when I tried benchmarking it.
Set more llvm function attributes for __rust_try
This shim is generated elsewhere in the compiler so this commit adds support to
ensure it goes through similar paths as the rest of the compiler to set llvm
function attributes like target features.
cc #53372
Make some ported cfail tests robust w.r.t. NLL
Updated the most glaring instances of weak tests w.r.t. NLL that came from #53196.
See also the bulletpoint list on #53351.
Rollup of 11 pull requests
Successful merges:
- #52858 (Implement Iterator::size_hint for Elaborator.)
- #53321 (Fix usage of `wasm_target_feature`)
- #53326 ([nll] add regression test for issue #27868)
- #53347 (rustc_resolve: don't allow paths starting with `::crate`.)
- #53349 ([nll] add tests for #48697 and #30104)
- #53357 (Pretty print btreemap for GDB)
- #53358 (`{to,from}_{ne,le,be}_bytes` for unsigned integer types)
- #53406 (Do not suggest conversion method that is already there)
- #53407 (make more ported compile fail tests more robust w.r.t. NLL)
- #53413 (Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.)
- #53434 (wasm: Remove --strip-debug argument to LLD)
Failed merges:
r? @ghost
wasm: Remove --strip-debug argument to LLD
Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.
make more ported compile fail tests more robust w.r.t. NLL
This is similar to PR #53369, except it covers a disjoint (and much smaller) set of tests that I needed to look at more carefully before being 100% certain they were the same kind of issue.
[nll] add tests for #48697 and #30104
Adds tests for the following issues:
- #48697 ``[NLL] ICE: unexpected region for local data with reference to closure``
- #30104 ``Destructuring boxes into multiple mutable references seems broken``
r? @nikomatsakis
[nll] add regression test for issue #27868
Adds a test for #27868 ``Inconsistent evaluation order for assignment operations``
apart of #47366 ``tracking issue for bugs fixed by the MIR borrow checker or NLL``
r? @nikomatsakis
Fix usage of `wasm_target_feature`
Currently usage results in:
```
error: internal compiler error: librustc_typeck/collect.rs:1928: unknown target feature gate wasm_target_feature
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:579:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.30.0-nightly (d5a448b3f 2018-08-13) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C linker=/tmp/lld-shim -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `coresimd`.
To learn more, run the command again with --verbose.
```
and hopefully this should fix the ICE!
The wrong target triple was used for lldb in build-manifest. lldb is
only built for macOS, so update the triple to reflect that.
This is an attempt to fix bug#48168.