]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agosave-analysis: cope with lack of method data after a type error
Nick Cameron [Wed, 8 Mar 2017 02:06:53 +0000 (15:06 +1300)]
save-analysis: cope with lack of method data after a type error

Fixes #39957

7 years agoAuto merge of #39518 - alexcrichton:update-cargo, r=arielb1
bors [Fri, 10 Mar 2017 13:22:12 +0000 (13:22 +0000)]
Auto merge of #39518 - alexcrichton:update-cargo, r=arielb1

rustbuild: Use copies instead of hard links

The original motivation for hard links was to speed up the various stages of
rustbuild, but in the end this is causing problems on Windows (#39504).

This commit tweaks the build system to use copies instead of hard links
unconditionally to ensure that the files accessed by Windows are always
disjoint.

Locally this added .3s to a noop build, so it shouldn't be too much of a
regression hopefully!

Closes #39504

7 years agoAuto merge of #39835 - brson:relnotes, r=brson
bors [Fri, 10 Mar 2017 07:49:06 +0000 (07:49 +0000)]
Auto merge of #39835 - brson:relnotes, r=brson

Release notes for 1.16

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md)

7 years agoRelease notes for 1.16
Brian Anderson [Wed, 15 Feb 2017 02:52:28 +0000 (18:52 -0800)]
Release notes for 1.16

7 years agoAuto merge of #40382 - alexcrichton:split-tested-targets, r=brson
bors [Thu, 9 Mar 2017 20:46:14 +0000 (20:46 +0000)]
Auto merge of #40382 - alexcrichton:split-tested-targets, r=brson

travis: Split the linux-tested-targets builder

Travis only gives us 30GB disk space and we don't currently have an option to
increase that. Each musl target generates "hello world" binaries of about 3.5MB
in size, and we're testing two targets in the same image. We have around 3k
run-pass tests and 2 musl targets which works out to around 20GB. That's
dangerously close to the limit and is causing PRs to bounce.

This PR splits up the builder in two, one for x86_64 musl and the other for
i686. Hopefully that'll keep us under the disk limit.

Closes #40359

7 years agotravis: Split the linux-tested-targets builder
Alex Crichton [Thu, 9 Mar 2017 03:46:44 +0000 (19:46 -0800)]
travis: Split the linux-tested-targets builder

Travis only gives us 30GB disk space and we don't currently have an option to
increase that. Each musl target generates "hello world" binaries of about 3.5MB
in size, and we're testing two targets in the same image. We have around 3k
run-pass tests and 2 musl targets which works out to around 20GB. That's
dangerously close to the limit and is causing PRs to bounce.

This PR splits up the builder in two, one for x86_64 musl and the other for
i686. Hopefully that'll keep us under the disk limit.

Closes #40359

7 years agorustc: Prefer loading crates in the sysroot
Alex Crichton [Mon, 6 Mar 2017 22:44:38 +0000 (14:44 -0800)]
rustc: Prefer loading crates in the sysroot

This commit is a random stab in the dark to fix the spurious failures on #39518.
The leading theory of the spurious failures on Windows is that the compiler is
loading a path in the `deps` folder, passing it to `link.exe`, and then this is
racing with Cargo itself updating those paths.

This race, however, has a few unique properties:

* It's isolated to just libstd. Most crates are never passed to the linker and
  simultaneously being worked on by Cargo. Cargo's typical execution of the
  dependency graph never hits this problem.
* The crates are already all located in the sysroot in addition to the `deps`
  folder. This means that the compiler actually has two candidates of crates to
  load, and it's just arbitrarily rejecting one.

Together this means that we shouldn't need to fix this problem "in the large"
and we can instead just fix it in this isolated situation (hopefully). To solve
this the compiler's been updated to prefer crates from the sysroot to leave
Cargo's structure to itself.

We'll see if this actually allows the PR to land...

7 years agorustbuild: Use copies instead of hard links
Alex Crichton [Sat, 4 Feb 2017 01:12:58 +0000 (17:12 -0800)]
rustbuild: Use copies instead of hard links

