]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #43409 - tshepang:concise, r=steveklabnik
Mark Simulacrum [Sun, 30 Jul 2017 00:03:51 +0000 (18:03 -0600)]
Rollup merge of #43409 - tshepang:concise, r=steveklabnik

doc: make into_iter example more concise

Also, remove dupe example

6 years agoAuto merge of #43541 - gaurikholkar:lifetime_errors, r=nikomatsakis
bors [Sat, 29 Jul 2017 19:41:53 +0000 (19:41 +0000)]
Auto merge of #43541 - gaurikholkar:lifetime_errors, r=nikomatsakis

Changing E0623 error message - both anonymous lifetime regions

Changing the error message to
```
error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions.rs:12:12
   |
11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
   |                    ---      --- these references are not declared with the same lifetime...
12 |     x.push(y);
   |            ^ ...but data from `y` flows into `x` here

error: aborting due to previous error
```
cc @nikomatsakis @aturon @jonathandturner

r? @nikomatsakis

6 years agoAuto merge of #43534 - alexcrichton:cargo-target-runner, r=Mark-Simulacrum
bors [Sat, 29 Jul 2017 12:30:12 +0000 (12:30 +0000)]
Auto merge of #43534 - alexcrichton:cargo-target-runner, r=Mark-Simulacrum

rustbuild: Use Cargo's "target runner"

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.

6 years agochanging E0623 error message
gaurikholkar [Sat, 29 Jul 2017 12:07:05 +0000 (17:37 +0530)]
changing E0623 error message

6 years agoAuto merge of #43530 - alexcrichton:update-freebsd-compilers, r=Mark-Simulacrum,cuviper
bors [Sat, 29 Jul 2017 08:48:57 +0000 (08:48 +0000)]
Auto merge of #43530 - alexcrichton:update-freebsd-compilers, r=Mark-Simulacrum,cuviper

rustbuild: Update cross-compilers for FreeBSD

When working through bugs for the LLVM 5.0 upgrade it looks like the FreeBSD
cross compilers we're currently using are unable to build LLVM, failing with
references to the function `std::to_string` claiming it doesn't exist. I don't
actually know what this function is, but assuming that it was added in a more
recent version of a C++ standard I've updated the gcc versions for the
toolchains we're using. This made the error go away!

6 years agoAuto merge of #43527 - alexcrichton:different-llvm-cross, r=Mark-Simulacrum
bors [Sat, 29 Jul 2017 06:13:55 +0000 (06:13 +0000)]
Auto merge of #43527 - alexcrichton:different-llvm-cross, r=Mark-Simulacrum

rustbuild: Tweak how we cross-compile LLVM

In preparation for upgrading to LLVM 5.0 it looks like we need to tweak how we
cross compile LLVM slightly. It's using `CMAKE_SYSTEM_NAME` to infer whether to
build libFuzzer which only works on some platforms, and then once we configure
that it needs to apparently reach into the host build area to try to compile
`llvm-config` as well. Once these are both configured, though, it looks like we
can successfully cross-compile LLVM.

6 years agoAuto merge of #43492 - lu-zero:master, r=alexcrichton
bors [Sat, 29 Jul 2017 03:58:18 +0000 (03:58 +0000)]
Auto merge of #43492 - lu-zero:master, r=alexcrichton

More Altivec Intrinsics

6 years agoAuto merge of #43518 - cuviper:aapcs_vfp, r=eddyb
bors [Sat, 29 Jul 2017 01:43:03 +0000 (01:43 +0000)]
Auto merge of #43518 - cuviper:aapcs_vfp, r=eddyb

Support homogeneous aggregates for hard-float ARM

Hard-float ARM targets use the AAPCS-VFP ABI, which passes and returns
homogeneous float/vector aggregates in the VFP registers.

Fixes #43329.

r? @eddyb

6 years agorustbuild: Use Cargo's "target runner"
Alex Crichton [Sat, 29 Jul 2017 00:52:44 +0000 (17:52 -0700)]
rustbuild: Use Cargo's "target runner"

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.

6 years agorustbuild: Update cross-compilers for FreeBSD
Alex Crichton [Fri, 28 Jul 2017 21:26:02 +0000 (14:26 -0700)]
rustbuild: Update cross-compilers for FreeBSD

When working through bugs for the LLVM 5.0 upgrade it looks like the FreeBSD
cross compilers we're currently using are unable to build LLVM, failing with
references to the function `std::to_string` claiming it doesn't exist. I don't
actually know what this function is, but assuming that it was added in a more
recent version of a C++ standard I've updated the gcc versions for the
toolchains we're using. This made the error go away!

6 years agorustbuild: Tweak how we cross-compile LLVM
Alex Crichton [Fri, 28 Jul 2017 19:17:52 +0000 (12:17 -0700)]
rustbuild: Tweak how we cross-compile LLVM

In preparation for upgrading to LLVM 5.0 it looks like we need to tweak how we
cross compile LLVM slightly. It's using `CMAKE_SYSTEM_NAME` to infer whether to
build libFuzzer which only works on some platforms, and then once we configure
that it needs to apparently reach into the host build area to try to compile
`llvm-config` as well. Once these are both configured, though, it looks like we
can successfully cross-compile LLVM.

6 years agoAuto merge of #43230 - alexcrichton:more-tokenstream, r=nrc,jseyfried
bors [Fri, 28 Jul 2017 18:31:52 +0000 (18:31 +0000)]
Auto merge of #43230 - alexcrichton:more-tokenstream, r=nrc,jseyfried

Implement tokenization for some items in proc_macro

This PR is a partial implementation of https://github.com/rust-lang/rust/issues/43081 targeted towards preserving span information in attribute-like procedural macros. Currently all attribute-like macros will lose span information with the input token stream if it's iterated over due to the inability of the compiler to losslessly tokenize an AST node. This PR takes a strategy of saving off a list of tokens in particular AST nodes to return a lossless tokenized version. There's a few limitations with this PR, however, so the old fallback remains in place.

