Commit Graph

82344 Commits

Author SHA1 Message Date
Masaki Hara
a0c422a752 Remove a now-unnecessary paragraph.
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.
2018-08-19 08:07:33 +09:00
Masaki Hara
438edc3d5e Update the unstable book regarding [e; dyn n]. 2018-08-19 08:07:33 +09:00
Masaki Hara
c72e87e30a Add an unstable-book article about unsized_locals. 2018-08-19 08:07:33 +09:00
Masaki Hara
800f2c13a3 Implement simple codegen for unsized rvalues. 2018-08-19 08:07:33 +09:00
Masaki Hara
e2b95cb70e Lift some Sized checks. 2018-08-19 08:07:33 +09:00
Masaki Hara
7f05304068 Add #![feature(unsized_locals)]. 2018-08-19 08:07:33 +09:00
Masaki Hara
cd0476a390 Add Builder::array_alloca. 2018-08-19 08:06:42 +09:00
Masaki Hara
9f0168a9f3 Add notes on unsized argument errors. 2018-08-19 08:06:42 +09:00
bors
a9fe312b98 Auto merge of #52592 - eddyb:or-default, r=Mark-Simulacrum
Use the new Entry::or_default method where possible.
2018-08-18 21:58:37 +00:00
bors
33b923fd44 Auto merge of #53324 - alexreg:self_in_typedefs, r=eddyb
`Self` in type definitions (self_in_typedefs)

