]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #40259 - TimNN:fix-emscripten-tests, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:22 +0000 (16:51 -0600)]
Rollup merge of #40259 - TimNN:fix-emscripten-tests, r=alexcrichton

Fix emscripten test detection

Without this change `rustbuild` will attempt to run `.js.map` files (if they exist) resulting in lots of sadness.

r? @alexcrichton

7 years agoRollup merge of #40239 - nagisa:death-to-plugins, r=nikomatsakis
Alex Crichton [Fri, 10 Mar 2017 22:51:20 +0000 (16:51 -0600)]
Rollup merge of #40239 - nagisa:death-to-plugins, r=nikomatsakis

Remove ability for plugins to register a MIR pass

In recent months there have been a few different people investigating how to make a plugin that
registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper.

The interface to register MIR passes was added primarily for miri (& later was
found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use
this interface anymore it seems like a good time to remove this "feature".

For prototyping purposes a similar interface can be added by developers themselves in their custom
rustc build.

cc @nikomatsakis

7 years agoRollup merge of #40225 - shepmaster:restore-build-date-file, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:19 +0000 (16:51 -0600)]
Rollup merge of #40225 - shepmaster:restore-build-date-file, r=alexcrichton

Restore creating the channel-rust-$channel-date.txt files

I have **not** run this (because I don't know how to 😇), but it *does* compile.

r? @alexcrichton

7 years agoRollup merge of #40092 - sinkuu:fix_suggestion_index, r=pnkfelix
Alex Crichton [Fri, 10 Mar 2017 22:51:16 +0000 (16:51 -0600)]
Rollup merge of #40092 - sinkuu:fix_suggestion_index, r=pnkfelix

Fix suggestion span error with a line containing multibyte characters

This PR fixes broken suggestions caused by multibyte characters.

e.g. for this code, rustc provides a broken suggestion ([playground](https://is.gd/DWGLu7)):

```rust
fn main() {
    let tup = (1,);
    println!("☃{}", tup[0]);
}
```

```
error: cannot index a value of type `({integer},)`
 --> <anon>:3:21
  |
3 |     println!("☃{}", tup[0]);
  |                     ^^^^^^
  |
help: to access tuple elements, use tuple indexing syntax as shown
  |     println!("☃{}"tup.00]);

error: aborting due to previous error
```

`CodeSuggestion::splice_lines` is misusing `Loc.col` (`CharPos`) as a byte offset when slicing source.

7 years agoRollup merge of #39918 - petrhosek:fuchsia-ci, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:14 +0000 (16:51 -0600)]
Rollup merge of #39918 - petrhosek:fuchsia-ci, r=alexcrichton

travis: Fuchsia builder

This change introduces a Dockerfile and script which builds a complete
Fuchsia toolchain which can be used to build Rust distribution for
Fuchsia. We only support cross-compiling at the moment, hence only
setting the target.

7 years agoRollup merge of #39820 - jonasbb:export-attributes, r=nrc
Alex Crichton [Fri, 10 Mar 2017 22:51:13 +0000 (16:51 -0600)]
Rollup merge of #39820 - jonasbb:export-attributes, r=nrc

Export attributes in save-analysis data

Since this is my first pull-request to rust, I would like to get some feedback about obvious errors in this implementation.

I would like to change the save-analysis data to include arbitrary attribute data.
A use-case I have in mind for this is identifying functions with `#[test]` annotations such that tools like rls can offer a test-runner feature. I described my idea here [rls#173](https://github.com/rust-lang-nursery/rls/issues/173).

My changes contain:

1. track a vector of attributes in the various `*Data` types in `data.rs` and `external_data.rs`
2. implement lowering for `Attribute` and `MetaItem`
3. adjust `JsonDumper` to print the attributes

In the lowering of `Attribute` I remove the distinction between `MetaItem` and `NestedMetaItem`. I did this because this distinction is somewhat confusing. For example, `NestedMetaItemKind::Literal` has two identical spans, because both `NestedMetaItem` and `Lit` are defined as `Spanned<_>`.
My model is strictly more general, as it allows an `LitKind` instead of a `Symbol` for `MetaItem` and `Symbol`s are converted into a cooked string. As a consumer of the save-analysis data this shouldn't affect you much.

Example json output of `#[test]` annotation:
```
"attributes": [
  {
    "value": {
      "name": {
        "variant": "Str",
        "fields": [
          "test",
          "Cooked"
        ]
      },
      "kind": "Literal",
      "span": {
        "file_name": "test.rs",
        "byte_start": 2,
        "byte_end": 6,
        "line_start": 1,
        "line_end": 1,
        "column_start": 3,
        "column_end": 7
      }
    },
    "span": {
      "file_name": "test.rs",
      "byte_start": 0,
      "byte_end": 7,
      "line_start": 1,
      "line_end": 1,
      "column_start": 1,
      "column_end": 8
    }
  }
]
```

7 years agoRollup merge of #39202 - estebank:nested-unsafe, r=jonathandturner
Alex Crichton [Fri, 10 Mar 2017 22:51:12 +0000 (16:51 -0600)]
Rollup merge of #39202 - estebank:nested-unsafe, r=jonathandturner

Point to enclosing block/fn on nested unsafe

When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
block` or `unsafe fn` that makes it unnecessary.

<img width="621" alt="" src="https://cloud.githubusercontent.com/assets/1606434/22139922/26ad468a-de9e-11e6-8884-2945be882ea8.png">

Fixes #39144.

7 years agotravis: Fuchsia builder
Petr Hosek [Fri, 17 Feb 2017 04:54:24 +0000 (20:54 -0800)]
travis: Fuchsia builder

This change introduces a Dockerfile and script which builds a complete
Fuchsia toolchain which can be used to build Rust distribution for
Fuchsia. We only support cross-compiling at the moment, hence only
setting the target.

7 years agoRemove ability for plugins to register a MIR pass
Simonas Kazlauskas [Fri, 3 Mar 2017 17:11:34 +0000 (19:11 +0200)]
Remove ability for plugins to register a MIR pass

In recent months there have been a few different people investigating how to make a plugin that
registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper.

The interface to register MIR passes was added primarily for miri (& later was
found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use
this interface anymore it seems like a good time to remove this "feature".

For prototyping purposes a similar interface can be added by developers themselves in their custom
rustc build.

7 years agoMove remove_docs_from_attrs into lowering step
Jonas Bushart [Thu, 2 Mar 2017 21:38:57 +0000 (22:38 +0100)]
Move remove_docs_from_attrs into lowering step

7 years agoStore attributes as strings
Jonas Bushart [Thu, 23 Feb 2017 22:24:12 +0000 (23:24 +0100)]
Store attributes as strings

Remove the AST structure

7 years agoExport attributes in save-analysis data
Jonas Bushart [Tue, 14 Feb 2017 10:05:53 +0000 (11:05 +0100)]
Export attributes in save-analysis data

Some annotations like the "test" annotations might be of interest for
other projects, especially rls. Export all attributes in a new
attributes item.

7 years agoPoint to enclosing block/fn on nested unsafe
Esteban Küber [Fri, 20 Jan 2017 07:17:48 +0000 (23:17 -0800)]
Point to enclosing block/fn on nested unsafe

When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
block` or `unsafe fn` that makes it unnecessary.

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 agoRestore creating the channel-rust-$channel-date.txt files
Jake Goulding [Fri, 3 Mar 2017 04:39:15 +0000 (23:39 -0500)]
Restore creating the channel-rust-$channel-date.txt files

7 years agoFix botched member variable rename
Jake Goulding [Sat, 4 Mar 2017 15:07:55 +0000 (10:07 -0500)]
Fix botched member variable rename

7 years agofix emscripten test detection
Tim Neumann [Sat, 4 Mar 2017 13:59:49 +0000 (14:59 +0100)]
fix emscripten test detection

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