Commit Graph

61958 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
2c252ff1fb Rollup merge of #40237 - arthurprs:hm-adapt2, r=alexcrichton
Reduce size overhead of adaptative hashmap

Exposes a boolean flag in RawTable and use it instead of a bool field in HashMap.

Taking a bit from capacity or length would make overflow handling tricky.

Fixes: #40042
2017-03-08 20:53:52 +02:00
Ariel Ben-Yehuda
68a5a16740 Rollup merge of #40226 - jdhorwitz:master, r=frewsxcv
Issue #39688 - Help people find String::as_bytes() for UTF-8

Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa.
?r @steveklabnik
2017-03-08 20:53:51 +02:00
Ariel Ben-Yehuda
7c18194498 Rollup merge of #40222 - steveklabnik:extract-nomicon, r=alexcrichton
Extract nomicon to its own repo

part of https://github.com/rust-lang/rust/issues/39588

same as https://github.com/rust-lang/rust/pull/40213 but for the nomicon

r? @alexcrichton
2017-03-08 20:53:50 +02:00
Ariel Ben-Yehuda
df9a721a55 Rollup merge of #40154 - steveklabnik:link-unstable-book, r=frewsxcv
add unstable book to the bookshelf

r? @frewsxcv @GuillaumeGomez
2017-03-08 20:53:48 +02:00
bors
ee60afa094 Auto merge of #39860 - japaric:san, r=alexcrichton
cleanup: remove the *san Cargo features from std

these belong to a previous iteration of the sanitizer implementation

r? @alexcrichton
cc @whitequark
2017-03-08 13:00:13 +00:00
bors
f91c3f6755 Auto merge of #39713 - estebank:issue-39698, r=jonathandturner
Clean up "pattern doesn't bind x" messages

Group "missing variable bind" spans in `or` matches and clarify wording
for the two possible cases: when a variable from the first pattern is
not in any of the subsequent patterns, and when a variable in any of the
other patterns is not in the first one.

Before:

```rust
error[E0408]: variable `a` from pattern #1 is not bound in pattern #2
  --> file.rs:10:23
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                       ^^^^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `b` from pattern #2 is not bound in pattern #1
  --> file.rs:10:32
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                ^ pattern doesn't bind `b`

error[E0408]: variable `a` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `d`

error[E0408]: variable `c` from pattern #3 is not bound in pattern #1
  --> file.rs:10:43
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                           ^ pattern doesn't bind `c`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #4
  --> file.rs:10:48
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                                ^^^^^^^^ pattern doesn't bind `d`

error: aborting due to 6 previous errors
```

After:

```rust
error[E0408]: variable `d` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                  -          -       ^^^^^^^^   ^^^^^^^^ pattern doesn't bind `d`
   |                  |          |       |
   |                  |          |       pattern doesn't bind `d`
   |                  |          variable not in all patterns
   |                  variable not in all patterns

error[E0408]: variable `c` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:48
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |         ^^^^^^^^^^^   ^^^^^^^^^^^         -    ^^^^^^^^ pattern doesn't bind `c`
   |         |             |                   |
   |         |             |                   variable not in all patterns
   |         |             pattern doesn't bind `c`
   |         pattern doesn't bind `c`

error[E0408]: variable `a` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |               -       ^^^^^^^^^^^   ^^^^^^^^         - variable not in all patterns
   |               |       |             |
   |               |       |             pattern doesn't bind `a`
   |               |       pattern doesn't bind `a`
   |               variable not in all patterns

error[E0408]: variable `b` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |         ^^^^^^^^^^^            -    ^^^^^^^^   ^^^^^^^^ pattern doesn't bind `b`
   |         |                      |    |
   |         |                      |    pattern doesn't bind `b`
   |         |                      variable not in all patterns
   |         pattern doesn't bind `b`

error: aborting due to 4 previous errors
```

Fixes #39698.
2017-03-08 09:30:13 +00:00
bors
b04ebef432 Auto merge of #40272 - jseyfried:fix_const_macro_invocations, r=petrochenkov
macros: fix const expression invocations

Fixes #40136.
r? @nrc
2017-03-06 15:04:10 +00:00
bors
11bc48a15a Auto merge of #40276 - topecongiro:add-test, r=petrochenkov
Add missing tests for 'E-needstest' labeled issues

This PR adds missing tests for issue #35988, #19712, ~~#18627~~, #24947, #28600 and #34751.
2017-03-06 09:17:06 +00:00
topecongiro
a54f9dd556 Add missing tests for 'E-needstest' labeled issues 2017-03-06 12:52:26 +09:00
bors
bd62cbfdb1 Auto merge of #40285 - estebank:issue-40221, r=frewsxcv
Fix ICE: don't use `struct_variant` on enums