This implements the [`self_in_typedefs` feature](https://github.com/rust-lang/rfcs/blob/master/text/2300-self-in-typedefs.md) ([tracking issue 49303](https://github.com/rust-lang/rust/issues/49303)).

r? @eddyb

CC @Centril
2018-08-18 19:34:24 +00:00
Jorge Aparicio
4bbedd7dd2 fully implement lld-flavor 2018-08-18 20:16:04 +02:00
Alexander Regueiro
4e7d3f5a5e Added page for feature to unstable book. 2018-08-18 18:56:31 +01:00
Alexander Regueiro
7920a65c5f Added tests. 2018-08-18 18:56:31 +01:00
Alexander Regueiro
cbcabcaac8 Added feature gate. 2018-08-18 18:56:29 +01:00
Alexander Regueiro
79009ed728 Updated diagnostics. 2018-08-18 18:54:44 +01:00
Alexander Regueiro
856e84f9a3 Resolve Self within type definitions.
Currently type definitions include `struct`, `enum`, `union`, `existential type`.
2018-08-18 18:54:41 +01:00
Eduard-Mihai Burtescu
14aed81d9a Use the new Entry::or_default method where possible. 2018-08-18 20:19:45 +03:00
bors
f0341412ed Auto merge of #53436 - cuviper:trace_fn-stop, r=alexcrichton
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
2018-08-18 17:15:31 +00:00
Jorge Aparicio
cafeb6f05b fatal -> bug 2018-08-18 17:19:42 +02:00
Jorge Aparicio
27390fcbcb wasm32-unknown-unknown uses the WASM LLD flavor 2018-08-18 16:36:24 +02:00
bors
a3ad012e2d Auto merge of #53286 - nagisa:cast-assumes, r=eddyb
Do not generate assumes for plain integer casts

I gave up on making anything more elegant for now.

r? @eddyb
2018-08-18 14:35:42 +00:00
Jorge Aparicio
750e72b9e0 add lld_flavor info to target spec
this field defaults to the LD / GNU flavor
2018-08-18 16:31:36 +02:00
bors
7de3dea2b7 Auto merge of #53175 - matthewjasper:more-return-stuff, r=nikomatsakis
[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.
2018-08-18 11:57:46 +00:00
bjorn3
d52047faf0 Remove LinkMeta struct 2018-08-18 12:08:06 +02:00
bors
d5b6b95aef Auto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapin
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.
2018-08-18 08:56:12 +00:00
bors
6b1ff19af3 Auto merge of #53437 - alexcrichton:fix-target-features, r=michaelwoerister
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
2018-08-18 02:50:39 +00:00
bors
4d5ef325e0 Auto merge of #53369 - pnkfelix:partial-53351-make-some-ported-compile-fail-tests-more-robust-wrt-nll, r=davidtwco
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.
2018-08-17 23:33:31 +00:00
bors
1fa944914c Auto merge of #53356 - michaelwoerister:itlto, r=alexcrichton
Preliminary work for incremental ThinLTO (CGU name edition)

Bring back the first half of #52266 but hopefully without the performance regression.
2018-08-17 21:24:22 +00:00
bors
c8c587fe4e Auto merge of #50911 - petrochenkov:macuse, r=alexcrichton
Stabilize `use_extern_macros`

Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17 19:10:34 +00:00
bors
de21ea8ff5 Auto merge of #53449 - frewsxcv:rollup, r=frewsxcv
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
2018-08-17 17:00:10 +00:00
Corey Farwell
f2146667af
Rollup merge of #53434 - alexcrichton:remove-strip-debug, r=yurydelendik
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.
2018-08-17 08:23:45 -07:00
Corey Farwell
5c7b837c4e
Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor
Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.

cc @varkor @petrochenkov @joshtriplett
2018-08-17 08:23:44 -07:00
Corey Farwell
5ad7b914c0
Rollup merge of #53407 - pnkfelix:partial-53351-make-more-ported-compile-fail-tests-more-robust-wrt-nll, r=nikomatsakis
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.
2018-08-17 08:23:43 -07:00
Corey Farwell
4cdcb23581
Rollup merge of #53406 - estebank:to_string-to_string, r=michaelwoerister
Do not suggest conversion method that is already there

Fix #53348.
2018-08-17 08:23:42 -07:00
Corey Farwell
f0764433f7
Rollup merge of #53358 - SimonSapin:int-bytes, r=shepmaster
`{to,from}_{ne,le,be}_bytes` for unsigned integer types

Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers.

Tracking issue: https://github.com/rust-lang/rust/issues/52963
2018-08-17 08:23:40 -07:00
Corey Farwell
18122e0db0
Rollup merge of #53357 - fukatani:pretty-print-btreemap, r=michaelwoerister
Pretty print btreemap for GDB

Merge #53112 first, please.
2018-08-17 08:23:39 -07:00
Corey Farwell
25aca443e6
Rollup merge of #53349 - memoryruins:nll-tests, r=nikomatsakis
[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
2018-08-17 08:23:38 -07:00
Corey Farwell
3de02d37ea
Rollup merge of #53347 - eddyb:no-crate-in-root, r=petrochenkov
rustc_resolve: don't allow paths starting with `::crate`.

cc @aturon @joshtriplett
r? @petrochenkov
2018-08-17 08:23:36 -07:00
Corey Farwell
9018807862
Rollup merge of #53326 - memoryruins:issue-27868-test, 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
2018-08-17 08:23:35 -07:00
Corey Farwell
c3b7483559
Rollup merge of #53321 - alexcrichton:wasm-target-feature, 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!
2018-08-17 08:23:34 -07:00
Corey Farwell
2578036f47
Rollup merge of #52858 - frewsxcv:frewsxcv-elaborator, r=SimonSapin
Implement Iterator::size_hint for Elaborator.

None
2018-08-17 08:23:33 -07:00
Tom Tromey
c37787eb93 Change target triple used to check for lldb in build-manifest
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.
2018-08-17 08:40:16 -06:00
bors
8dad6be9ad Auto merge of #53288 - RalfJung:dropck, r=nikomatsakis
unions are not always trivially dropable

Fixes #52786

r? @nikomatsakis
2018-08-17 14:16:54 +00:00
Simon Sapin
f5556a6a28 Gratuitous at byte boundaries in hex i32 literals in some doc-tests 2018-08-17 14:01:57 +02:00
bors
8b923a19ed Auto merge of #53190 - sekineh:thumb-cortex-m, r=jamesmunns
Add crate build test for `thumb*` targets. [IRR-2018-embedded]

## Summary

This PR adds `run-make` test that compiles `cortex-m` crate for all supported `thumb*-none-*` targets using `cargo` and stage2 `rustc`.

- Supported `thumb*-none-*` targets:
  - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)
  - thumbv7em-none-eabi (Bare Cortex-M4, M7)
  - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
  - thumbv7m-none-eabi (Bare Cortex-M3)

## How to run & Example output
I tested locally and all targets succeeded like below:
```
./x.py clean
./x.py test --target thumbv6m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv7m-none-eabi src/test/run-make
```
```
Check compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu -> thumbv6m-none-eabi)

running 5 tests
.....
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```

## How to re-run

Remove `stamp` file for the test run.
```
rm build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/stamp
```
Then run `test`
```
./x.py test --target thumbv6m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv7m-none-eabi src/test/run-make
(snip)
running 5 tests
iiii.
test result: ok. 1 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out
```

## Artifacts

You can examine the artifacts under the directory below:
```
sekineh@sekineh-VirtualBox:~/rustme10$ ls -l build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/thumb-none-cortex-m/
total 4
drwxrwxr-x 7 sekineh sekineh 4096  8月 14 22:40 cortex-m
```
where `build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/thumb-none-cortex-m/` is came from TMPDIR variable.

## Other notes

For `test.rs` modification, I used the same logic as:
- d8b3c830fb/src/bootstrap/dist.rs (L652-L657)
```
            if builder.no_std(target) == Some(true) {
                // the `test` doesn't compile for no-std targets
                builder.ensure(compile::Std { compiler, target });
            } else {
                builder.ensure(compile::Test { compiler, target });
            }
```
It is a useful snippet when adding `no_std` support to `src/bootstrap` code.

CC @kennytm @jamesmunns @nerdyvaishali
2018-08-17 10:40:25 +00:00
Vadim Petrochenkov
674a5db1a5 Fix undesirable fallout
compile-fail-fulldeps/proc-macro/proc-macro-attributes.rs - resolution change for derive helper attributes with the same name as derive itself
run-pass/macro-comma-support.rs - indeterminate resolutions for macros in expression positions
ui/issues/issue-49074.rs - diagnostics regression, not enough recovery to report the second error
ui/object-lifetime/object-lifetime-default.stderr - unstable diagnostics?
2018-08-17 13:17:39 +03:00
Vadim Petrochenkov
a0958048b6 Stabilize use_extern_macros 2018-08-17 13:14:26 +03:00
Eduard-Mihai Burtescu
9b1d3c70ac rustc_resolve: don't allow paths starting with ::crate. 2018-08-17 12:59:56 +03:00
bors
d06fa3a46f Auto merge of #53383 - nnethercote:HybridIdxSetBuf, r=nikomatsakis
Speed up NLL with HybridIdxSetBuf.

It's a sparse-when-small but dense-when-large index set that is very
efficient for sets that (a) have few elements, (b) have large
universe_size values, and (c) are cleared frequently. Which makes it
perfect for the `gen_set` and `kill_set` sets used by the new borrow
checker.

This patch reduces `tuple-stress`'s NLL-check time by 40%, and up to 12%
for several other benchmarks. And it halves the max-rss for `keccak`,
and has smaller wins for `inflate` and `clap-rs`.
2018-08-17 07:20:23 +00:00
Ralf Jung
d8f5790262 fix license 2018-08-17 09:17:35 +02:00