]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoFix tidy errors
John Kåre Alsaker [Sat, 15 Jul 2017 19:28:42 +0000 (21:28 +0200)]
Fix tidy errors

6 years agochange how we report `err_out_of_scope` borrowck errors
Niko Matsakis [Sat, 15 Jul 2017 10:52:49 +0000 (06:52 -0400)]
change how we report `err_out_of_scope` borrowck errors

Also, remove the explicit code detecting borrows over a yield.  It
turns out not to be necessary -- any such borrow winds up with a
lifetime that is part of the generator type, and therefore which will
outlive the generator expression itself, which yields an
`err_out_of_scope`. So instead we intercept those errors and display
them in a nicer way.

6 years agocombine `bckerr_to_diag` and `note_and_explain_bckerr`
Niko Matsakis [Sat, 15 Jul 2017 09:18:19 +0000 (05:18 -0400)]
combine `bckerr_to_diag` and `note_and_explain_bckerr`

6 years agoRemove a FIXME and apply the same hack as closures
John Kåre Alsaker [Sat, 15 Jul 2017 06:15:33 +0000 (08:15 +0200)]
Remove a FIXME and apply the same hack as closures

6 years agoFix a string literal
John Kåre Alsaker [Sat, 15 Jul 2017 04:15:40 +0000 (06:15 +0200)]
Fix a string literal

6 years agoUpdate FIXME
John Kåre Alsaker [Sat, 15 Jul 2017 02:33:45 +0000 (04:33 +0200)]
Update FIXME

6 years agoConvert to spaces
John Kåre Alsaker [Sat, 15 Jul 2017 02:31:15 +0000 (04:31 +0200)]
Convert to spaces

6 years agoAdd some comments
John Kåre Alsaker [Sat, 15 Jul 2017 02:30:16 +0000 (04:30 +0200)]
Add some comments

6 years agoConvert to spaces
John Kåre Alsaker [Sat, 15 Jul 2017 02:11:13 +0000 (04:11 +0200)]
Convert to spaces

6 years agoRemove support for `gen arg`
Alex Crichton [Tue, 11 Jul 2017 19:57:05 +0000 (12:57 -0700)]
Remove support for `gen arg`

6 years agoFix a bug with yielding subtypes of the yield type.
John Kåre Alsaker [Sat, 15 Jul 2017 01:51:44 +0000 (03:51 +0200)]
Fix a bug with yielding subtypes of the yield type.

6 years agoRemove debug code
John Kåre Alsaker [Sat, 15 Jul 2017 01:50:43 +0000 (03:50 +0200)]
Remove debug code

6 years agoRevert some whitespace changes
John Kåre Alsaker [Fri, 14 Jul 2017 23:37:43 +0000 (01:37 +0200)]
Revert some whitespace changes

6 years agoRevert borrowck changes
John Kåre Alsaker [Fri, 14 Jul 2017 23:22:13 +0000 (01:22 +0200)]
Revert borrowck changes

6 years agoTweak docs
John Kåre Alsaker [Fri, 14 Jul 2017 22:21:59 +0000 (00:21 +0200)]
Tweak docs

6 years agofix yields-in-args test and add a reverse one
Niko Matsakis [Fri, 14 Jul 2017 23:11:21 +0000 (19:11 -0400)]
fix yields-in-args test and add a reverse one

6 years agoadd some tests of yielding with outstanding borrows
Niko Matsakis [Fri, 14 Jul 2017 23:02:07 +0000 (19:02 -0400)]
add some tests of yielding with outstanding borrows

No doubt there are more tests one might write, but it's a start.

6 years agoConvert tabs to spaces
Alex Crichton [Fri, 14 Jul 2017 22:54:07 +0000 (15:54 -0700)]
Convert tabs to spaces

6 years agoAdd a test case for conditional drop
Alex Crichton [Fri, 14 Jul 2017 22:53:15 +0000 (15:53 -0700)]
Add a test case for conditional drop

6 years agoAdd a test
John Kåre Alsaker [Fri, 14 Jul 2017 22:01:20 +0000 (00:01 +0200)]
Add a test

6 years agoTouch up unstable docs for generators
Alex Crichton [Thu, 13 Jul 2017 22:34:45 +0000 (15:34 -0700)]
Touch up  unstable docs for generators

6 years agoRemove a FIXME
John Kåre Alsaker [Thu, 13 Jul 2017 22:25:59 +0000 (00:25 +0200)]
Remove a FIXME

6 years agoFix printing
John Kåre Alsaker [Thu, 13 Jul 2017 04:29:26 +0000 (06:29 +0200)]
Fix printing

6 years agoConsider StorageDead and StorageLive as gens for liveness analysis
John Kåre Alsaker [Thu, 13 Jul 2017 02:40:57 +0000 (04:40 +0200)]
Consider StorageDead and StorageLive as gens for liveness analysis