Fix #40221 and add unittest.
2017-03-06 03:24:09 +00:00
Esteban Küber
3ffa4b5240 Use BTreeSet instead of FxHashSet 2017-03-06 00:20:26 -03:00
Esteban Küber
75eface16d Clean up "pattern doesn't bind x" messages
Group "missing variable bind" spans in `or` matches and clarify wording
for the two possible cases: when a variable from the first pattern is
not in any of the subsequent patterns, and when a variable in any of the
other patterns is not in the first one.

Before:

```
error[E0408]: variable `a` from pattern #1 is not bound in pattern #2
  --> file.rs:10:23
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                       ^^^^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `b` from pattern #2 is not bound in pattern #1
  --> file.rs:10:32
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                ^ pattern doesn't bind `b`

error[E0408]: variable `a` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `d`

error[E0408]: variable `c` from pattern #3 is not bound in pattern #1
  --> file.rs:10:43
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                           ^ pattern doesn't bind `c`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #4
  --> file.rs:10:48
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                                ^^^^^^^^ pattern doesn't bind `d`

error: aborting due to 6 previous errors
```

After:

```
error[E0408]: variable `a` is not bound in all patterns
  --> file.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |               -       ^^^^^^^^^^^   ^^^^^^^^         - variable
t in all patterns
   |               |       |             |
   |               |       |             pattern doesn't bind `a`
   |               |       pattern doesn't bind `a`
   |               variable not in all patterns

error[E0408]: variable `d` is not bound in all patterns
  --> file.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |                  -          -       ^^^^^^^^   ^^^^^^^^ pattern
esn't bind `d`
   |                  |          |       |
   |                  |          |       pattern doesn't bind `d`
   |                  |          variable not in all patterns
   |                  variable not in all patterns

error[E0408]: variable `b` is not bound in all patterns
  --> file.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |         ^^^^^^^^^^^            -    ^^^^^^^^   ^^^^^^^^ pattern
esn't bind `b`
   |         |                      |    |
   |         |                      |    pattern doesn't bind `b`
   |         |                      variable not in all patterns
   |         pattern doesn't bind `b`

error[E0408]: variable `c` is not bound in all patterns
  --> file.rs:20:48
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |         ^^^^^^^^^^^   ^^^^^^^^^^^         -    ^^^^^^^^ pattern
esn't bind `c`
   |         |             |                   |
   |         |             |                   variable not in all
tterns
   |         |             pattern doesn't bind `c`
   |         pattern doesn't bind `c`

error: aborting due to 4 previous errors
```

* Have only one presentation for binding consistency errors
* Point to same binding in multiple patterns when possible
* Check inconsistent bindings in all arms
* Simplify wording of diagnostic message
* Sort emition and spans of binding errors for deterministic output
2017-03-06 00:20:26 -03:00
Esteban Küber
ad06fc718b Fix ICE: don't use struct_variant on enums
Fix #40221 and add unittest.
2017-03-06 00:13:14 -03:00
Joshua Horwitz
86bad49ec1 Issue #39688 - Help people find String::as_bytes() for UTF-8 r? @steveklabnik 2017-03-05 19:56:51 -05:00
Jeffrey Seyfried
9fe7d3ffe4 Fix const expression macro invocations. 2017-03-05 23:58:19 +00:00
bors
65e2a1454f Auto merge of #40266 - Mark-Simulacrum:cleanup-parser, r=petrochenkov
Inline function to avoid naming confusion.

Fixes the non-RFC requiring portion of #18394. The suggestion for a new token there probably needs to either be refiled onto rust-lang/rfcs if it's still relevant (may not be given Macros 2.0 work, not sure).
2017-03-05 19:53:29 +00:00
Jorge Aparicio
28baa27570 sanitizer runtime crates shouldn't be tested 2017-03-05 14:25:47 -05:00
Jorge Aparicio
872a0ebf21 cleanup: remove the *san Cargo features from std
these belong to a previous iteration of the sanitizer implementation
2017-03-05 14:25:47 -05:00
bors
6b76c9ea19 Auto merge of #40252 - topecongiro:compile-fail-test-cfg-stmt-expr, r=petrochenkov
Add compile fail test for stmt_expr_attributes

Adds a missing feature gate test for `stmt_expr_attributes`. Issue #39059.
2017-03-05 17:47:06 +00:00
topecongiro
255d59f884 Add compile fail test for stmt_expr_attributes 2017-03-05 14:40:29 +09:00
Mark Simulacrum
69899b7f27 Inline function to avoid naming confusion. 2017-03-04 18:02:04 -07:00
bors
ba07bd5d23 Auto merge of #40236 - petrochenkov:btweak, r=alexcrichton
rustbuild: A few tweaks

