Commit Graph

57988 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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