6 years agoCopy a comment
John Kåre Alsaker [Thu, 13 Jul 2017 00:32:36 +0000 (02:32 +0200)]
Copy a comment

6 years agoMove a FIXME around
John Kåre Alsaker [Thu, 13 Jul 2017 00:25:43 +0000 (02:25 +0200)]
Move a FIXME around

6 years agoFix upstream changes
John Kåre Alsaker [Tue, 11 Jul 2017 23:26:31 +0000 (01:26 +0200)]
Fix upstream changes

6 years agoFix examples
John Kåre Alsaker [Tue, 11 Jul 2017 18:52:38 +0000 (20:52 +0200)]
Fix examples

6 years agoFix hash impl for SimplifiedType
John Kåre Alsaker [Tue, 11 Jul 2017 18:28:46 +0000 (20:28 +0200)]
Fix hash impl for SimplifiedType

6 years agoClarifying documentation for generator
Alex Crichton [Tue, 11 Jul 2017 14:26:44 +0000 (07:26 -0700)]
Clarifying documentation for generator

6 years agoFix tests
John Kåre Alsaker [Mon, 10 Jul 2017 21:13:52 +0000 (23:13 +0200)]
Fix tests

6 years agoFix whitespace
John Kåre Alsaker [Mon, 10 Jul 2017 20:07:55 +0000 (22:07 +0200)]
Fix whitespace

6 years agoAdd some comments
John Kåre Alsaker [Mon, 10 Jul 2017 19:24:22 +0000 (21:24 +0200)]
Add some comments

6 years agoUse FIXME instead of TODO
John Kåre Alsaker [Mon, 10 Jul 2017 19:12:32 +0000 (21:12 +0200)]
Use FIXME instead of TODO

6 years agoRename suspend to yield
John Kåre Alsaker [Mon, 10 Jul 2017 19:11:31 +0000 (21:11 +0200)]
Rename suspend to yield

6 years agoUpdate error codes
John Kåre Alsaker [Mon, 10 Jul 2017 18:25:32 +0000 (20:25 +0200)]
Update error codes

6 years agoDon't print `gen` in HIR
John Kåre Alsaker [Mon, 10 Jul 2017 18:06:39 +0000 (20:06 +0200)]
Don't print `gen` in HIR

6 years agoEnsure upvars are dropped when generators have never been resumed
John Kåre Alsaker [Mon, 10 Jul 2017 18:04:15 +0000 (20:04 +0200)]
Ensure upvars are dropped when generators have never been resumed

6 years agoFill in generator tracking issue in a few more locations
Alex Crichton [Mon, 10 Jul 2017 16:33:54 +0000 (09:33 -0700)]
Fill in generator tracking issue in a few more locations

6 years agoAdd documentation for generators
Alex Crichton [Mon, 10 Jul 2017 16:30:57 +0000 (09:30 -0700)]
Add documentation for generators

6 years agoMake yield and gen arg outside generator literals an error and update tests
John Kåre Alsaker [Sat, 8 Jul 2017 17:30:14 +0000 (19:30 +0200)]
Make yield and gen arg outside generator literals an error and update tests

6 years agoAdd some generator pass/fail tests
Alex Crichton [Fri, 7 Jul 2017 23:12:44 +0000 (16:12 -0700)]
Add some generator pass/fail tests

6 years agoFix tests
Alex Crichton [Fri, 7 Jul 2017 22:31:03 +0000 (15:31 -0700)]
Fix tests

6 years agoAdded some tests
John Kåre Alsaker [Fri, 7 Jul 2017 22:58:33 +0000 (00:58 +0200)]
Added some tests

6 years agoConsider all implementations of Generator, not just built in ones
John Kåre Alsaker [Thu, 6 Jul 2017 22:02:35 +0000 (00:02 +0200)]
Consider all implementations of Generator, not just built in ones

6 years agoBan explicit arguments on generators
John Kåre Alsaker [Thu, 6 Jul 2017 20:08:45 +0000 (22:08 +0200)]
Ban explicit arguments on generators

6 years agostd: Add forwarding impls of `Generator` trait
Alex Crichton [Wed, 5 Jul 2017 22:02:30 +0000 (15:02 -0700)]
std: Add forwarding impls of `Generator` trait

6 years agoFix tidy warnings
Alex Crichton [Wed, 5 Jul 2017 21:57:26 +0000 (14:57 -0700)]
Fix tidy warnings

6 years agoGenerator literal support
John Kåre Alsaker [Mon, 26 Dec 2016 13:34:03 +0000 (14:34 +0100)]
Generator literal support

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)

6 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.

6 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.

6 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.

6 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`

6 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.

6 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

6 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

6 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

6 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

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

6 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.

6 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.

6 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

6 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.

6 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.

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

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

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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).

6 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.

6 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

6 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:

6 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.

6 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

6 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

6 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

6 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

6 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.

6 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`

6 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

6 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.

6 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.

6 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.

6 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.

6 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.

6 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