The original motivation for hard links was to speed up the various stages of
rustbuild, but in the end this is causing problems on Windows (#39504).

This commit tweaks the build system to use copies instead of hard links
unconditionally to ensure that the files accessed by Windows are always
disjoint.

Locally this added .3s to a noop build, so it shouldn't be too much of a
regression hopefully!

7 years agoAuto merge of #40368 - arielb1:rollup, r=arielb1
bors [Thu, 9 Mar 2017 08:26:17 +0000 (08:26 +0000)]
Auto merge of #40368 - arielb1:rollup, r=arielb1

Rollup of 20 pull requests

- Successful merges: #40154, #40222, #40226, #40237, #40254, #40258, #40265, #40268, #40279, #40283, #40292, #40293, #40296, #40316, #40321, #40325, #40326, #40327, #40333, #40335
- Failed merges:

7 years agoAuto merge of #40337 - alexcrichton:racy-dirs, r=brson
bors [Thu, 9 Mar 2017 06:06:34 +0000 (06:06 +0000)]
Auto merge of #40337 - alexcrichton:racy-dirs, r=brson

rustbuild: Assert directory creation succeeds

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.

7 years agoAuto merge of #40371 - arielb1:bean-counter, r=alexcrichton
bors [Thu, 9 Mar 2017 00:20:25 +0000 (00:20 +0000)]
Auto merge of #40371 - arielb1:bean-counter, r=alexcrichton

add some disk usage accounting

Try to figure out why we are out of free space

r? @alexcrichton

7 years agoadd some disk usage accounting
Ariel Ben-Yehuda [Wed, 8 Mar 2017 20:19:33 +0000 (22:19 +0200)]
add some disk usage accounting

Try to figure out why we are out of free space

7 years agoRollup merge of #40335 - tbu-:pr_doc_str_to_somecase, r=steveklabnik
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:10 +0000 (20:54 +0200)]
Rollup merge of #40335 - tbu-:pr_doc_str_to_somecase, r=steveklabnik

Document why `str.to_{lower,upper}case` return `String`

Fixes #39201.

7 years agoRollup merge of #40333 - tbu-:pr_doc_ptr_write, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:08 +0000 (20:54 +0200)]
Rollup merge of #40333 - tbu-:pr_doc_ptr_write, r=alexcrichton

Clarify handling of `src` in `ptr::write`

Fixes #39733.

7 years agoRollup merge of #40327 - GuillaumeGomez:macros-urls, r=frewsxcv
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:07 +0000 (20:54 +0200)]
Rollup merge of #40327 - GuillaumeGomez:macros-urls, r=frewsxcv

Add missing urls in some macros doc

r? @frewsxcv

7 years agoRollup merge of #40326 - crazymerlyn:fix-doc-link, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:06 +0000 (20:54 +0200)]
Rollup merge of #40326 - crazymerlyn:fix-doc-link, r=alexcrichton

Update link to COMPILER_TESTS.md in CONTRIBUTING.md

Link to compiler test documentation was broken after the file was moved by #40086.
This updates the link to the new location of the file.

7 years agoRollup merge of #40325 - eddyb:pr38143, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:05 +0000 (20:54 +0200)]
Rollup merge of #40325 - eddyb:pr38143, r=alexcrichton

Added remove_from to vec.rs (#38143)

Turns out that if you push to someone's PR branch and cause the PR to close, you lose delegation šŸ˜ž.

@madseagames I'm really sorry about that šŸ˜­

7 years agoRollup merge of #40321 - joelgallant:joelgallant-readme, r=aturon
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:03 +0000 (20:54 +0200)]
Rollup merge of #40321 - joelgallant:joelgallant-readme, r=aturon

README formatting in configure/make section

Tiny change to render the `config.mk` correctly

7 years agoRollup merge of #40316 - oli-obk:patch-4, r=GuillaumeGomez
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:02 +0000 (20:54 +0200)]
Rollup merge of #40316 - oli-obk:patch-4, r=GuillaumeGomez

Fix a typo in the docs

7 years agoRollup merge of #40296 - topecongiro:add-missing-tests, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:01 +0000 (20:54 +0200)]
Rollup merge of #40296 - topecongiro:add-missing-tests, r=alexcrichton

Add tests for issues with the 'E-needtest' label.

This PR adds tests for the following issues:

7 years agoRollup merge of #40293 - malbarbo:rustdoctest, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:00 +0000 (20:54 +0200)]
Rollup merge of #40293 - malbarbo:rustdoctest, r=alexcrichton

