]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoUse a free error code
Alex Crichton [Sat, 29 Jul 2017 16:05:50 +0000 (09:05 -0700)]
Use a free error code

6 years agoRemove `IsGenerator` in favor of a boolean
Alex Crichton [Fri, 28 Jul 2017 20:09:33 +0000 (13:09 -0700)]
Remove `IsGenerator` in favor of a boolean

No need to be mixed!

6 years agoMerge remote-tracking branch 'origin/master' into gen
Alex Crichton [Fri, 28 Jul 2017 20:07:15 +0000 (13:07 -0700)]
Merge remote-tracking branch 'origin/master' into gen

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 agoUpdate comment
John Kåre Alsaker [Tue, 25 Jul 2017 06:31:02 +0000 (08:31 +0200)]
Update comment

6 years agoFix more tests with `GeneratorState` rename
Alex Crichton [Sat, 22 Jul 2017 03:48:46 +0000 (20:48 -0700)]
Fix more tests with `GeneratorState` rename

6 years agoFix tests
John Kåre Alsaker [Sat, 22 Jul 2017 02:20:46 +0000 (04:20 +0200)]
Fix tests

6 years agoUpdate rename State in docs
John Kåre Alsaker [Fri, 21 Jul 2017 03:54:01 +0000 (05:54 +0200)]
Update rename State in docs

6 years agoFix tests
John Kåre Alsaker [Thu, 20 Jul 2017 06:07:58 +0000 (08:07 +0200)]
Fix tests

6 years agoFix error message string
John Kåre Alsaker [Thu, 20 Jul 2017 06:06:21 +0000 (08:06 +0200)]
Fix error message string

6 years agoFix error code
John Kåre Alsaker [Thu, 20 Jul 2017 03:52:41 +0000 (05:52 +0200)]
Fix error code

6 years agoRemove visit_body from YieldFinder
John Kåre Alsaker [Thu, 20 Jul 2017 03:44:41 +0000 (05:44 +0200)]
Remove visit_body from YieldFinder

6 years agoRename some variables in lowering.rs and add an error number for the error
John Kåre Alsaker [Thu, 20 Jul 2017 03:17:07 +0000 (05:17 +0200)]
Rename some variables in lowering.rs and add an error number for the error

6 years agoRename State to GeneratorState
John Kåre Alsaker [Wed, 19 Jul 2017 23:16:12 +0000 (01:16 +0200)]
Rename State to GeneratorState

6 years agoDerive traits for State.
John Kåre Alsaker [Wed, 19 Jul 2017 23:15:58 +0000 (01:15 +0200)]
Derive traits for State.

6 years agoupdate references due to removing tabs
Niko Matsakis [Sun, 16 Jul 2017 09:03:21 +0000 (05:03 -0400)]
update references due to removing tabs

6 years agoRemove tabs
John Kåre Alsaker [Sun, 16 Jul 2017 02:05:35 +0000 (04:05 +0200)]
Remove tabs

6 years agoFix error message tests again
John Kåre Alsaker [Sat, 15 Jul 2017 22:28:57 +0000 (00:28 +0200)]
Fix error message tests again

6 years agoFix error message tests
John Kåre Alsaker [Sat, 15 Jul 2017 21:32:52 +0000 (23:32 +0200)]
Fix error message tests

6 years agoIgnore drop check bools when testing for legal generator types
John Kåre Alsaker [Sat, 15 Jul 2017 20:41:33 +0000 (22:41 +0200)]
Ignore drop check bools when testing for legal generator types

6 years agoFix error message tests
John Kåre Alsaker [Sat, 15 Jul 2017 20:40:46 +0000 (22:40 +0200)]
Fix error message tests

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 #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)

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

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

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.