]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoMake some comments doc comments in librustc/middle/cstore.rs
bjorn3 [Sat, 5 Aug 2017 08:42:53 +0000 (10:42 +0200)]
Make some comments doc comments in librustc/middle/cstore.rs

6 years agoAuto merge of #43546 - nikomatsakis:issue-43132, r=arielb1
bors [Mon, 31 Jul 2017 04:58:10 +0000 (04:58 +0000)]
Auto merge of #43546 - nikomatsakis:issue-43132, r=arielb1

save subobligations in the projection cache

The projection cache explicitly chose not to "preserve" subobligations for projections, since the fulfillment context ought to have been doing so. But for the trait evaluation scheme that causes problems. This PR reproduces subobligations. This has the potential to slow down compilation, but minimal investigation suggests it does not do so.

One hesitation about this PR: I could not find a way to make a standalone test case for #43132 (but admittedly I did not try very hard).

Fixes #43132.

r? @arielb1

6 years agoAuto merge of #43519 - zackmdavis:long_diagnostics_ever_after, r=GuillaumeGomez
bors [Mon, 31 Jul 2017 01:00:13 +0000 (01:00 +0000)]
Auto merge of #43519 - zackmdavis:long_diagnostics_ever_after, r=GuillaumeGomez

a couple more error explanations for posterity

E0436, E0595, and moving E0569 to where it belongs in the file rather than being bizarrely out of numerical order

r? @GuillaumeGomez

6 years agoAuto merge of #43563 - tbu-:pr_from_str_radix_panic, r=alexcrichton
bors [Sun, 30 Jul 2017 22:39:23 +0000 (22:39 +0000)]
Auto merge of #43563 - tbu-:pr_from_str_radix_panic, r=alexcrichton

Document the `from_str_radix` panic

CC #42034

6 years agoDocument the `from_str_radix` panic
Tobias Bucher [Sun, 30 Jul 2017 21:20:54 +0000 (23:20 +0200)]
Document the `from_str_radix` panic

CC #42034

6 years agoAuto merge of #43556 - dmizuk:remove-z-opt-usage, r=arielb1
bors [Sun, 30 Jul 2017 20:19:53 +0000 (20:19 +0000)]
Auto merge of #43556 - dmizuk:remove-z-opt-usage, r=arielb1

librustc_driver: Remove -Z option from usage on stable compiler

The `-Z` flag has been disabled since Rust 1.19 stable, but it still shows in `rustc --help`.

This PR addresses the inconsistency by removing the message on the stable channel.

6 years agoextended info for E0595 closure cannot mutate immutable local variable
Zack M. Davis [Fri, 28 Jul 2017 04:42:03 +0000 (21:42 -0700)]
extended info for E0595 closure cannot mutate immutable local variable

6 years agomove extended info for E0569 to numerical-order location in file
Zack M. Davis [Thu, 27 Jul 2017 22:08:29 +0000 (15:08 -0700)]
move extended info for E0569 to numerical-order location in file

We want the error explanations to appear in numerical order so that
they're easy to find. (Also, any other order would be arbitrary and thus
not constitute a Schelling point.) Bizarrely, the extended information
for E0569 was placed between E0244 and E0318 in
librustc_typeck/diagnostics.rs (when the code was introduced in
9a649c32). This commit moves it to be between E0562 and E0570, where it
belongs.

(Also, at reviewer request, say "Erroneous code example", the standard
verbiage that it has been decided that we say everywhere.)

6 years agoadd extended info for E0436 functional record update syntax needs struct
Zack M. Davis [Thu, 27 Jul 2017 21:22:49 +0000 (14:22 -0700)]
add extended info for E0436 functional record update syntax needs struct

This example focuses on struct-like enum variants, because it's not
immediately obvious in what other context we can get E0436 alone,
without any other, more serious, errors. (Triggering E0436 with a union
also emits a separate "union expressions should have exactly one field"
error.)

(One might argue that we ought to accept the functional record update
syntax for struct-like enums, but that is beyond the scope of this
error-index-comprehensiveness commit.)

6 years agosave the subobligations as well
Niko Matsakis [Sat, 29 Jul 2017 18:40:37 +0000 (21:40 +0300)]
save the subobligations as well

6 years agoAuto merge of #43515 - QuietMisdreavus:show-assoc-types, r=GuillaumeGomez
bors [Sun, 30 Jul 2017 17:42:32 +0000 (17:42 +0000)]
Auto merge of #43515 - QuietMisdreavus:show-assoc-types, r=GuillaumeGomez

rustdoc: print associated types in traits "implementors" section

