Commit Graph

58023 Commits

Author SHA1 Message Date
Jeffrey Seyfried
53de24bbd1 Refactor away fields MacroDef::{use_locally, export}. 2016-10-24 00:43:19 +00:00
Jeffrey Seyfried
e4baeaa30d Import macros in resolve instead of in metadata::macro_import. 2016-10-24 00:43:12 +00:00
bors
4845adde36 Auto merge of #37301 - jseyfried:improve_metadata_modules, r=eddyb
metadata: improve some confusing type and module names

r? @eddyb
2016-10-22 16:26:54 -07:00
bors
a117bba125 Auto merge of #37318 - nnethercote:html5ever-more, r=nrc,eddyb
Avoid some allocations in the macro parser

These three commits reduce the number of heap allocations done when compiling rustc-benchmarks/html5ever-2016-08-25 by 20%, from 16.5M to 13.3M. This speeds up (debug) compilation of it with a stage1 compiler by about 7%.
2016-10-22 13:09:24 -07:00
Jeffrey Seyfried
f3993d1a7f Rename loader.rs -> locator.rs. 2016-10-22 20:01:50 +00:00
Jeffrey Seyfried
92413c9cf4 Move Library into creader.rs. 2016-10-22 20:01:49 +00:00
Jeffrey Seyfried
0e99b83f52 Rename csearch.rs -> cstore_impl.rs. 2016-10-22 20:01:42 +00:00
Jeffrey Seyfried
2b43fac2b9 Remove CrateReader, use CrateLoader instead. 2016-10-22 20:01:38 +00:00
bors
0eb4d46d03 Auto merge of #37310 - vadimcn:drop-spans, r=michaelwoerister
Fix line stepping in debugger.

Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.

Fixes #37032

r? @michaelwoerister
2016-10-22 10:02:19 -07:00
bors
b5f6d7ec2d Auto merge of #37298 - nnethercote:faster-deflate, r=alexcrichton
Use a faster `deflate` setting

In #37086 we have considered various ideas for reducing the cost of LLVM bytecode compression. This PR implements the simplest of these: use a faster `deflate` setting. It's very simple and reduces the compression time by almost half while increasing the size of the resulting rlibs by only about 2%.

I looked at using zstd, which might be able to halve the compression time again. But integrating zstd is beyond my Rust FFI integration abilities at the moment -- it consists of a few dozen C files, has a non-trivial build system, etc. I decided it was worth getting a big chunk of the possible improvement with minimum effort.

The following table shows the before and after percentages of instructions executed during compression while doing debug builds of some of the rustc-benchmarks with a stage1 compiler.
```
html5ever-2016-08-25      1.4% -> 0.7%
hyper.0.5.0               3.8% -> 2.4%
inflate-0.1.0             1.0% -> 0.5%
piston-image-0.10.3       2.9% -> 1.8%
regex.0.1.30              3.4% -> 2.1%
rust-encoding-0.3.0       4.8% -> 2.9%
syntex-0.42.2             2.9% -> 1.8%
syntex-0.42.2-incr-clean 14.2% -> 8.9%
```
The omitted ones spend 0% of their time in decompression.

And here are actual timings:
```
futures-rs-test  4.110s vs  4.102s --> 1.002x faster (variance: 1.017x, 1.004x)
helloworld       0.223s vs  0.226s --> 0.986x faster (variance: 1.012x, 1.022x)
html5ever-2016-  4.218s vs  4.186s --> 1.008x faster (variance: 1.008x, 1.010x)
hyper.0.5.0      4.746s vs  4.661s --> 1.018x faster (variance: 1.002x, 1.016x)
inflate-0.1.0    4.194s vs  4.143s --> 1.012x faster (variance: 1.007x, 1.006x)
issue-32062-equ  0.317s vs  0.316s --> 1.001x faster (variance: 1.013x, 1.005x)
issue-32278-big  1.811s vs  1.825s --> 0.992x faster (variance: 1.014x, 1.006x)
jld-day15-parse  1.412s vs  1.412s --> 1.001x faster (variance: 1.019x, 1.008x)
piston-image-0. 11.058s vs 10.977s --> 1.007x faster (variance: 1.008x, 1.039x)
reddit-stress    2.331s vs  2.342s --> 0.995x faster (variance: 1.019x, 1.006x)
regex.0.1.30     2.294s vs  2.276s --> 1.008x faster (variance: 1.007x, 1.007x)
rust-encoding-0  1.963s vs  1.924s --> 1.020x faster (variance: 1.009x, 1.006x)
syntex-0.42.2   29.667s vs 29.391s --> 1.009x faster (variance: 1.002x, 1.023x)
syntex-0.42.2-i 15.257s vs 14.148s --> 1.078x faster (variance: 1.018x, 1.008x)
```

