Commit Graph

57976 Commits

Author SHA1 Message Date
Michael Woerister
992203b976 Adapt rmake-test to new naming scheme for internal symbols. 2016-10-24 11:07:45 -04:00
Michael Woerister
e46c1ad9c9 Adapt codegen test to new naming scheme for generated symbols. 2016-10-21 18:29:25 -04:00
Michael Woerister
e6aa92c432 trans: Make names of internal symbols independent of CGU translation order.
Every codegen unit gets its own local counter for generating new symbol
names. This makes bitcode and object files reproducible at the binary
level even when incremental compilation is used.
2016-10-21 14:58:53 -04:00
bors
da5b6467c3 Auto merge of #37247 - jseyfried:future_proof_no_link, r=nrc
macros: Future proof `#[no_link]`

This PR future proofs `#[no_link]` for macro modularization (cc #35896).

First, we resolve all `#[no_link] extern crate`s. `#[no_link]` crates without `#[macro_use]` or `#[macro_reexport]` are not resolved today, this is a [breaking-change]. For example,
```rust
```
Any breakage can be fixed by simply removing the `#[no_link] extern crate`.

Second, `#[no_link] extern crate`s will define an empty module in type namespace to eventually allow importing the crate's macros with `use`. This is a [breaking-change], for example:
```rust
mod syntax {} //< This becomes a duplicate error.
```

r? @nrc
2016-10-21 01:48:31 -07:00
bors
e4708273b5 Auto merge of #37280 - alexcrichton:debuginfo, r=brson
Enable line number debuginfo in releases

This commit enables by default passing the `-C debuginfo=1` argument to the
compiler for the stable, beta, and nightly release channels. A new configure
option was also added, `--enable-debuginfo-lines`, to enable this behavior in
developer builds as well.

Closes #36452
2016-10-20 22:34:29 -07:00
bors
041d14b23c Auto merge of #37272 - cuviper:local_stage0-proc_macro, r=alexcrichton
Add libproc_macro from local rust to stage0

This library is now required to run rustc 1.14.0.
2016-10-20 18:33:28 -07:00
bors
f094206851 Auto merge of #37261 - raphlinus:update_llvm, r=bluss
LLVM: Add triple for Fuchsia

Update subproject commit.

Fixes #36920
2016-10-20 08:18:13 -07:00
bors
7bccb829d0 Auto merge of #37273 - cuviper:major-minor-rebuild, r=alexcrichton
Detect local-rebuild by just the MAJOR.MINOR version

A new point-release shouldn't change any language semantics, so a local
stage0 that matches MAJOR.MINOR version should still be considered a
local-rebuild as far as `--cfg stageN` features go.

e.g. `1.14.0` should be considered a local-rebuild for any `1.14.X`.

(Bootstrap keys used to be an issue too, until #37265.)
2016-10-20 05:16:49 -07:00
bors
eb38d426c4 Auto merge of #36973 - nnethercote:dep_graph, r=nikomatsakis
Don't enqueue onto a disabled dep_graph.

This commit guards all calls to `DepGraphThreadData::enqueue` with a
check to make sure it is enabled. This avoids some useless allocation
and vector manipulations when it is disabled (i.e. when incremental
compilation is off) which improves speed by 1--2% on most of the
rustc-benchmarks.

This commit has an observable functional change: when the dep_graph is
disabled its `shadow_graph` will no longer receive messages. This should
be ok because these message are only used when debug assertions are
enabled.

r? @nikomatsakis
2016-10-19 22:05:13 -07:00
bors
dfd98ebd3e Auto merge of #37289 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #37165, #37187, #37241, #37283, #37285, #37287, #37288
- Failed merges:
2016-10-19 17:41:49 -07:00
Guillaume Gomez
dd3a014ed9 Rollup merge of #37288 - srinivasreddy:snapshot_map, r=eddyb
run rustfmt on snapshot_map
2016-10-19 23:15:01 +02:00
Guillaume Gomez
655ecd89ed Rollup merge of #37287 - srinivasreddy:unify, r=eddyb
run rustfmt on unify folder
2016-10-19 23:15:01 +02:00
Guillaume Gomez
e7dc035f92 Rollup merge of #37285 - srinivasreddy:cfg, r=nikomatsakis
run rustfmt on control_flow_graph folder
2016-10-19 23:15:01 +02:00
Guillaume Gomez
dfb74ee97b Rollup merge of #37283 - posborne:docs/tests-dir-grammar-fixes, r=steveklabnik
Fix grammatical errors in `tests` directory docs
2016-10-19 23:15:01 +02:00
Guillaume Gomez
123a6ef25c Rollup merge of #37241 - zackmdavis:if_let_over_none_spaced_empty_block_arm, r=nikomatsakis
prefer `if let` to match with `None => { }` arm in some places

In #34268 (8531d581), we replaced matches of None to the unit value `()`
with `if let`s in places where it was deemed that this made the code
unambiguously clearer and more idiomatic. In #34638 (d37edef9), we did
the same for matches of None to the empty block `{}`.

A casual observer, upon seeing these commits fly by, might suppose that
the matter was then settled, that no further pull requests on this
utterly trivial point of style could or would be made. Unless ...

It turns out that sometimes people write the empty block with a space in
between the braces. Who knew?
2016-10-19 23:15:00 +02:00
Guillaume Gomez
ce369bfa11 Rollup merge of #37187 - frewsxcv:cow-doc-example, r=kmcallister
Improve doc example for `std::borrow::Cow`.

None
2016-10-19 23:15:00 +02:00
Guillaume Gomez
32820c149b Rollup merge of #37165 - GuillaumeGomez:bytes_url, r=kmcallister
Add missing urls for io types

r? @steveklabnik
2016-10-19 23:15:00 +02:00
Srinivas Reddy Thatiparthy
4e89811690
run rustfmt on snapshot_map 2016-10-20 00:40:05 +05:30
Srinivas Reddy Thatiparthy
c2d0d4fea6
run rustfmt on unify folder 2016-10-20 00:38:55 +05:30
Srinivas Reddy Thatiparthy
f1e4ae17b1
run rustfmt on control_flow_graph folder 2016-10-20 00:25:19 +05:30
Paul Osborne
d79ec7e310 Fix grammatical errors in tests directory docs 2016-10-19 13:39:27 -05:00
Raph Levien
b8697d939a Update llvm-auto-clean-trigger
Update the datestamp so that buildbots do a clean rebuild of llvm.
2016-10-19 10:11:00 -07:00
Raph Levien
8bb76f9241 LLVM: Add triple for Fuchsia
Update subproject commit.
2016-10-19 10:08:30 -07:00
Alex Crichton
803576c17e Enable line number debuginfo in releases
This commit enables by default passing the `-C debuginfo=1` argument to the
compiler for the stable, beta, and nightly release channels. A new configure
option was also added, `--enable-debuginfo-lines`, to enable this behavior in
developer builds as well.

Closes #36452
2016-10-19 10:08:05 -07:00
bors
d337f345ca Auto merge of #37220 - Mark-Simulacrum:arena-alloc-slice, r=eddyb
alloc_slice in TypedArena

Added `TypedArena::alloc_slice`, and moved from using `TypedArena<Vec<T>>` to `TypedArena<T>`.

`TypedArena::alloc_slice` is implemented by copying the slices elements into the typed arena, requiring that `T: Copy` when using it. We allocate a new chunk when there's insufficient space remaining in the previous chunk, and we cannot resize the old chunk in place. This is non-optimal, since we may waste allocated space when allocating (especially longer) slices, but is considered good enough for the time being.

This change also reduces heap fragmentation, since the arena now directly stores objects instead of storing the Vec's length and pointer to its contents.

Performance:
```
futures-rs-test  5.048s vs  5.061s --> 0.997x faster (variance: 1.028x, 1.020x)
helloworld       0.284s vs  0.295s --> 0.963x faster (variance: 1.207x, 1.189x)
html5ever-2016-  8.396s vs  8.208s --> 1.023x faster (variance: 1.019x, 1.036x)
hyper.0.5.0      5.768s vs  5.797s --> 0.995x faster (variance: 1.027x, 1.028x)
inflate-0.1.0    5.213s vs  5.069s --> 1.028x faster (variance: 1.008x, 1.022x)
issue-32062-equ  0.428s vs  0.467s --> 0.916x faster (variance: 1.188x, 1.015x)
issue-32278-big  1.949s vs  2.010s --> 0.970x faster (variance: 1.112x, 1.049x)
jld-day15-parse  1.795s vs  1.877s --> 0.956x faster (variance: 1.037x, 1.015x)
piston-image-0. 13.554s vs 13.522s --> 1.002x faster (variance: 1.019x, 1.020x)
rust-encoding-0  2.489s vs  2.465s --> 1.010x faster (variance: 1.047x, 1.086x)
syntex-0.42.2   34.646s vs 34.593s --> 1.002x faster (variance: 1.007x, 1.005x)
syntex-0.42.2-i 17.181s vs 17.163s --> 1.001x faster (variance: 1.004x, 1.004x)
```

r? @eddyb
2016-10-19 09:52:48 -07:00
Josh Stone
81d97957a7 Detect local-rebuild by just the MAJOR.MINOR version
A new point-release shouldn't change any language semantics, so a local
stage0 that matches MAJOR.MINOR version should still be considered a
local-rebuild as far as `--cfg stageN` features go.

e.g. `1.14.0` should be considered a local-rebuild for any `1.14.X`.

(Bootstrap keys used to be an issue too, until #37265.)
2016-10-19 08:21:00 -07:00
Mark-Simulacrum
83b198249f Use TypedArena::alloc_slice in rustc. 2016-10-19 07:53:56 -06:00
bors
cfc9b5185b Auto merge of #37213 - jseyfried:refactor_crate_var, r=nrc
macros: improve `$crate`

This PR refactors the implementation of `$crate` so that
 - `$crate` is only allowed at the start of a path (like `super`),
 - we can make `$crate` work with inter-crate re-exports (groundwork for macro modularization), and
 - we can support importing macros from an extern crate that is not declared at the crate root (also groundwork for macro modularization).

This is a [breaking-change]. For example, the following would break:
```rust
fn foo() {}
macro_rules! m { () => {
    $crate foo $crate () $crate $crate;
    //^ Today, `$crate` is allowed just about anywhere in unexported macros.
} }
fn main() {
    m!();
}
```
r? @nrc
2016-10-19 06:33:10 -07:00
Mark-Simulacrum
a714c2a15c Add TypedArena::alloc_slice. 2016-10-19 06:55:34 -06:00
Jeffrey Seyfried
b283aaf0ff Future proof #[no_link]. 2016-10-19 10:05:03 +00:00
Jeffrey Seyfried
8b0c292a72 Improve $crate. 2016-10-19 10:03:06 +00:00
Jeffrey Seyfried
7b81106a85 Use Idents instead of Names in ImportDirective's paths. 2016-10-19 09:58:12 +00:00
Jeffrey Seyfried
6a6ef91ba7 nit: Import Ident in resolve. 2016-10-19 09:58:08 +00:00
bors
a41505f4f4 Auto merge of #37259 - GuillaumeGomez:fix_io_urls, r=frewsxcv
Add more io urls

r? @steveklabnik
2016-10-19 02:53:42 -07:00
Josh Stone
86f02f6020 Add libproc_macro from local rust to stage0
This library is now required to run rustc 1.14.0.
2016-10-19 00:12:42 -07:00
bors
0c429872a3 Auto merge of #37269 - eddyb:rollup, r=eddyb
Rollup of 23 pull requests

- Successful merges: #36964, #37108, #37117, #37124, #37161, #37176, #37182, #37193, #37198, #37202, #37208, #37218, #37221, #37224, #37230, #37231, #37233, #37236, #37240, #37254, #37257, #37265, #37267
- Failed merges: #37213, #37220, #37261
2016-10-18 22:13:09 -07:00
Eduard-Mihai Burtescu
f354d72536 Rollup merge of #37267 - nnethercote:opt-write_metadata, r=eddyb
Optimize `write_metadata`.

`write_metadata` currently generates metadata unnecessarily in some
cases, and also compresses it unnecessarily in some cases. This commit
fixes that. It speeds up three of the rustc-benchmarks by 1--4%.

r? @eddyb, who deserves much of the credit because he (a) identified the problem from the profile data I provided in #37086, and (b) explained to me how to fix it. Thank you, @eddyb!
2016-10-19 08:00:05 +03:00
Eduard-Mihai Burtescu
988831319e Rollup merge of #37265 - brson:bootstrap, r=alexcrichton
Allow bootstrapping without a key. Fixes #36548

This will make it easier for packagers to bootstrap rustc when they happen
to have a bootstrap compiler with a slightly different version number.

It's not ok for anything other than the build system to set this environment variable.

r? @alexcrichton
2016-10-19 08:00:04 +03:00
Eduard-Mihai Burtescu
903e1f9657 Rollup merge of #37257 - srinivasreddy:librustc_errors, r=eddyb
run rustfmt on librustc_errors folder
2016-10-19 08:00:04 +03:00
Eduard-Mihai Burtescu
a09b94b3d9 Rollup merge of #37254 - srinivasreddy:master, r=alexcrichton
run rustfmt on libpanic_unwind
2016-10-19 08:00:04 +03:00
Eduard-Mihai Burtescu
3d57d42f13 Rollup merge of #37240 - jethrogb:typeid_doc, r=sfackler
Add stable example to TypeId

The old example is still available at [Any::get_type_id](https://doc.rust-lang.org/std/any/trait.Any.html#examples)
2016-10-19 08:00:03 +03:00
Eduard-Mihai Burtescu
ad241dfa65 Rollup merge of #37236 - bluss:range-argument, r=alexcrichton
std::collections: Reexport libcollections's range module

This is overdue, even if range and RangeArgument is still unstable.
The stability attributes are the same ones as the other unstable item
(Bound) here, they don't seem to matter.
2016-10-19 08:00:03 +03:00
Eduard-Mihai Burtescu
7343291ac3 Rollup merge of #37233 - michaelwoerister:blake2-for-ich, r=nikomatsakis
ICH: Use 128-bit Blake2b hash instead of 64-bit SipHash for incr. comp. fingerprints

This PR makes incr. comp. hashes 128 bits wide in order to push collision probability below a threshold that we need to worry about. It also replaces SipHash, which has been mentioned multiple times as not being built for fingerprinting, with the [BLAKE2b hash function](https://blake2.net/), an improved version of the BLAKE sha-3 finalist.

I was worried that using a cryptographic hash function would make ICH computation noticeably slower, but after doing some performance tests, I'm not any more. Most of the time BLAKE2b is actually faster than using two SipHashes (in order to get 128 bits):

```
SipHash
libcore: 0.199 seconds
libstd:  0.090 seconds

BLAKE2b
libcore: 0.162 seconds
libstd:  0.078 seconds
```

If someone can prove that something like MetroHash128 provides a comparably low collision probability as BLAKE2, I'm happy to switch. But for now we are at least not taking a performance hit.

I also suggest that we throw out the sha-256 implementation in the compiler and replace it with BLAKE2, since our sha-256 implementation is two to three times slower than the BLAKE2 implementation in this PR (cc @alexcrichton @eddyb @brson)

r? @nikomatsakis (although there's not much incr. comp. specific in here, so feel free to re-assign)
2016-10-19 08:00:03 +03:00
Eduard-Mihai Burtescu
6ae80c6ac4 Rollup merge of #37231 - jonas-schievink:obligation-forest-the-quest-for-performance, r=arielb1
[Obligation Forest] Don't process cycles when stalled

This improves the `inflate-0.1.0` benchmark by about 10% for me.

/me hopes this is sound
2016-10-19 08:00:03 +03:00
Eduard-Mihai Burtescu
7b0eb102de Rollup merge of #37230 - bluss:zip-specialization-for-map, r=alexcrichton
Expand .zip() specialization to .map() and .cloned()

Implement .zip() specialization for Map and Cloned.

The crucial thing for transparent specialization is that we want to
preserve the potential side effects.

The simplest example is that in this code snippet:

`(0..6).map(f).zip((0..4).map(g)).count()`

`f` will be called five times, and `g` four times. The last time for `f`
is when the other iterator is at its end, so this element is unused.
This side effect can be preserved without disturbing code generation for
simple uses of `.map()`.

The `Zip::next_back()` case is even more complicated, unfortunately.
2016-10-19 08:00:02 +03:00
Eduard-Mihai Burtescu
beaa4c5779 Rollup merge of #37224 - petrochenkov:nz, r=eddyb
Mark enums with non-zero discriminant as non-zero

cc https://github.com/rust-lang/rfcs/issues/1230
r? @eddyb
2016-10-19 08:00:02 +03:00
Eduard-Mihai Burtescu
184ee985f8 Rollup merge of #37221 - diwic:6a-readdir-debug, r=alexcrichton
impl Debug for ReadDir

It is good practice to implement Debug for public types, and
indicating what directory you're reading seems useful.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2016-10-19 08:00:02 +03:00
Eduard-Mihai Burtescu
eae11c35c9 Rollup merge of #37218 - srinivasreddy:sync, r=nrc
Run rustfmt on libcore/sync folder
2016-10-19 08:00:02 +03:00
Eduard-Mihai Burtescu
094eaf0250 Rollup merge of #37208 - jseyfried:fix_partially_consumed_tokens_in_macros, r=nrc
macros: fix partially consumed tokens in macro matchers

Fixes #37175.

This PR also avoids re-transcribing the tokens consumed by a matcher (and cloning the `TtReader` once per matcher), which improves expansion performance of the test case from #34630 by ~8%.

r? @nrc
2016-10-19 08:00:01 +03:00
Eduard-Mihai Burtescu
45683187ea Rollup merge of #37202 - petrochenkov:pretty, r=nrc
Fix some pretty printing tests

Many pretty-printing tests are un-ignored.
Some issues in classification of comments (trailing/isolated) and blank line counting are fixed.
Some comments are printed more carefully.
Some minor refactoring in pprust.rs
`no-pretty-expanded` annotations are removed because this is the default now.
`pretty-expanded` annotations are removed from compile-fail tests, they are not tested with pretty-printer.

Closes https://github.com/rust-lang/rust/issues/23623 in favor of more specific https://github.com/rust-lang/rust/issues/37201 and https://github.com/rust-lang/rust/issues/37199
r? @nrc
2016-10-19 08:00:01 +03:00