6 years agosyntax: Capture a `TokenStream` when parsing items
Alex Crichton [Wed, 12 Jul 2017 16:50:05 +0000 (09:50 -0700)]
syntax: Capture a `TokenStream` when parsing items

This is then later used by `proc_macro` to generate a new
`proc_macro::TokenTree` which preserves span information. Unfortunately this
isn't a bullet-proof approach as it doesn't handle the case when there's still
other attributes on the item, especially inner attributes.

Despite this the intention here is to solve the primary use case for procedural
attributes, attached to functions as outer attributes, likely bare. In this
situation we should be able to now yield a lossless stream of tokens to preserve
span information.

6 years agoAuto merge of #43298 - gaurikholkar:lifetime_errors, r=estebank
bors [Fri, 28 Jul 2017 16:03:32 +0000 (16:03 +0000)]
Auto merge of #43298 - gaurikholkar:lifetime_errors, r=estebank

improve case with both anonymous lifetime parameters #43269

This is a fix to #43269.

Sample output message-

```

error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions.rs:12:12
   |
11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
   |                    ---      --- these references must have the same lifetime
12 |     x.push(y);
   |            ^ data from `y` flows into `x` here

error: aborting due to 2 previous errors

```
r? @nikomatsakis

6 years agoAdd a failing test for errors in proc macros
Alex Crichton [Tue, 11 Jul 2017 15:29:08 +0000 (08:29 -0700)]
Add a failing test for errors in proc macros

This test currently fails because the tokenization of an AST item during the
expansion of a procedural macro attribute rounds-trips through strings, losing
span information.

6 years agoproc_macro: Use an item's tokens if available
Alex Crichton [Tue, 11 Jul 2017 00:49:18 +0000 (17:49 -0700)]
proc_macro: Use an item's tokens if available

This partly resolves the `FIXME` located in `src/libproc_macro/lib.rs` when
interpreting interpolated tokens. All instances of `ast::Item` which have a list
of tokens attached to them now use that list of tokens to losslessly get
converted into a `TokenTree` instead of going through stringification and losing
span information.

cc #43081

6 years agosyntax: Add `tokens: Option<TokenStream>` to Item
Alex Crichton [Tue, 11 Jul 2017 00:44:46 +0000 (17:44 -0700)]
syntax: Add `tokens: Option<TokenStream>` to Item

This commit adds a new field to the `Item` AST node in libsyntax to optionally
contain the original token stream that the item itself was parsed from. This is
currently `None` everywhere but is intended for use later with procedural
macros.

6 years agoMake LLVMRustHasFeature more robust
Luca Barbato [Fri, 28 Jul 2017 02:03:23 +0000 (02:03 +0000)]
Make LLVMRustHasFeature more robust

The function should accept feature strings that old LLVM might not
support.

Simplify the code using the same approach used by
LLVMRustPrintTargetFeatures.

Dummify the function for non 4.0 LLVM and update the tests accordingly.

6 years agoAuto merge of #43324 - Nashenas88:visit_locations, r=arielb1
bors [Fri, 28 Jul 2017 12:55:12 +0000 (12:55 +0000)]
Auto merge of #43324 - Nashenas88:visit_locations, r=arielb1

Provide positional information when visiting ty, substs and closure_substs in MIR

This will enable the region renumbering portion of #43234 (non-lexical lifetimes). @nikomatsakis's current plan [here](https://gist.github.com/nikomatsakis/dfc27b28cd024eb25054b52bb11082f2) shows that we need spans of the original code to create new region variables, e.g. `self.infcx.next_region_var(infer::MiscVariable(span))`. The current visitor impls did not pass positional information (`Location` in some, `Span` and `SourceInfo` for others) for all types. I did not expand this to all visits, just the ones necessary for the above-mentioned plan.

6 years agoAuto merge of #43221 - MaulingMonkey:natvis-improvements, r=michaelwoerister
bors [Fri, 28 Jul 2017 10:25:58 +0000 (10:25 +0000)]
Auto merge of #43221 - MaulingMonkey:natvis-improvements, r=michaelwoerister

Embed MSVC .natvis files into .pdbs and mangle debuginfo for &str, *T, and [T].

No idea if these changes are reasonable - please feel free to suggest changes/rewrites.  And these are some of my first real commits to any rust codebase - *don't* be gentle, and nitpick away, I need to learn! ;)

### Overview
Embedding `.natvis` files into `.pdb`s allows MSVC (and potentially other debuggers) to automatically pick up the visualizers without having to do any additional configuration (other than to perhaps add the relevant .pdb paths to symbol search paths.)

The native debug engine for MSVC parses the type names, making various C++ish assumptions about what they mean and adding various limitations to valid type names.  `&str` cannot be matched against a visualizer, but if we emit `str&` instead, it'll be recognized as a reference to a `str`, solving the problem.  `[T]` is similarly problematic, but emitting `slice<T>` instead works fine as it looks like a template.  I've been unable to get e.g. `slice<u32>&` to match visualizers in VS2015u3, so I've gone with `str*` and `slice<u32>*` instead.

### Possible Issues
* I'm not sure if `slice<T>` is a great mangling for `[T]` or if I should worry about name collisions.
* I'm not sure if `linker.rs` is the right place to be enumerating natvis files.
* I'm not sure if these type name mangling changes should actually be MSVC specific.  I recall seeing gdb visualizer tests that might be broken if made more general?  I'm hesitant to mess with them without a gdb install.  But perhaps I'm just wracking up technical debt.
  Should I try `pacman -S mingw-w64-x86_64-gdb` and to make things consistent?
* I haven't touched `const` / `mut` yet, and I'm worried MSVC might trip up on `mut` or their placement.
* I may like terse oneliners too much.
* I don't know if there's broader implications for messing with debug type names here.
* I may have been mistaken about bellow test failures being ignorable / unrelated to this changelist.