r? @alexcrichton
2016-10-22 06:37:30 -07:00
bors
4879166194 Auto merge of #37294 - nikomatsakis:issue-37154, r=nikomatsakis
remove keys w/ skolemized regions from proj cache when popping skolemized regions

This addresses #37154 (a regression). The projection cache was incorrectly caching the results for skolemized regions -- when we pop skolemized regions, we are supposed to drop cache keys for them (just as we remove those skolemized regions from the region inference graph). This is because those skolemized region numbers will be reused later with different meaning (and we have determined that the old ones don't leak out in any meaningful way).

I did a *somewhat* aggressive fix here of only removing keys that mention the skolemized regions. One could imagine just removing all keys added since we started the skolemization (as indeed I did in my initial commit). This more aggressive fix required fixing a latent bug in `TypeFlags`, as an aside.

I believe the more aggressive fix is correct; clearly there can be entries that are unrelated to the skoelemized region, and it's a shame to remove them. My one concern was that it *is* possible I believe to have some region variables that are created and related to skolemized regions, and maybe some of them could end up in the cache. However, that seems harmless enough to me-- those relations will be removed, and couldn't have impacted how trait resolution proceeded anyway (iow, the cache entry is not wrong, though it is kind of useless).

r? @pnkfelix
cc @arielb1
2016-10-22 03:30:23 -07:00
bors
4642e08b4d Auto merge of #37281 - TimNN:pad-align, r=eddyb
trans: pad const structs to aligned size

Fixes #37222.

I'm not sure if that is the *correct* way to fix this, but it *does* work.
2016-10-22 00:04:31 -07:00
bors
f136e9e299 Auto merge of #37337 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests

- Successful merges: #37043, #37209, #37211, #37219, #37244, #37253, #37286, #37297, #37309, #37314
- Failed merges:
2016-10-21 20:29:25 -07:00
Guillaume Gomez
1c2d2235c9 Rollup merge of #37314 - tshepang:simple, r=GuillaumeGomez
doc: a more simple description of Iterator::nth
2016-10-22 01:22:00 +02:00
Guillaume Gomez
c3802f6789 Rollup merge of #37309 - vkatsikaros:vkatsikaros/37307, r=GuillaumeGomez
TRPL: guessing game: minor clarification