Remove extra space in test description (of a mod test)

7 years agoRollup merge of #40292 - mmatyas:readme_fix, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:59 +0000 (20:53 +0200)]
Rollup merge of #40292 - mmatyas:readme_fix, r=alexcrichton

Fix text formatting in README

There was a missing backtick in the README.

7 years agoRollup merge of #40283 - oconnor663:args_docs, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:58 +0000 (20:53 +0200)]
Rollup merge of #40283 - oconnor663:args_docs, r=alexcrichton

clarify docs for Args and ArgsOs

The args() and args_os() docs include a line about how the first element
is usually the program name. Include that line in the struct docs too.

7 years agoRollup merge of #40279 - gibfahn:test-unwind, r=est31
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:57 +0000 (20:53 +0200)]
Rollup merge of #40279 - gibfahn:test-unwind, r=est31

Add compile-fail tests for remaining items in whitelist and remove it

Add compile-fail tests for `cfg_target_thread_local` and `unwind_attributes`, and remove the whitelist.

Let me know if I should clean up the tests (or if I've done anything else wrong, this is my first contribution to rust).

cc/ @est31

7 years agoRollup merge of #40268 - Mark-Simulacrum:normalization-followup, r=arielb1
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:56 +0000 (20:53 +0200)]
Rollup merge of #40268 - Mark-Simulacrum:normalization-followup, r=arielb1

Fix normalization error

Follows #40163. I don't know whether this is good, but seems logical.

[This block of code](https://github.com/rust-lang/rust/blob/ba07bd5d23aced6d4baa5696213b11ca832c1a5d/src/librustc_typeck/check/mod.rs#L2110-L2138) doesn't contain a call to `normalize_associated_types_in`, while [this](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/mod.rs#L2027-L2028) block does, and is nearly identical.

Ideally these two blocks should be unified into one, but since the change doesn't seem trivial and I'm unsure if this patch will be accepted it hasn't been done yet.

r? @arielb1

7 years agoRollup merge of #40265 - wesleywiser:rustdoc_style, r=GuillaumeGomez
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:55 +0000 (20:53 +0200)]
Rollup merge of #40265 - wesleywiser:rustdoc_style, r=GuillaumeGomez

Improve the style of the sidebar in rustdoc output

Makes the sidebar a light grey and highlights the currently viewed item in the sidebar more prominently.