Fixes https://github.com/rust-lang/rust/issues/40016
Fixes https://github.com/rust-lang/rust/issues/39507

r? @alexcrichton
2017-03-04 19:20:58 +00:00
Vadim Petrochenkov
428f063fcd Automate timestamp creation and build skipping for native libraries
Add comments
2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
c652a4fb56 Do not purge LLVM build directory on rebuild
Add some comments
2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
e2f6185294 Separate "ui-fulldeps" tests from "ui" tests 2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
11adac350b bootstrap.py: Report build status
Move some code from x.py to bootstrap.py
2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
3b454665ea run-make on MSVC: Do not generate object files in the source directory 2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
aeadc81ddc Build compiler-rt and sanitizers only once 2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
a7c8afd28d Support combination MSVC + Ninja 2017-03-04 21:38:26 +03:00
Vadim Petrochenkov
f2187093f8 Add/remove rerun-if-changed when necessary 2017-03-04 21:38:26 +03:00
steveklabnik
4369aee657 import nomicon submodule 2017-03-04 10:41:00 -05:00
steveklabnik
5a644f417e remove nomicon 2017-03-04 10:40:40 -05:00
bors
83cbaf5e66 Auto merge of #40213 - steveklabnik:extract-reference, r=alexcrichton
Move the reference into a submodule

Part of https://github.com/rust-lang/rust/issues/39588

This moves the reference out into its own submodule. Right now, it's under my own account; I would assume that it should go under `rust-lang`, but I guess there's an argument for the nursery too? I can fix that up before we commit it.

r? @alexcrichton @brson
2017-03-04 15:40:10 +00:00
steveklabnik
846f59f831 import reference submodule 2017-03-04 10:38:46 -05:00
steveklabnik
0f48db83ba remove reference 2017-03-04 10:38:10 -05:00
bors
27918f32ad Auto merge of #40245 - cuviper:maybe-not-pie, r=alexcrichton
Let `-Crelocation-model` better control `-pie` linking

Prior to this, if relocation model in the target options was "pic", as
most targets have it, then the user's `-Crelocation-model` had no effect
on whether `-pie` would be used.  Only `-Clink-arg=-static` would have a
further override here.

Now we use `context::get_reloc_model`, which gives precedence to the
user's option, and if it's `RelocMode::PIC` we enable `-pie`.  This is
the same test as `context::is_pie_binary`, except that folds across all
`sess.crate_types`, not just the current one.

Fixes #35061.
2017-03-04 12:33:35 +00:00
bors
73d31e3f7b Auto merge of #40242 - cramertj:fix-while-let-ribs-scope, r=petrochenkov
Fix missing WhileLet pattern scope

Fix #40235
2017-03-04 10:21:30 +00:00
bors
231db97c46 Auto merge of #40207 - phil-opp:llvm-submodule-update, r=alexcrichton
LLVM: Update submodule to include x86-interrupt ABI patches

Update LLVM submodule to `rust-llvm-2016-10-29` branch (commit 50ab09fb43).
2017-03-04 08:10:52 +00:00
bors
be304afc8c Auto merge of #40202 - jseyfried:integrate_tokenstream, r=nrc
syntax: integrate `TokenStream`

Use `TokenStream` instead of `Vec<TokenTree>` in `TokenTree::Delimited` and elsewhere.
r? @nrc
2017-03-04 05:44:12 +00:00
bors
8c6c0f80a3 Auto merge of #40163 - arielb1:normalization-1702, r=nikomatsakis
More through normalization, Feb/Mar 2017 edition

Fix a few normalization bugs.

Fixes #27901.
Fixes #28828.
Fixes #38135.
Fixes #39363.
Fixes #39367.
2017-03-04 01:47:51 +00:00
bors
52080902d9 Auto merge of #39917 - alexcrichton:build-cargo, r=brson
rustbuild: Add support for compiling Cargo

This commit adds support to rustbuild for compiling Cargo as part of the release
process. Previously rustbuild would simply download a Cargo snapshot and
repackage it. With this change we should be able to turn off artifacts from the
rust-lang/cargo repository and purely rely on the artifacts Cargo produces here.

The infrastructure added here is intended to be extensible to other components,
such as the RLS. It won't exactly be a one-line addition, but the addition of
Cargo didn't require too much hooplah anyway.

The process for release Cargo will now look like:

* The rust-lang/rust repository has a Cargo submodule which is used to build a
  Cargo to pair with the rust-lang/rust release
* Periodically we'll update the cargo submodule as necessary on rust-lang/rust's
  master branch
* When branching beta we'll create a new branch of Cargo (as we do today), and
  the first commit to the beta branch will be to update the Cargo submodule to
  this exact revision.