When viewing a trait's implementors, they won't show anything about the implementation other than any bounds on the generics. You can see the full implementation details on the page for the type, but if the type is external (e.g. it's an extension trait being implemented for primitives), then you'll never be able to see the details of the implementation without opening the source code. This doesn't solve everything about that, but it does still show an incredibly useful piece of information: the associated types. This can help immensely for traits like `Deref` or `IntoIterator` in libstd, and also for traits like `IntoFuture` outside the standard library.

Fixes #24200

🚨 BIKESHED ALERT ðŸš¨ The indentation and sizing of the types is suspect. I put it in the small text so it wouldn't blend in with the next impl line. (It shares a CSS class with the where clauses, as you can see in the following image.) However, the indentation is nonstandard. I initially tried with no indentation (looked awkward and blended too well with the surrounding impls) and with 4-space indentation (too easy to confuse with where clauses), before settling on the 2-space indentation seen below. It's... okay, i guess. Open to suggestions.

![snippet of the implementors of IntoIterator, showing the associated types](https://user-images.githubusercontent.com/5217170/28697456-a4e01a12-7301-11e7-868e-2a6441d6c9e0.png)

6 years agoAuto merge of #43543 - petrochenkov:32330, r=nikomatsakis
bors [Sun, 30 Jul 2017 12:48:20 +0000 (12:48 +0000)]
Auto merge of #43543 - petrochenkov:32330, r=nikomatsakis

Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint

r? @nikomatsakis

6 years agolibrustc_driver: Remove -Z option from usage on stable compiler
Daiki Mizukami [Sun, 30 Jul 2017 09:17:22 +0000 (18:17 +0900)]
librustc_driver: Remove -Z option from usage on stable compiler

6 years agoAuto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sun, 30 Jul 2017 01:40:11 +0000 (01:40 +0000)]
Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549
- Failed merges:

6 years agoRollup merge of #43549 - alexcrichton:build-llvm, r=Mark-Simulacrum
Mark Simulacrum [Sun, 30 Jul 2017 00:03:58 +0000 (18:03 -0600)]
Rollup merge of #43549 - alexcrichton:build-llvm, r=Mark-Simulacrum

rustbuild: Enable building LLVM

I use this from time to time debugging LLVM builds, useful to have!

6 years agoRollup merge of #43544 - redox-os:update_redox_sys, r=sfackler
Mark Simulacrum [Sun, 30 Jul 2017 00:03:57 +0000 (18:03 -0600)]
Rollup merge of #43544 - redox-os:update_redox_sys, r=sfackler

Update redox sys

- Add JoinHandleExt
- Split FL and FD for fcntl

6 years agoRollup merge of #43536 - alexcrichton:privileged, r=TimNN
Mark Simulacrum [Sun, 30 Jul 2017 00:03:56 +0000 (18:03 -0600)]
Rollup merge of #43536 - alexcrichton:privileged, r=TimNN

Flag docker invocations as --privileged on CI

When upgrading to LLVM 5.0 it was found that the leak sanitizer tests were
failing with fatal errors, but they were passing locally when run. Turns out it
looks like they may be using new ptrace-like syscalls so the docker container
now needs `--privileged` when executing to complete the test.

6 years agoRollup merge of #43513 - alexcrichton:inline-repeat, r=BurntSushi
Mark Simulacrum [Sun, 30 Jul 2017 00:03:55 +0000 (18:03 -0600)]
Rollup merge of #43513 - alexcrichton:inline-repeat, r=BurntSushi

std: Mark `Layout::repeat` as `#[inline]`

This fixes an optimization regression by allowing LLVM to see through more
functions.

Closes #43272

6 years agoRollup merge of #43512 - arielb1:untyped-move-paths, r=eddyb
Mark Simulacrum [Sun, 30 Jul 2017 00:03:54 +0000 (18:03 -0600)]
Rollup merge of #43512 - arielb1:untyped-move-paths, r=eddyb

erase types in the move-path abstract domain

Leaving types unerased would lead to 2 types with a different "name"
getting different move-paths, which would cause major brokenness (see
e.g. #42903).

This does not fix any *known* issue, but is required if we want to use
abs_domain with non-erased regions (because the same can easily
have different names). cc @RalfJung.

r? @eddyb

6 years agoRollup merge of #43509 - QuietMisdreavus:method-src, r=GuillaumeGomez
Mark Simulacrum [Sun, 30 Jul 2017 00:03:53 +0000 (18:03 -0600)]
Rollup merge of #43509 - QuietMisdreavus:method-src, r=GuillaumeGomez

rustdoc: add [src] links to associated functions inside an impl block

While impl blocks currently have a `[src]` link to show the source for the impl block as a whole, individual methods inside that impl block do not. This can pose a problem for structs with a lot of methods, like many in libstd. This change adds little `[src]` links to individual methods that point directly to the function in the bundled source.

fixes #12932

![methods on HashMap, showing the new src links](https://user-images.githubusercontent.com/5217170/28686066-9e7a19de-72cf-11e7-8e6b-b7d60fa33032.png)

6 years agoRollup merge of #43501 - topecongiro:span-to-whereclause, r=nrc
Mark Simulacrum [Sun, 30 Jul 2017 00:03:52 +0000 (18:03 -0600)]
Rollup merge of #43501 - topecongiro:span-to-whereclause, r=nrc

Add Span to ast::WhereClause

This PR adds `Span` field to `ast::WhereClause`. The motivation here is to make rustfmt's life easier when recovering comments before and after where clause.
r? @nrc

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 #43009 - GuillaumeGomez:unused-doc-comments, r=nrc
bors [Sat, 29 Jul 2017 23:01:45 +0000 (23:01 +0000)]
Auto merge of #43009 - GuillaumeGomez:unused-doc-comments, r=nrc

Throw errors when doc comments are added where they're unused

#42617

6 years agoUpdate rls submodule
Guillaume Gomez [Sat, 29 Jul 2017 18:29:50 +0000 (20:29 +0200)]
Update rls submodule

6 years agoFlag docker invocations as --privileged on CI
Alex Crichton [Sat, 29 Jul 2017 03:30:37 +0000 (20:30 -0700)]
Flag docker invocations as --privileged on CI

When upgrading to LLVM 5.0 it was found that the leak sanitizer tests were
failing with fatal errors, but they were passing locally when run. Turns out it
looks like they may be using new ptrace-like syscalls so the docker container
now needs `--privileged` when executing to complete the test.

6 years agorustbuild: Enable building LLVM
Alex Crichton [Sat, 29 Jul 2017 20:39:43 +0000 (13:39 -0700)]
rustbuild: Enable building LLVM

I use this from time to time debugging LLVM builds, useful to have!

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 agostd: Mark `Layout::repeat` as `#[inline]`
Alex Crichton [Thu, 27 Jul 2017 21:53:44 +0000 (14:53 -0700)]
std: Mark `Layout::repeat` as `#[inline]`

This fixes an optimization regression by allowing LLVM to see through more
functions.

Closes #43272

6 years agoSplit FL and FD fcntls
Jeremy Soller [Sat, 29 Jul 2017 14:15:37 +0000 (08:15 -0600)]
Split FL and FD fcntls

6 years agoRedox: Add JoinHandleExt (matching Unix version)
Ian Douglas Scott [Tue, 11 Jul 2017 03:44:14 +0000 (20:44 -0700)]
Redox: Add JoinHandleExt (matching Unix version)

6 years agoCleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint
Vadim Petrochenkov [Sat, 29 Jul 2017 14:19:57 +0000 (17:19 +0300)]
Cleanup some remains of `hr_lifetime_in_assoc_type` compatibility lint

6 years agoprint associated types in traits "implementors" section
QuietMisdreavus [Fri, 28 Jul 2017 00:21:10 +0000 (19:21 -0500)]
print associated types in traits "implementors" section

6 years agoUpdate cargo version
Guillaume Gomez [Sat, 29 Jul 2017 12:35:09 +0000 (14:35 +0200)]
Update cargo version

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 Span to ast::WhereClause
topecongiro [Thu, 27 Jul 2017 04:37:35 +0000 (13:37 +0900)]
Add Span to ast::WhereClause

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)

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

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

6 years agoerase types in the move-path abstract domain
Ariel Ben-Yehuda [Thu, 27 Jul 2017 20:12:08 +0000 (23:12 +0300)]
erase types in the move-path abstract domain

Leaving types unerased would lead to 2 types with a different "name"
getting different move-paths, which would cause major brokenness (see
e.g. #42903).

This does not fix any *known* issue, but is required if we want to use
abs_domain with non-erased regions (because the same can easily
have different names). cc @RalfJung.

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 agoUpdate tests
Guillaume Gomez [Thu, 27 Jul 2017 18:40:20 +0000 (20:40 +0200)]
Update tests

6 years agoMake a lint instead
Guillaume Gomez [Sat, 15 Jul 2017 22:17:35 +0000 (00:17 +0200)]
Make a lint instead

6 years agoChange doc comment to code comment
Guillaume Gomez [Sun, 2 Jul 2017 22:27:36 +0000 (00:27 +0200)]
Change doc comment to code comment

6 years agoThrow errors when doc comments are added where they're unused
Guillaume Gomez [Sat, 1 Jul 2017 23:37:47 +0000 (01:37 +0200)]
Throw errors when doc comments are added where they're unused

6 years agoadd [src] links to associated functions inside an impl block
QuietMisdreavus [Thu, 27 Jul 2017 18:26:24 +0000 (13:26 -0500)]
add [src] links to associated functions inside an impl block

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

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

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 agoAdd Vector Compare Greater-Than
Luca Barbato [Wed, 26 Jul 2017 09:58:17 +0000 (09:58 +0000)]
Add Vector Compare Greater-Than

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