All visual design credit goes to @johnwhelchel (#37856)

Sample screenshots:

![screen shot 2017-03-04 at 12 29 48 pm](https://cloud.githubusercontent.com/assets/831192/23580829/db6c26c2-00d6-11e7-8d89-822e25ba79f0.png)

![screen shot 2017-03-04 at 12 30 10 pm](https://cloud.githubusercontent.com/assets/831192/23580828/db69eeca-00d6-11e7-9f89-1e06fd3bf098.png)

![screen shot 2017-03-04 at 12 30 31 pm](https://cloud.githubusercontent.com/assets/831192/23580830/db6d00ce-00d6-11e7-89ca-cd03e148a121.png)

7 years agoRollup merge of #40258 - est31:master, r=nikomatsakis
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:54 +0000 (20:53 +0200)]
Rollup merge of #40258 - est31:master, r=nikomatsakis

Fix description of closure coercion feature

Thanks to @whitequark for pointing this out.

7 years agoRollup merge of #40254 - nagisa:compiler-builtin-no-panic, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:53 +0000 (20:53 +0200)]
Rollup merge of #40254 - nagisa:compiler-builtin-no-panic, r=alexcrichton

Fix personality_fn within the compiler_builtins

compiler_builtins may not have any unwinding within it to link correctly. This is notoriously
finicky, and this small piece of change removes yet another case where personality function
happens to get introduced.

Side note: I do remember solving the exact same thing before. I wonder why it has reappered...

@cuviper, could you please try building beta with this patch applied? It should apply cleanly. If it works, Iā€™ll nominate to land this into beta.

Fixes(?) https://github.com/rust-lang/rust/issues/40251

7 years agoRollup merge of #40237 - arthurprs:hm-adapt2, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:52 +0000 (20:53 +0200)]
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
7 years agoRollup merge of #40226 - jdhorwitz:master, r=frewsxcv
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:51 +0000 (20:53 +0200)]
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

7 years agoRollup merge of #40222 - steveklabnik:extract-nomicon, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:50 +0000 (20:53 +0200)]
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

7 years agoRollup merge of #40154 - steveklabnik:link-unstable-book, r=frewsxcv
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:48 +0000 (20:53 +0200)]
Rollup merge of #40154 - steveklabnik:link-unstable-book, r=frewsxcv

add unstable book to the bookshelf

r? @frewsxcv @GuillaumeGomez

7 years agoAuto merge of #39860 - japaric:san, r=alexcrichton
bors [Wed, 8 Mar 2017 13:00:13 +0000 (13:00 +0000)]
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

7 years agoAuto merge of #39713 - estebank:issue-39698, r=jonathandturner
bors [Wed, 8 Mar 2017 09:30:13 +0000 (09:30 +0000)]
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.

7 years agorustbuild: Assert directory creation succeeds
Alex Crichton [Tue, 7 Mar 2017 23:24:36 +0000 (15:24 -0800)]
rustbuild: Assert directory creation succeeds

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.

7 years agoDocument why `str.to_{lower,upper}case` return `String`
Tobias Bucher [Tue, 7 Mar 2017 23:06:09 +0000 (00:06 +0100)]
Document why `str.to_{lower,upper}case` return `String`

Fixes #39201.

7 years agoClarify handling of `src` in `ptr::write`
Tobias Bucher [Tue, 7 Mar 2017 22:39:49 +0000 (23:39 +0100)]
Clarify handling of `src` in `ptr::write`

Fixes #39733.

7 years agoAdd missing urls in some macros doc
Guillaume Gomez [Tue, 7 Mar 2017 18:13:17 +0000 (19:13 +0100)]
Add missing urls in some macros doc

7 years agoAdded remove_from to vec.rs
madseagames [Sat, 3 Dec 2016 16:47:27 +0000 (12:47 -0400)]
Added remove_from to vec.rs

7 years agoUpdate link to COMPILER_TESTS.md in CONTRIBUTING.md
CrazyMerlyn [Tue, 7 Mar 2017 17:43:31 +0000 (23:13 +0530)]
Update link to COMPILER_TESTS.md in CONTRIBUTING.md

7 years agoREADME formatting in configure/make section
Joel Gallant [Tue, 7 Mar 2017 16:00:33 +0000 (09:00 -0700)]
README formatting in configure/make section

7 years agoFix a typo in the docs
Oliver Schneider [Tue, 7 Mar 2017 09:45:13 +0000 (10:45 +0100)]
Fix a typo in the docs

7 years agoAdd tests for issues with the 'E-needtest' label.
topecongiro [Mon, 6 Mar 2017 15:19:48 +0000 (00:19 +0900)]
Add tests for issues with the 'E-needtest' label.

7 years agoImprove the style of the sidebar in rustdoc output
Wesley Wiser [Thu, 16 Feb 2017 01:21:25 +0000 (20:21 -0500)]
Improve the style of the sidebar in rustdoc output

Makes the sidebar a light grey and highlights the currently viewed item
in the sidebar more prominently.

All visual design credit goes to @johnwhelchel (#37856)

7 years agoAuto merge of #40272 - jseyfried:fix_const_macro_invocations, r=petrochenkov
bors [Mon, 6 Mar 2017 15:04:10 +0000 (15:04 +0000)]
Auto merge of #40272 - jseyfried:fix_const_macro_invocations, r=petrochenkov

macros: fix const expression invocations

Fixes #40136.
r? @nrc

7 years agoRemove reference to Ty.
Mark Simulacrum [Sun, 5 Mar 2017 17:36:31 +0000 (10:36 -0700)]
Remove reference to Ty.

7 years agoUnify both conflicting default searches into one.
Mark Simulacrum [Sun, 5 Mar 2017 17:15:58 +0000 (10:15 -0700)]
Unify both conflicting default searches into one.

7 years agoRemove extra space in test description (of a mod test)
Marco A L Barbosa [Mon, 6 Mar 2017 13:05:31 +0000 (10:05 -0300)]
Remove extra space in test description (of a mod test)

7 years agoFix text formatting in README
MƔtyƔs Mustoha [Mon, 6 Mar 2017 11:29:52 +0000 (12:29 +0100)]
Fix text formatting in README

7 years agoAuto merge of #40276 - topecongiro:add-test, r=petrochenkov
bors [Mon, 6 Mar 2017 09:17:06 +0000 (09:17 +0000)]
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.

7 years agoAdd missing tests for 'E-needstest' labeled issues
topecongiro [Sat, 4 Mar 2017 02:46:14 +0000 (11:46 +0900)]
Add missing tests for 'E-needstest' labeled issues

7 years agoAuto merge of #40285 - estebank:issue-40221, r=frewsxcv
bors [Mon, 6 Mar 2017 03:24:09 +0000 (03:24 +0000)]
Auto merge of #40285 - estebank:issue-40221, r=frewsxcv

Fix ICE: don't use `struct_variant` on enums

Fix #40221 and add unittest.

7 years agoUse `BTreeSet` instead of `FxHashSet`
Esteban KĆ¼ber [Sun, 5 Mar 2017 23:19:05 +0000 (20:19 -0300)]
Use `BTreeSet` instead of `FxHashSet`

7 years agoClean up "pattern doesn't bind x" messages
Esteban KĆ¼ber [Fri, 10 Feb 2017 01:54:56 +0000 (17:54 -0800)]
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

7 years agoFix ICE: don't use `struct_variant` on enums
Esteban KĆ¼ber [Mon, 6 Mar 2017 00:18:22 +0000 (21:18 -0300)]
Fix ICE: don't use `struct_variant` on enums

Fix #40221 and add unittest.

7 years agoIssue #39688 - Help people find String::as_bytes() for UTF-8 r? @steveklabnik
Joshua Horwitz [Fri, 3 Mar 2017 06:24:19 +0000 (01:24 -0500)]
Issue #39688 - Help people find String::as_bytes() for UTF-8 r? @steveklabnik

7 years agoFix const expression macro invocations.
Jeffrey Seyfried [Sun, 5 Mar 2017 08:14:21 +0000 (08:14 +0000)]
Fix const expression macro invocations.

7 years agoclarify docs for Args and ArgsOs
Jack O'Connor [Sun, 5 Mar 2017 21:39:24 +0000 (16:39 -0500)]
clarify docs for Args and ArgsOs

The args() and args_os() docs include a line about how the first element
is usually the program name. Include that line in the struct docs too.

7 years agoRemove the compile-fail feature gates whitelist
Gibson Fahnestock [Sun, 5 Mar 2017 20:26:23 +0000 (20:26 +0000)]
Remove the compile-fail feature gates whitelist

No longer necessary now that the whitelist is empty.

Fixes: https://github.com/rust-lang/rust/issues/39059
7 years agoAdd compile-fail test for cfg_target_thread_local
Gibson Fahnestock [Sun, 5 Mar 2017 20:10:39 +0000 (20:10 +0000)]
Add compile-fail test for cfg_target_thread_local

Test copied from src/test/run-pass/thread-local-extern-static.rs.

Refs: https://github.com/rust-lang/rust/issues/39059

7 years agoAdd compile-fail test for unwind_attributes
Gibson Fahnestock [Sun, 5 Mar 2017 19:32:46 +0000 (19:32 +0000)]
Add compile-fail test for unwind_attributes

Test copied from src/test/codegen/extern-functions.rs.

Refs: https://github.com/rust-lang/rust/issues/39059

7 years agoAuto merge of #40266 - Mark-Simulacrum:cleanup-parser, r=petrochenkov
bors [Sun, 5 Mar 2017 19:53:29 +0000 (19:53 +0000)]
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).

7 years agosanitizer runtime crates shouldn't be tested
Jorge Aparicio [Wed, 22 Feb 2017 03:05:19 +0000 (22:05 -0500)]
sanitizer runtime crates shouldn't be tested

7 years agocleanup: remove the *san Cargo features from std
Jorge Aparicio [Wed, 15 Feb 2017 22:00:41 +0000 (17:00 -0500)]
cleanup: remove the *san Cargo features from std

these belong to a previous iteration of the sanitizer implementation

7 years agoAuto merge of #40252 - topecongiro:compile-fail-test-cfg-stmt-expr, r=petrochenkov
bors [Sun, 5 Mar 2017 17:47:06 +0000 (17:47 +0000)]
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.

7 years agoAdd compile fail test for stmt_expr_attributes
topecongiro [Sat, 4 Mar 2017 02:46:14 +0000 (11:46 +0900)]
Add compile fail test for stmt_expr_attributes

7 years agoInline function to avoid naming confusion.
Mark Simulacrum [Sat, 4 Mar 2017 19:37:45 +0000 (12:37 -0700)]
Inline function to avoid naming confusion.

7 years agoFix normalization error.
Mark Simulacrum [Sat, 4 Mar 2017 23:44:02 +0000 (16:44 -0700)]
Fix normalization error.

7 years agoAuto merge of #40236 - petrochenkov:btweak, r=alexcrichton
bors [Sat, 4 Mar 2017 19:20:58 +0000 (19:20 +0000)]
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

7 years agoAutomate timestamp creation and build skipping for native libraries
Vadim Petrochenkov [Fri, 3 Mar 2017 17:11:04 +0000 (20:11 +0300)]
Automate timestamp creation and build skipping for native libraries

Add comments

7 years agoDo not purge LLVM build directory on rebuild
Vadim Petrochenkov [Fri, 3 Mar 2017 14:18:44 +0000 (17:18 +0300)]
Do not purge LLVM build directory on rebuild

Add some comments

7 years agoSeparate "ui-fulldeps" tests from "ui" tests
Vadim Petrochenkov [Fri, 3 Mar 2017 10:28:22 +0000 (13:28 +0300)]
Separate "ui-fulldeps" tests from "ui" tests

7 years agobootstrap.py: Report build status
Vadim Petrochenkov [Fri, 3 Mar 2017 02:27:07 +0000 (05:27 +0300)]
bootstrap.py: Report build status

Move some code from x.py to bootstrap.py

7 years agorun-make on MSVC: Do not generate object files in the source directory
Vadim Petrochenkov [Fri, 3 Mar 2017 00:09:35 +0000 (03:09 +0300)]
run-make on MSVC: Do not generate object files in the source directory

7 years agoBuild compiler-rt and sanitizers only once
Vadim Petrochenkov [Thu, 2 Mar 2017 23:15:56 +0000 (02:15 +0300)]
Build compiler-rt and sanitizers only once

7 years agoSupport combination MSVC + Ninja
Vadim Petrochenkov [Mon, 27 Feb 2017 20:39:16 +0000 (23:39 +0300)]
Support combination MSVC + Ninja

7 years agoAdd/remove `rerun-if-changed` when necessary
Vadim Petrochenkov [Thu, 23 Feb 2017 15:49:54 +0000 (18:49 +0300)]
Add/remove `rerun-if-changed` when necessary

7 years agoimport nomicon submodule
steveklabnik [Fri, 3 Mar 2017 01:15:41 +0000 (20:15 -0500)]
import nomicon submodule

7 years agoremove nomicon
steveklabnik [Fri, 3 Mar 2017 01:14:40 +0000 (20:14 -0500)]
remove nomicon

7 years agoAuto merge of #40213 - steveklabnik:extract-reference, r=alexcrichton
bors [Sat, 4 Mar 2017 15:40:10 +0000 (15:40 +0000)]
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

7 years agoimport reference submodule
steveklabnik [Thu, 2 Mar 2017 23:47:06 +0000 (18:47 -0500)]
import reference submodule

7 years agoremove reference
steveklabnik [Thu, 2 Mar 2017 23:44:45 +0000 (18:44 -0500)]
remove reference

7 years agoFix description of closure coercion feature
est31 [Sat, 4 Mar 2017 13:31:34 +0000 (14:31 +0100)]
Fix description of closure coercion feature

7 years agoAuto merge of #40245 - cuviper:maybe-not-pie, r=alexcrichton
bors [Sat, 4 Mar 2017 12:33:35 +0000 (12:33 +0000)]
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.

7 years agoAuto merge of #40242 - cramertj:fix-while-let-ribs-scope, r=petrochenkov
bors [Sat, 4 Mar 2017 10:21:30 +0000 (10:21 +0000)]
Auto merge of #40242 - cramertj:fix-while-let-ribs-scope, r=petrochenkov

Fix missing WhileLet pattern scope

Fix #40235

7 years agoFix personality_fn within the compiler_builtins
Simonas Kazlauskas [Sat, 4 Mar 2017 09:08:14 +0000 (11:08 +0200)]
Fix personality_fn within the compiler_builtins

compiler_builtins may not have any unwinding within it to link correctly. This is notoriously
finicky, and this small piece of change removes yet another case where personality function
happens to get introduced.

Side note: I do remember solving the exact same thing before. I wonder why it has reappered...

7 years agoAuto merge of #40207 - phil-opp:llvm-submodule-update, r=alexcrichton
bors [Sat, 4 Mar 2017 08:10:52 +0000 (08:10 +0000)]
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 https://github.com/rust-lang/llvm/commit/50ab09fb43f038e4f824eea6cb278f560d3e8621).

7 years agoAuto merge of #40202 - jseyfried:integrate_tokenstream, r=nrc
bors [Sat, 4 Mar 2017 05:44:12 +0000 (05:44 +0000)]
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

7 years agoAuto merge of #40163 - arielb1:normalization-1702, r=nikomatsakis
bors [Sat, 4 Mar 2017 01:47:51 +0000 (01:47 +0000)]
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.

7 years agoAuto merge of #39917 - alexcrichton:build-cargo, r=brson
bors [Fri, 3 Mar 2017 23:26:26 +0000 (23:26 +0000)]
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.

7 years agoReduce size overhead of adaptative hashmap
arthurprs [Fri, 3 Mar 2017 19:31:54 +0000 (20:31 +0100)]
Reduce size overhead of adaptative hashmap

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

Fixes: #40042
7 years agoLet `-Crelocation-model` better control `-pie` linking
Josh Stone [Fri, 3 Mar 2017 19:39:11 +0000 (11:39 -0800)]
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.

7 years agoFix missing WhileLet pattern scope
Taylor Cramer [Fri, 3 Mar 2017 17:40:44 +0000 (09:40 -0800)]
Fix missing WhileLet pattern scope

7 years agoAuto merge of #40101 - danobi:feat_gate_test_simd, r=alexcrichton
bors [Fri, 3 Mar 2017 17:26:10 +0000 (17:26 +0000)]
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.

7 years agorustbuild: Add support for compiling Cargo
Alex Crichton [Wed, 15 Feb 2017 23:57:06 +0000 (15:57 -0800)]
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.

7 years agoAuto merge of #40133 - arielb1:operand-lifetimes, r=eddyb
bors [Fri, 3 Mar 2017 13:12:08 +0000 (13:12 +0000)]
Auto merge of #40133 - arielb1:operand-lifetimes, r=eddyb

[MIR] improve operand lifetimes

r? @eddyb

7 years agowork around LLVM PR#32123
Ariel Ben-Yehuda [Fri, 3 Mar 2017 00:32:32 +0000 (02:32 +0200)]
work around LLVM PR#32123

7 years agofix codegen test
Ariel Ben-Yehuda [Tue, 28 Feb 2017 11:15:15 +0000 (13:15 +0200)]
fix codegen test

7 years agomake operands live to the end of their containing expression
Ariel Ben-Yehuda [Sun, 26 Feb 2017 14:21:08 +0000 (16:21 +0200)]
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.

7 years agoAuto merge of #40189 - SimonSapin:one-width, r=alexcrichton
bors [Fri, 3 Mar 2017 09:57:57 +0000 (09:57 +0000)]
Auto merge of #40189 - SimonSapin:one-width, r=alexcrichton

Reduce std_unicodeā€™s public API

 * Only keep one copy of the `UTF8_CHAR_WIDTH` table instead of one of each of libcore and libstd_unicode.
* Move the `utf8_char_width` function to `core::str` under the `str_internals` unstable feature.
* Remove `std_unicode::str::is_utf16`. It was only accessible through the `#[unstable]` crate std_unicode. It has never been used in the compiler or standard library since 47e7a05 added it in 2012 ā€œfor OS API interopā€. It can be replaced with a one-liner:

   ```rust
   fn is_utf16(slice: &[u16]) -> bool {
       std::char::decode_utf16(s).all(|r| r.is_ok())
   }
   ```