The original text is correct and exact, but might confuse a non-English speaker (at least I was confused), so I made it a bit more plain (see https://github.com/rust-lang/rust/issues/37307).

I know minor wording changes like these are affected by personal style, so I'd understand if you don't find this useful.

r? @steveklabnik
2016-10-22 01:22:00 +02:00
Guillaume Gomez
8aa14c3f49 Rollup merge of #37297 - thepowersgang:fix-bad-crate-attrs, r=eddyb
test - Add missing ! to crate_type/crate_id attributes

Fix some useless attributes in a test dependency.
2016-10-22 01:21:59 +02:00
Guillaume Gomez
59faa20156 Rollup merge of #37286 - srinivasreddy:graph, r=nrc
run rustfmt on graph folder
2016-10-22 01:21:59 +02:00
Guillaume Gomez
38337c2159 Rollup merge of #37253 - srinivasreddy:liballoc, r=nrc
Apply rustfmt on liballoc folder
2016-10-22 01:21:59 +02:00
Guillaume Gomez
0dee00f545 Rollup merge of #37244 - senior:add-error-desc-182-230-399, r=GuillaumeGomez
Add error explaination for E0182, E0230 and E0399

This PR adds some error descriptions requested in issue https://github.com/rust-lang/rust/issues/32777.

r? @GuillaumeGomez

Specifically this adds descriptions for

E0182 - unexpected binding of associated item in expression path
E0230 - missing type parameter from on_unimplemented description
E0399 - overriding a trait type without re-implementing default methods
2016-10-22 01:21:59 +02:00
Guillaume Gomez
8133a55e05 Rollup merge of #37219 - srinivasreddy:prelude, r=nrc
Run rustfmt on libcore/prelude folder
2016-10-22 01:21:59 +02:00
Guillaume Gomez
686ff0c169 Rollup merge of #37211 - srinivasreddy:alt, r=nrc
run rustfmt on various folders
2016-10-22 01:21:58 +02:00
Guillaume Gomez
88d1cbdbab Rollup merge of #37209 - srinivasreddy:bootstrap_bin, r=nrc
run rustfmt on bootstrap/bin folder
2016-10-22 01:21:58 +02:00
Guillaume Gomez
18f9758c4f Rollup merge of #37043 - GuillaumeGomez:vec_urls, r=frewsxcv
Add missing urls on Vec docs

r? @steveklabnik
2016-10-22 01:21:58 +02:00
bors
a6fa57291b Auto merge of #37174 - mikhail-m1:dnlle, r=jonathandturner
improve "Doesn't live long enough" error

I've fixed only with same case

issue #36537 part of  #35233
r? @jonathandturner
2016-10-21 15:57:35 -07:00
Niko Matsakis
483bc864ca add regression test for #37154
Fixes #37154
2016-10-21 11:13:36 -04:00
Niko Matsakis
567b11fc3a only remove keys that mention skolemized regions 2016-10-21 11:13:36 -04:00
Niko Matsakis
974817d493 when pop skol, also remove from proj cache 2016-10-21 11:13:34 -04:00
bors
5509ae399e Auto merge of #37290 - petrochenkov:pnp, r=jseyfried
syntax: Tweak path parsing logic

Associated paths starting with `<<` are parsed in patterns.

Paths like `self::foo::bar` are interpreted as paths and not as `self` arguments in methods (cc @matklad).
Now, I believe, *all* paths are consistently parsed greedily in case of ambiguity.
Detection of `&'a mut self::` requires pretty large (but still fixed) lookahead, so I had to increase the size of parser's lookahead buffer.
Curiously, if `lookahead_distance >= lookahead_buffer_size` was used previously, the parser hung forever, I fixed this as well, now it ICEs.

r? @jseyfried
2016-10-21 06:41:45 -07:00
Ryan Senior
93655863a3 Add an error explaination for E0399 2016-10-21 07:23:41 -05:00
Ryan Senior
e7d01cfe02 Add an error explaination for E0230 2016-10-21 07:23:41 -05:00
Ryan Senior
5402271ceb Add an error explaination for E0182 2016-10-21 07:23:40 -05:00
Nicholas Nethercote
b817cf8b57 Replace the String in ParseResult::Failure with Token.
This lets us delay creation of failure messages until they are needed,
which avoids ~1.6M allocations in html5ever.
2016-10-21 20:27:15 +11: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
Nicholas Nethercote
e382267cfb Avoid an unnecessary clone in generic_extensions.
This avoids ~800,000 allocations in html5ever.
2016-10-21 12:58:14 +11:00
Nicholas Nethercote
a935481ae9 Avoid an unnecessary clone in macro_parser::parse.
This avoids ~800,000 allocations in html5ever.
2016-10-21 12:58:06 +11: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
Tshepang Lekhonkhobe
3e26a93a36 doc: a more simple description of Iterator::nth 2016-10-21 00:38:00 +02:00
Tim Neumann
f1356975a4 trans: pad const structs to aligned size 2016-10-20 22:27:06 +02:00
Mikhail Modin
e85277596e improve "Doesn't live long enough" error 2016-10-20 22:51:51 +03:00
Vadim Petrochenkov
fea630ef9d Tweak path parsing logic 2016-10-20 20:28:10 +03:00
Vadim Petrochenkov
65ff4ca294 Refactor parser lookahead buffer and increase its size 2016-10-20 20:28:10 +03:00
Vadim Chugunov
209fe0df24 Fix line stepping in debugger.
Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.
2016-10-20 09:33:04 -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
Vangelis Katsikaros
cf0fc72a3e TRPL: guessing game: minor clarification 2016-10-20 18:00:12 +03: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
Guillaume Gomez
599ad8ed61 Add missing urls on Vec docs 2016-10-20 11:59:47 +02: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
Nicholas Nethercote
94771a177b Use fast decompression in deflate_bytes.
This commit changes the parameters of `deflate` to do faster,
lower-quality compression. For the compression of LLVM bytecode -- which
is the main use of `deflate_bytes` -- it makes compression almost twice
as fast while the size of the compressed files is only ~2% worse.
2016-10-20 15:08:01 +11:00
John Hodge
ba70ecc414 test - Add missing ! to crate_type/crate_id attributes 2016-10-20 11:29:09 +08:00