### Test Failures on `x86_64-pc-windows-gnu`

```
---- [debuginfo-gdb] debuginfo-gdb\associated-types.rs stdout ----
        thread '[debuginfo-gdb] debuginfo-gdb\associated-types.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16
note: Run with `RUST_BACKTRACE=1` for a backtrace.

[...identical panic causes omitted...]

---- [debuginfo-gdb] debuginfo-gdb\vec.rs stdout ----
        thread '[debuginfo-gdb] debuginfo-gdb\vec.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16
```

### Relevant Issues
* https://github.com/rust-lang/rust/issues/40460 Metaissue for Visual Studio debugging Rust
* https://github.com/rust-lang/rust/issues/36503 Investigate natvis for improved msvc debugging
* https://github.com/PistonDevelopers/VisualRust/issues/160 Debug visualization of Rust data structures

### Pretty Pictures
![Collapsed Watch Window](https://user-images.githubusercontent.com/75894/28180998-e44c7516-67bb-11e7-8b48-d4f9605973ae.png)
![Expanded Watch Window](https://user-images.githubusercontent.com/75894/28181000-e8da252e-67bb-11e7-96b8-d613310c04dc.png)

7 years agoAuto merge of #43505 - eddyb:poly-const-eval-layout-of, r=nikomatsakis
bors [Fri, 28 Jul 2017 08:01:02 +0000 (08:01 +0000)]
Auto merge of #43505 - eddyb:poly-const-eval-layout-of, r=nikomatsakis

rustc_const_eval: always require Substs and a ParamEnv.

Fixes #43357 by tracking the `Substs` and `ParamEnv` for const-evaluation in generic contexts.

7 years agoAuto merge of #43238 - estebank:try-on-unimplemented-2, r=alexcrichton
bors [Fri, 28 Jul 2017 05:39:41 +0000 (05:39 +0000)]
Auto merge of #43238 - estebank:try-on-unimplemented-2, r=alexcrichton

Use `rustc_on_unimplemented`'s trait name argument in `try`

Follow up to #43000 and #43001. Fix #42694.

7 years agoSupport homogeneous aggregates for hard-float ARM
Josh Stone [Fri, 28 Jul 2017 03:40:24 +0000 (20:40 -0700)]
Support homogeneous aggregates for hard-float ARM

Hard-float ARM targets use the AACPS-VFP ABI, which passes and returns
homogeneous float/vector aggregates in the VFP registers.

Fixes #43329.

7 years agoAdding E0623, to detect missing lifetimes when both regions are anonymous
gaurikholkar [Thu, 29 Jun 2017 19:40:04 +0000 (12:40 -0700)]
Adding E0623, to detect missing lifetimes when both regions are anonymous

7 years agoAuto merge of #43432 - pczarn:macro-parser-description, r=jseyfried
bors [Fri, 28 Jul 2017 03:16:14 +0000 (03:16 +0000)]
Auto merge of #43432 - pczarn:macro-parser-description, r=jseyfried

Make the macro parser theory description more accurate

The macro parser is described as an NFA, not an Earley parser.

7 years agoUse `rustc_on_unimplemented`'s trait name argument in `try`
Esteban Küber [Fri, 14 Jul 2017 17:29:35 +0000 (10:29 -0700)]
Use `rustc_on_unimplemented`'s trait name argument in `try`

7 years agoAuto merge of #43217 - pnkfelix:alloc-requires-align-it-in-u32, r=alexcrichton
bors [Fri, 28 Jul 2017 00:49:39 +0000 (00:49 +0000)]
Auto merge of #43217 - pnkfelix:alloc-requires-align-it-in-u32, r=alexcrichton

Add precondition to `Layout` that the `align` fit in a u32.

Add precondition to `Layout` that the `align` not exceed 2^31.

This precondition takes the form of a behavorial change in `Layout::from_size_align` (so it returns `None` if the input `align` is too large) and a new requirement for safe usage of `Layout::from_size_align_unchecked`.

Fix #30170.

7 years agoSquash Span into SourceInfo and rename enum and its inner types
Paul Faria [Thu, 27 Jul 2017 23:43:05 +0000 (19:43 -0400)]
Squash Span into SourceInfo and rename enum and its inner types

7 years agoAuto merge of #43438 - petrochenkov:path, r=jseyfried
bors [Thu, 27 Jul 2017 22:22:01 +0000 (22:22 +0000)]
Auto merge of #43438 - petrochenkov:path, r=jseyfried

syntax: Simplify parsing of paths

Discern between `Path` and `Path<>` in AST (but not in HIR).
Give span to angle bracketed generic arguments (`::<'a, T>` in `path::segment::<'a, T>`).

This is a refactoring in preparation for https://internals.rust-lang.org/t/macro-path-uses-novel-syntax/5561/3, but it doesn't add anything to the grammar yet.

r? @jseyfried

7 years agoAdd support for Vector Minimum on PowerPC
Luca Barbato [Thu, 27 Jul 2017 13:30:51 +0000 (13:30 +0000)]
Add support for Vector Minimum on PowerPC

7 years agoAvoid duplicated errors for generic arguments in macro paths
Vadim Petrochenkov [Mon, 24 Jul 2017 21:33:15 +0000 (00:33 +0300)]
Avoid duplicated errors for generic arguments in macro paths

7 years agoGive span to angle bracketed generic arguments
Vadim Petrochenkov [Sun, 23 Jul 2017 17:50:56 +0000 (20:50 +0300)]
Give span to angle bracketed generic arguments

7 years agoDiscern between `Path` and `Path<>` in AST
Vadim Petrochenkov [Sun, 23 Jul 2017 16:32:36 +0000 (19:32 +0300)]
Discern between `Path` and `Path<>` in AST

7 years agoSimplify parsing of paths
Vadim Petrochenkov [Wed, 19 Jul 2017 23:39:34 +0000 (02:39 +0300)]
Simplify parsing of paths

7 years agoAuto merge of #43443 - bitshifter:issue-43317, r=nikomatsakis
bors [Thu, 27 Jul 2017 19:48:13 +0000 (19:48 +0000)]
Auto merge of #43443 - bitshifter:issue-43317, r=nikomatsakis

Improve checking of conflicting packed and align representation hints on structs and unions.

Fixes #43317 and improves #33626.

7 years agorustc_const_eval: keep track of the appropriate ParamEnv.
Eduard-Mihai Burtescu [Wed, 26 Jul 2017 12:51:53 +0000 (15:51 +0300)]
rustc_const_eval: keep track of the appropriate ParamEnv.

7 years agoAuto merge of #43482 - Mark-Simulacrum:single-rustdoc, r=alexcrichton
bors [Thu, 27 Jul 2017 17:07:58 +0000 (17:07 +0000)]
Auto merge of #43482 - Mark-Simulacrum:single-rustdoc, r=alexcrichton

Compile rustdoc on-demand

Fixes #43284, fixes #38318, and fixes #39505.

Doesn't directly help with https://github.com/rust-lang/rust/issues/42686, since we need to rebuild just as much. In fact, this hurts it, since `./x.py doc --stage 0` will now fail. I'm not sure if it did before, but with these changes it runs into the problem where we attempt to use artifacts from bootstrap rustc with a non-bootstrap rustdoc, running into version conflicts. I believe this is solvable, but leaving for a future PR.

This means that rustdoc will no longer be compiled when compiling rustc, by default. However, it is still built from `./x.py build` (for hosts, but not targets, since we don't produce compiler toolchains for them) and will be built for doc tests and crate tests.

After this, the recommended workflow if you want a rustdoc is: `./x.py build --stage 1 src/tools/rustdoc` which will give you a working rustdoc in `build/triple/stage1/bin/rustdoc`. Note that you can add `src/libstd` onto the command to compile libstd as well so that the rustdoc can easily compile crates in the wild. `./x.py doc --stage 1 src/libstd` will document `libstd` with a freshly built rustdoc (if necessary), and will not rebuild rustc on modifications to rustdoc.

r? @alexcrichton

7 years agoAdd support for Vector Maximum on PowerPC
Luca Barbato [Thu, 27 Jul 2017 13:30:51 +0000 (13:30 +0000)]
Add support for Vector Maximum on PowerPC

7 years agoCorrect a few run.host invocations where run.target is intended.
Mark Simulacrum [Thu, 27 Jul 2017 12:50:43 +0000 (06:50 -0600)]
Correct a few run.host invocations where run.target is intended.

7 years agoAuto merge of #43498 - joshtriplett:fix-notices, r=aturon
bors [Thu, 27 Jul 2017 14:10:19 +0000 (14:10 +0000)]
Auto merge of #43498 - joshtriplett:fix-notices, r=aturon

Copyright/license headers

(As discussed with @aturon and @est31. CC @rust-lang/core.)

Currently, rust-lang/rust includes notices that say things like
```
The Rust Project is copyright 2010, The Rust Project
Developers.
```
or
```
Copyright (c) 2010 The Rust Project Developers
```
or
```
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
```

These notices aren't accurate. "Copyright YYYY Some Name" has a specific legal meaning, and "The Rust Project Developers" isn't a legal entity. In practice, the actual legal structure is that all Rust contributors retain their copyrights when contributing to Rust, and just license them under MIT/Apache-2.0. Our legal notices should reflect that.

This came up because of RFC 2044, which proposed fixing this for the RFC repository. That effort started out by copying the rust-lang/rust notices, propagating this issue.

Based on discussion with @aturon, the two of us propose the following:

- Delete the per-file notices entirely, for any files licensed under the standard terms. (Keep notices for anything that's *not* MIT/Apache-2.0.)
  - An alternative to that would be to just delete the first paragraph of the standard notice, and keep the second paragraph that points to the MIT and Apache 2.0 licenses.
- Delete the first paragraph of LICENSE-MIT (the inaccurate pseudo-copyright line), leaving only the text of the MIT license.
- Edit the COPYRIGHT file to more accurately describe the situation (changing the pseudo-copyright line immediately under "longer version", and editing the text that starts with "additional copyright may be ...", to just always state that copyrights are retained by the Rust contributors, and licensed under MIT/Apache-2.0 (with the exceptions to that explicitly noted in that file).

If @rust-lang/core is fine with this proposal, I'd be happy to provide a pull request with the proposed fixes.

7 years agoAdd support for the Power8 and Power9 features on PowerPC
Luca Barbato [Thu, 27 Jul 2017 13:30:51 +0000 (13:30 +0000)]
Add support for the Power8 and Power9 features on PowerPC

7 years agoExplain why we subtract one from the stage
Mark Simulacrum [Wed, 26 Jul 2017 00:04:33 +0000 (18:04 -0600)]
Explain why we subtract one from the stage

7 years agoMake sure CFG_RELEASE_CHANNEL is always set.
Mark Simulacrum [Tue, 25 Jul 2017 23:59:31 +0000 (17:59 -0600)]
Make sure CFG_RELEASE_CHANNEL is always set.

Previously we'd build libsyntax without it when documenting and that'd
cause us to recompile it when building normally for no reason.

7 years agoAllow changing rustdoc which builds the book.
Mark Simulacrum [Tue, 25 Jul 2017 23:56:06 +0000 (17:56 -0600)]
Allow changing rustdoc which builds the book.

7 years agoDon't needlessly build rustdoc for compiletest.
Mark Simulacrum [Tue, 25 Jul 2017 22:54:33 +0000 (16:54 -0600)]
Don't needlessly build rustdoc for compiletest.

For most tests, rustdoc isn't needed, so avoid building it.

7 years agoBuild rustdoc on-demand.
Mark Simulacrum [Sun, 23 Jul 2017 02:01:58 +0000 (20:01 -0600)]
Build rustdoc on-demand.

Rustdoc is no longer compiled in every stage, alongside rustc, instead
it is only compiled when requested, and generally only for the last
stage.

7 years agoChange tools to take a compiler instead of a stage.
Mark Simulacrum [Sun, 23 Jul 2017 01:29:08 +0000 (19:29 -0600)]
Change tools to take a compiler instead of a stage.

7 years agoRemove src/driver
Mark Simulacrum [Sun, 23 Jul 2017 00:57:26 +0000 (18:57 -0600)]
Remove src/driver

7 years agoAuto merge of #43489 - petrochenkov:mutref, r=GuillaumeGomez
bors [Thu, 27 Jul 2017 11:40:12 +0000 (11:40 +0000)]
Auto merge of #43489 - petrochenkov:mutref, r=GuillaumeGomez

Better diagnostics and recovery for `mut ref` in patterns

Fixes https://github.com/rust-lang/rust/issues/43286
Supersedes https://github.com/rust-lang/rust/pull/43451

r? @GuillaumeGomez

7 years agorustc_const_eval: always require correct Substs.
Eduard-Mihai Burtescu [Wed, 26 Jul 2017 12:54:44 +0000 (15:54 +0300)]
rustc_const_eval: always require correct Substs.

7 years agoAuto merge of #43479 - ivanbakel:loop_borrow_msg, r=estebank
bors [Thu, 27 Jul 2017 07:54:15 +0000 (07:54 +0000)]
Auto merge of #43479 - ivanbakel:loop_borrow_msg, r=estebank

Extended error message for mut borrow conflicts in loops

RFC issue: https://github.com/rust-lang/rfcs/issues/2080

The error message for multiple mutable borrows on the same value over loop iterations now makes it clear that the conflict comes from the borrow outlasting the loop. The wording of the error is based on the special case of the moved-value error for a value moved in a loop. Following the example of that error, the code remains the same for the special case.

This is mainly because I felt the current message is confusing in the loop case : https://github.com/rust-lang/rust/issues/43437. It's not clear that the two conflicting borrows are in different iterations of the loop, and instead it just looks like the compiler has an issue with a single line.

7 years agoAuto merge of #43477 - est31:master, r=alexcrichton
bors [Thu, 27 Jul 2017 04:25:37 +0000 (04:25 +0000)]
Auto merge of #43477 - est31:master, r=alexcrichton

Switch to begin_panic again

In https://github.com/rust-lang/rust/pull/42938 we made the compiler
emit a call to begin_panic_new in order to pass column info to it. Now
with stage0 updated (https://github.com/rust-lang/rust/pull/43320),
we can safely change begin_panic and start emitting calls for it again.

7 years agoAuto merge of #43445 - zackmdavis:rustdoc_major_section_self-links, r=GuillaumeGomez
bors [Thu, 27 Jul 2017 02:05:54 +0000 (02:05 +0000)]
Auto merge of #43445 - zackmdavis:rustdoc_major_section_self-links, r=GuillaumeGomez

rustdoc: make major section headers self-links

The sidebar already has links to these h2's ids, but for convenience,
the h2 itself should also be a link (retaining its present appearance).

![doc_sec_self-links](https://user-images.githubusercontent.com/1076988/28503806-cdce4e00-6fc1-11e7-832a-2ed1fc62808f.png)

This should address most of #24484.

7 years agoAdded tests for new loop borrow message
Isaac van Bakel [Thu, 27 Jul 2017 01:43:11 +0000 (02:43 +0100)]
Added tests for new loop borrow message

One set of tests is to ensure the current message is correct.
The other set is to check the messages are generated correctly for every
type of loop.

7 years agoCOPYRIGHT: Provide a better explanation of Rust copyrights
Josh Triplett [Wed, 26 Jul 2017 23:45:28 +0000 (16:45 -0700)]
COPYRIGHT: Provide a better explanation of Rust copyrights

Avoid implying that any copyrights have been assigned to a separate
entity (such as "The Rust Project Developers") Rust contributors retain
their copyrights, and do not assign them to anyone by contributing.

Remove the inaccurate notice, and provide a clear explanation. Avoid
stating that all files contain copyright notices and/or license notices,
and especially avoid suggesting that the license terms only apply to
files marked as such.

In the process, this also drops a separate notice that implies only some
copyrights are retained by contributors (suggesting that others are
not).

7 years agoLICENSE-MIT: Remove inaccurate (misattributed) copyright notice
Josh Triplett [Wed, 26 Jul 2017 23:34:15 +0000 (16:34 -0700)]
LICENSE-MIT: Remove inaccurate (misattributed) copyright notice

LICENSE-MIT contains the line "Copyright (c) 2015 The Rust Project
Developers", which implies that an entity called "The Rust Project
Developers" holds copyrights in Rust. Rust contributors retain
their copyrights, and do not assign them to anyone by contributing.
Remove the inaccurate notice.

7 years agoAuto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturon
bors [Wed, 26 Jul 2017 23:40:48 +0000 (23:40 +0000)]
Auto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturon

Stabilize more APIs for the 1.20.0 release

In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release

7 years agoAuto merge of #43487 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Wed, 26 Jul 2017 21:08:38 +0000 (21:08 +0000)]
Auto merge of #43487 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 10 pull requests

- Successful merges: #42959, #43447, #43455, #43456, #43458, #43462, #43463, #43465, #43471, #43480
- Failed merges:

7 years agoAuto merge of #42059 - derekdreery:bugfix/fix_emscripten_tests, r=alexcrichton
bors [Wed, 26 Jul 2017 18:27:19 +0000 (18:27 +0000)]
Auto merge of #42059 - derekdreery:bugfix/fix_emscripten_tests, r=alexcrichton

Make compiletest set cwd before running js tests

Proposed fix for #38800.

Not all tests pass yet - I will mention failures here once the test suite has finished.

7 years agoAdd Vector Compare Greater-Than
Luca Barbato [Wed, 26 Jul 2017 09:58:17 +0000 (09:58 +0000)]
Add Vector Compare Greater-Than

7 years agoBetter diagnostics and recovery for `mut ref` in patterns
Vadim Petrochenkov [Wed, 26 Jul 2017 15:59:07 +0000 (18:59 +0300)]
Better diagnostics and recovery for `mut ref` in patterns

7 years agoAuto merge of #43485 - nrc:rls-env-fix, r=Mark-Simulacrum
bors [Wed, 26 Jul 2017 14:08:50 +0000 (14:08 +0000)]
Auto merge of #43485 - nrc:rls-env-fix, r=Mark-Simulacrum

Update RLS

This pulls in https://github.com/rust-lang-nursery/rls/commit/79d659e5699fbf7db5b4819e9a442fb3f550472a It should fix #43453. It increases the timeout for test runs and forces builds in RLS tests to happen sequentially, this prevents interference between env vars passed to Cargo or rustc.

r? @Mark-Simulacrum

7 years agoAdd Vector Compare Equal
Luca Barbato [Wed, 26 Jul 2017 09:58:17 +0000 (09:58 +0000)]
Add Vector Compare Equal

7 years agoRollup merge of #43480 - dhduvall:sparc-blake2b, r=eddyb
Mark Simulacrum [Wed, 26 Jul 2017 12:15:09 +0000 (06:15 -0600)]
Rollup merge of #43480 - dhduvall:sparc-blake2b, r=eddyb

Constrain the layout of Blake2bCtx for proper SPARC compilation

On SPARC, optimization fuel ends up emitting incorrect load and store
instructions for the transmute() call in blake2b_compress().  If we
force Blake2bCtx to be repr(C), the problem disappears.

Fixes #43346

7 years agoRollup merge of #43471 - ollie27:try_from_ints, r=nagisa
Mark Simulacrum [Wed, 26 Jul 2017 12:15:08 +0000 (06:15 -0600)]
Rollup merge of #43471 - ollie27:try_from_ints, r=nagisa

Add missing impl and tests for int to int TryFrom impls

These were missing from #43248.

r? @nagisa

7 years agoRollup merge of #43465 - topecongiro:needs-test, r=Mark-Simulacrum
Mark Simulacrum [Wed, 26 Jul 2017 12:15:07 +0000 (06:15 -0600)]
Rollup merge of #43465 - topecongiro:needs-test, r=Mark-Simulacrum

Add tests for issues with the E-needstest label

Fixes #19181.
Fixes #29516.
Fixes #29798.
Fixes #33504.
Fixes #34780.
Fixes #39211.
Fixes #39467.
Fixes #39720.

7 years agoRollup merge of #43463 - nrc:catch-span, r=petrochenkov
Mark Simulacrum [Wed, 26 Jul 2017 12:15:06 +0000 (06:15 -0600)]
Rollup merge of #43463 - nrc:catch-span, r=petrochenkov

Fix the spans of catch blocks to include the `do`

7 years agoRollup merge of #43462 - dhduvall:solaris-libresolv, r=aturon
Mark Simulacrum [Wed, 26 Jul 2017 12:15:05 +0000 (06:15 -0600)]
Rollup merge of #43462 - dhduvall:solaris-libresolv, r=aturon

DNS functions are in libresolv on Solaris, just like on MacOS

7 years agoRollup merge of #43458 - RalfJung:verbose, r=nikomatsakis
Mark Simulacrum [Wed, 26 Jul 2017 12:15:05 +0000 (06:15 -0600)]
Rollup merge of #43458 - RalfJung:verbose, r=nikomatsakis

Fix printing regions with -Z verbose

When dumping MIR with `-Z verbose`, it would print regions on types, but not in the code. It seems the Rvalue printing code tried to be smart and guessed when the `Display` for `Region` would not possibly print anything.

This PR makes it no longer be smart, and just always use the `Display` like all the other code (e.g. printing types) does.

7 years agoRollup merge of #43456 - joshlf:spawn-doc-grammar, r=alexcrichton
Mark Simulacrum [Wed, 26 Jul 2017 12:15:04 +0000 (06:15 -0600)]
Rollup merge of #43456 - joshlf:spawn-doc-grammar, r=alexcrichton

std::thread::spawn: Fix grammar in documentation

Closes #43435.

7 years agoRollup merge of #43455 - QuietMisdreavus:extend-spec-docs, r=steveklabnik
Mark Simulacrum [Wed, 26 Jul 2017 12:15:03 +0000 (06:15 -0600)]
Rollup merge of #43455 - QuietMisdreavus:extend-spec-docs, r=steveklabnik

add a note to Vec's Extend<&T> impl about its slice specialization

From the regular documentation view, it's not at all apparent that [this specialization](https://github.com/rust-lang/rust/blob/5669c9988f50788b5ab5dee2d4538519d4e5663d/src/liballoc/vec.rs#L1879-L1891) exists for `slice::Iter`. This adds a documentation blurb to the Extend impl itself to note that this optimization exists.

7 years agoRollup merge of #43447 - estebank:import-span, r=nikomatsakis
Mark Simulacrum [Wed, 26 Jul 2017 12:15:02 +0000 (06:15 -0600)]
Rollup merge of #43447 - estebank:import-span, r=nikomatsakis

Point at path segment on module not found

Point at the correct path segment on a import statement where a module
doesn't exist.

New output:

```rust
error[E0432]: unresolved import `std::bar`
 --> <anon>:1:10
  |
1 | use std::bar::{foo1, foo2};
  |          ^^^ Could not find `bar` in `std`
```

instead of:

```rust
error[E0432]: unresolved import `std::bar::foo1`
 --> <anon>:1:16
  |
1 | use std::bar::{foo1, foo2};
  |                ^^^^ Could not find `bar` in `std`

error[E0432]: unresolved import `std::bar::foo2`
 --> <anon>:1:22
  |
1 | use std::bar::{foo1, foo2};
  |                      ^^^^ Could not find `bar` in `std`
```

Fix #43040.

7 years agoRollup merge of #42959 - SimonSapin:nonzero-checked, r=sfackler
Mark Simulacrum [Wed, 26 Jul 2017 12:15:01 +0000 (06:15 -0600)]
Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfackler

Make the "main" constructors of NonZero/Shared/Unique return Option

Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441.

This is a breaking change to unstable APIs.

The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts.

In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.

7 years agoAdd Vector Compare Bounds Floating-Point
Luca Barbato [Wed, 26 Jul 2017 09:58:17 +0000 (09:58 +0000)]
Add Vector Compare Bounds Floating-Point

7 years agoRemove custom node script
Richard Dodd [Wed, 26 Jul 2017 08:43:09 +0000 (09:43 +0100)]
Remove custom node script

7 years agoUpdate RLS
Nick Cameron [Tue, 25 Jul 2017 23:27:27 +0000 (11:27 +1200)]
Update RLS

7 years agoPoint at path segment on module not found
Esteban Küber [Sun, 23 Jul 2017 22:15:45 +0000 (15:15 -0700)]
Point at path segment on module not found

Point at the correct path segment on a import statement where a module
doesn't exist.

New output:

```rust
error[E0432]: unresolved import `std::bar`
 --> <anon>:1:10
  |
1 | use std::bar::{foo1, foo2};
  |          ^^^ Could not find `bar` in `std`
```

instead of:

```rust
error[E0432]: unresolved import `std::bar::foo1`
 --> <anon>:1:16
  |
1 | use std::bar::{foo1, foo2};
  |                ^^^^ Could not find `bar` in `std`

error[E0432]: unresolved import `std::bar::foo2`
 --> <anon>:1:22
  |
1 | use std::bar::{foo1, foo2};
  |                      ^^^^ Could not find `bar` in `std`
```

7 years agoAuto merge of #43226 - alexcrichton:aarch64-ci, r=aidanhs
bors [Wed, 26 Jul 2017 03:53:46 +0000 (03:53 +0000)]
Auto merge of #43226 - alexcrichton:aarch64-ci, r=aidanhs

Add a disabled builder for aarch64 emulated tests

This commit adds a disabled builder which will run all tests for the standard
library for aarch64 in a QEMU instance. Once we get enough capacity to run this
on Travis this can be used to boost our platform coverage of AArch64

7 years agoAuto merge of #43046 - milmazz:bootstrap-unittest, r=aidanhs
bors [Tue, 25 Jul 2017 23:46:14 +0000 (23:46 +0000)]
Auto merge of #43046 - milmazz:bootstrap-unittest, r=aidanhs

bootstrap: Add doctests and unitests

This commit includes the following changes:

* Include more docstrings in classes, methods, and functions
* Add doctests, which are great for self-documenting our source code
* Add some unit tests with the `unittest` module
* Remove `WindowsError` reference on non-windows systems
* Rename some variables to be more explicit about their meaning
* Move all the attributes defined outside of `__init__`
* Add initial support for Python 3

r? @alexcrichton

7 years agoConstrain the layout of Blake2bCtx for proper SPARC compilation
Danek Duvall [Tue, 25 Jul 2017 21:32:08 +0000 (14:32 -0700)]
Constrain the layout of Blake2bCtx for proper SPARC compilation

On SPARC, optimization fuel ends up emitting incorrect load and store
instructions for the transmute() call in blake2b_compress().  If we
force Blake2bCtx to be repr(C), the problem disappears.

Fixes #43346

7 years agoSwitch to begin_panic again
est31 [Tue, 25 Jul 2017 20:10:10 +0000 (22:10 +0200)]
Switch to begin_panic again

In https://github.com/rust-lang/rust/pull/42938 we made the compiler
emit a call to begin_panic_new in order to pass column info to it. Now
with stage0 updated (https://github.com/rust-lang/rust/pull/43320),
we can safely change begin_panic and start emitting calls for it again.

7 years agoModified error for loop mut borrow conflicts
Isaac van Bakel [Tue, 25 Jul 2017 00:13:18 +0000 (01:13 +0100)]
Modified error for loop mut borrow conflicts

Error message now makes clear that mutable borrow conflicts on a single
value in a loop body is caused by the borrow outlasting a single pass of
the loop.
Loop conflicts are detected by seeing when two borrow locations are the
same - which indicates the same code being run more than once.

7 years agoAdd mradds to the powerpc intrinsics
Luca Barbato [Mon, 24 Jul 2017 21:28:32 +0000 (21:28 +0000)]
Add mradds to the powerpc intrinsics

7 years agoAuto merge of #43320 - alexcrichton:new-bootstrap, r=Mark-Simulacrum
bors [Tue, 25 Jul 2017 16:13:16 +0000 (16:13 +0000)]
Auto merge of #43320 - alexcrichton:new-bootstrap, r=Mark-Simulacrum

Bump master to 1.21.0

This commit bumps the master branch's version to 1.21.0 and also updates the
bootstrap compiler from the freshly minted beta release.

7 years agoadd a note to Vec's Extend<&T> impl about its slice specialization
QuietMisdreavus [Mon, 24 Jul 2017 15:16:16 +0000 (10:16 -0500)]
add a note to Vec's Extend<&T> impl about its slice specialization

7 years agostd: Stabilize the `str_{mut,box}_extras` feature
Alex Crichton [Thu, 20 Jul 2017 22:52:12 +0000 (15:52 -0700)]
std: Stabilize the `str_{mut,box}_extras` feature

Stabilizes

* `<&mut str>::as_bytes_mut`
* `<Box<str>>::into_boxed_bytes`
* `std::str::from_boxed_utf8_unchecked`
* `std::str::from_utf8_mut`
* `std::str::from_utf8_unchecked_mut`

Closes #41119

7 years agoStabilize the `compile_error_macro` feature
Alex Crichton [Thu, 20 Jul 2017 22:50:33 +0000 (15:50 -0700)]
Stabilize the `compile_error_macro` feature

Stabilizes:

* `compile_error!` as a macro defined by rustc

Closes #40872

7 years agostd: Stabilize `manually_drop` feature
Alex Crichton [Thu, 20 Jul 2017 22:48:15 +0000 (15:48 -0700)]
std: Stabilize `manually_drop` feature

Stabilizes

* `core::mem::ManuallyDrop`
* `std::mem::ManuallyDrop`
* `ManuallyDrop::new`
* `ManuallyDrop::into_inner`
* `ManuallyDrop::drop`
* `Deref for ManuallyDrop`
* `DerefMut for ManuallyDrop`

Closes #40673

7 years agostd: Stabilize `utf8_error_error_len` feature
Alex Crichton [Thu, 20 Jul 2017 22:46:46 +0000 (15:46 -0700)]
std: Stabilize `utf8_error_error_len` feature

Stabilizes:

* `Utf8Error::error_len`

Closes #40494

7 years agostd: Stabilize CString/OsString/PathBuf extra methods
Alex Crichton [Thu, 20 Jul 2017 22:44:35 +0000 (15:44 -0700)]
std: Stabilize CString/OsString/PathBuf extra methods

Stabilizes:

* `CString::as_c_str`
* `CString::into_boxed_c_str`
* `CStr::into_c_string`
* `OsString::into_boxed_os_str`
* `OsStr::into_os_string`
* `PathBuf::into_boxed_path`
* `PathBuf::into_path_buf`

Closes #40380

7 years agostd: Stabilize `str_checked_slicing` feature
Alex Crichton [Thu, 20 Jul 2017 22:42:14 +0000 (15:42 -0700)]
std: Stabilize `str_checked_slicing` feature

Stabilized

* `<str>::get`
* `<str>::get_mut`
* `<str>::get_unchecked`
* `<str>::get_unchecked_mut`

Closes #39932

7 years agostd: Stabilize `option_entry` feature
Alex Crichton [Thu, 20 Jul 2017 22:40:23 +0000 (15:40 -0700)]
std: Stabilize `option_entry` feature

Stabilized:

* `Option::get_or_insert`
* `Option::get_or_insert_with`

Closes #39288

7 years agostd: Stabilize `char_escape_debug`
Alex Crichton [Thu, 20 Jul 2017 22:38:59 +0000 (15:38 -0700)]
std: Stabilize `char_escape_debug`

Stabilizes:

* `<char>::escape_debug`
* `std::char::EscapeDebug`

Closes #35068

7 years agoBump master to 1.21.0
Alex Crichton [Mon, 17 Jul 2017 16:32:08 +0000 (09:32 -0700)]
Bump master to 1.21.0

This commit bumps the master branch's version to 1.21.0 and also updates the
bootstrap compiler from the freshly minted beta release.

7 years agoAuto merge of #43419 - lu-zero:master, r=alexcrichton
bors [Tue, 25 Jul 2017 13:36:13 +0000 (13:36 +0000)]
Auto merge of #43419 - lu-zero:master, r=alexcrichton

Add support for the VSX and Altivec features on PowerPC

7 years agobootstrap: Major refactoring
Milton Mazzarri [Mon, 3 Jul 2017 04:32:42 +0000 (23:32 -0500)]
bootstrap: Major refactoring

This commit includes the following:

* Fix syntax errors in Python 3
* Include more docstrings in classes, methods, and functions
* Include unit tests using `unittest`
* Merge implementation of `{rustc,cargo}_out_of_date`
* Merge implementation of `RustBuild.{cargo,rustc}`
* Remove unnecessary source code
* Move all the attributes defined outside of `__init__`
* Remove remaining `%s` from print function
* Remove `WindowsError` reference on non-windows systems
* Rename some variables to be more explicit avoid their meaning
* Run bootstrap tests in the CI process
* Remove non-pythonic getters
* Remove duplicate code in `download_stage0` method
* Reduce the number of branches in `build_bootstrap` method
* Re-raise exception when we cannot execute uname in non-windows systems
* Avoid long lines

7 years agoAuto merge of #43384 - segevfiner:bootstrap-build-argument-fix, r=aidanhs
bors [Tue, 25 Jul 2017 08:04:15 +0000 (08:04 +0000)]
Auto merge of #43384 - segevfiner:bootstrap-build-argument-fix, r=aidanhs

rustbuild: Fix the --build argument to bootstrap.py

This makes the --build argument also apply for the downloading of the stage0 toolchain and building rustbuild.

Fixes #42116

7 years agoAdd missing impl and tests for int to int TryFrom impls
Oliver Middleton [Tue, 25 Jul 2017 05:19:30 +0000 (06:19 +0100)]
Add missing impl and tests for int to int TryFrom impls

7 years agoAuto merge of #43325 - ollie27:overflowing_literals, r=arielb1
bors [Tue, 25 Jul 2017 04:00:19 +0000 (04:00 +0000)]
Auto merge of #43325 - ollie27:overflowing_literals, r=arielb1

Fix overflowing_literals lint for large f32s

Float literals need to be parsed as the correct type so they can be
rounded correctly.

7 years agoAdd tests for issues with the E-needstest label
topecongiro [Tue, 25 Jul 2017 02:31:59 +0000 (11:31 +0900)]
Add tests for issues with the E-needstest label