* When branching stable, we'll ensure that the Cargo submodule is updated and
  then make a stable release.

Backports to Cargo will look like:

* Send a PR to cargo's master branch
* Send a PR to cargo's release branch (e.g. rust-1.16.0)
* Send a PR to rust-lang/rust's beta branch updating the submodule
* Eventually send a PR to rust-lang/rust's master branch updating the submodule

For reference, the process to add a new component to the rust-lang/rust release
would look like:

* Add `$foo` as a submodule in `src/tools`
* Add a `tool-$foo` step which compiles `$foo` with the specified compiler,
  likely mirroring what Cargo does.
* Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output
  to create a rust-installer package for `$foo` likely mirroring what Cargo
  does.
* Update the `dist-extended` step with a new dependency on `dist-$foo`
* Update `src/tools/build-manifest` for the new component.
2017-03-03 23:26:26 +00:00
arthurprs
3273003912 Reduce size overhead of adaptative hashmap
Exposes a boolean flag in RawTable and use it
instead of a bool field in HashMap.

Fixes: #40042
2017-03-03 23:59:46 +01:00
Josh Stone
111fbe7921 Let -Crelocation-model better control -pie linking
Prior to this, if relocation model in the target options was "pic", as
most targets have it, then the user's `-Crelocation-model` had no effect
on whether `-pie` would be used.  Only `-Clink-arg=-static` would have a
further override here.

Now we use `context::get_reloc_model`, which gives precedence to the
user's option, and if it's `RelocMode::PIC` we enable `-pie`.  This is
the same test as `context::is_pie_binary`, except that folds across all
`sess.crate_types`, not just the current one.
2017-03-03 11:39:11 -08:00
Taylor Cramer
75a35ef028 Fix missing WhileLet pattern scope 2017-03-03 09:40:44 -08:00
bors
b1e31766da Auto merge of #40101 - danobi:feat_gate_test_simd, r=alexcrichton
Add compile fail test for SIMD

This completes the missing SIMD test task for issue #39059.
2017-03-03 17:26:10 +00:00
Alex Crichton
44a01b8a54 rustbuild: Add support for compiling Cargo
This commit adds support to rustbuild for compiling Cargo as part of the release
process. Previously rustbuild would simply download a Cargo snapshot and
repackage it. With this change we should be able to turn off artifacts from the
rust-lang/cargo repository and purely rely on the artifacts Cargo produces here.

The infrastructure added here is intended to be extensible to other components,
such as the RLS. It won't exactly be a one-line addition, but the addition of
Cargo didn't require too much hooplah anyway.

The process for release Cargo will now look like:

* The rust-lang/rust repository has a Cargo submodule which is used to build a
  Cargo to pair with the rust-lang/rust release
* Periodically we'll update the cargo submodule as necessary on rust-lang/rust's
  master branch
* When branching beta we'll create a new branch of Cargo (as we do today), and
  the first commit to the beta branch will be to update the Cargo submodule to
  this exact revision.
* When branching stable, we'll ensure that the Cargo submodule is updated and
  then make a stable release.

Backports to Cargo will look like:

* Send a PR to cargo's master branch
* Send a PR to cargo's release branch (e.g. rust-1.16.0)
* Send a PR to rust-lang/rust's beta branch updating the submodule
* Eventually send a PR to rust-lang/rust's master branch updating the submodule

For reference, the process to add a new component to the rust-lang/rust release
would look like:

* Add `$foo` as a submodule in `src/tools`
* Add a `tool-$foo` step which compiles `$foo` with the specified compiler,
  likely mirroring what Cargo does.
* Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output
  to create a rust-installer package for `$foo` likely mirroring what Cargo
  does.
* Update the `dist-extended` step with a new dependency on `dist-$foo`
* Update `src/tools/build-manifest` for the new component.
2017-03-03 07:29:31 -08:00
bors
f0b514524f Auto merge of #40133 - arielb1:operand-lifetimes, r=eddyb
[MIR] improve operand lifetimes

r? @eddyb
2017-03-03 13:12:08 +00:00
Ariel Ben-Yehuda
f99f1f8975 work around LLVM PR#32123 2017-03-03 13:54:19 +02:00
Ariel Ben-Yehuda
3ffa971212 fix codegen test 2017-03-03 13:54:19 +02:00
Ariel Ben-Yehuda
906c06a2f6 make operands live to the end of their containing expression
In MIR construction, operands need to live exactly until they are used,
which is during the (sub)expression that made the call to `as_operand`.

Before this PR, operands lived until the end of the temporary scope,
which was sometimes unnecessarily longer and sometimes too short.

Fixes #38669.
2017-03-03 13:54:18 +02:00