]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoHaiku: fix build of libbacktrace
Niels Sascha Reedijk [Sun, 24 Jun 2018 11:12:18 +0000 (13:12 +0200)]
Haiku: fix build of libbacktrace

6 years agoAuto merge of #51726 - petrochenkov:hygclean, r=oli-obk
bors [Sun, 24 Jun 2018 01:06:21 +0000 (01:06 +0000)]
Auto merge of #51726 - petrochenkov:hygclean, r=oli-obk

expansion/hygiene: Some renaming, refactoring and comments

Pure refactoring, no functional changes.
Commits are isolated and self-descriptive.

6 years agoAuto merge of #51739 - Amanieu:update_rustfmt, r=Mark-Simulacrum
bors [Sat, 23 Jun 2018 22:27:30 +0000 (22:27 +0000)]
Auto merge of #51739 - Amanieu:update_rustfmt, r=Mark-Simulacrum

Update rustfmt submodule

The version of rustfmt currently shipped with nightly breaks code that uses `break 'label`. This PR updates the submodule to include the fix (https://github.com/rust-lang-nursery/rustfmt/pull/2774).

6 years agoAuto merge of #51653 - mglagla:option-unreachable, r=dtolnay
bors [Sat, 23 Jun 2018 20:10:35 +0000 (20:10 +0000)]
Auto merge of #51653 - mglagla:option-unreachable, r=dtolnay

Option::get_or_insert(_with): Replace unreachable! with unreachable_unchecked

Optimize codegen for both functions as the None branch is trivially not reachable.

6 years agohygiene: Merge `NameAndSpan` into `ExpnInfo`
Vadim Petrochenkov [Sat, 23 Jun 2018 18:41:39 +0000 (21:41 +0300)]
hygiene: Merge `NameAndSpan` into `ExpnInfo`

6 years agoUpdate Cargo.lock
Amanieu d'Antras [Sat, 23 Jun 2018 18:15:34 +0000 (19:15 +0100)]
Update Cargo.lock

6 years agoUpdate rustfmt submodule
Amanieu d'Antras [Sat, 23 Jun 2018 17:54:42 +0000 (18:54 +0100)]
Update rustfmt submodule

6 years agohygiene: Make sure transparency of `Mark::root()` is an implementation detail and...
Vadim Petrochenkov [Sat, 23 Jun 2018 17:42:25 +0000 (20:42 +0300)]
hygiene: Make sure transparency of `Mark::root()` is an implementation detail and cannot be inspected outside of `hygiene.rs`

6 years agohygiene: Do not reset expansion info for `quote!`
Vadim Petrochenkov [Sat, 23 Jun 2018 17:09:11 +0000 (20:09 +0300)]
hygiene: Do not reset expansion info for `quote!`

6 years agohygiene: More descriptive names for things involved in late hygienic name resolution
Vadim Petrochenkov [Sat, 23 Jun 2018 16:27:28 +0000 (19:27 +0300)]
hygiene: More descriptive names for things involved in late hygienic name resolution

6 years agoexpansion: Add some comments
Vadim Petrochenkov [Sat, 23 Jun 2018 16:27:01 +0000 (19:27 +0300)]
expansion: Add some comments

6 years agoexpansion: Improve searchability for `AstFragments` methods
Vadim Petrochenkov [Fri, 22 Jun 2018 22:05:07 +0000 (01:05 +0300)]
expansion: Improve searchability for `AstFragments` methods

6 years agoexpansion: Rename `Expansion` to `AstFragment`
Vadim Petrochenkov [Tue, 19 Jun 2018 23:08:08 +0000 (02:08 +0300)]
expansion: Rename `Expansion` to `AstFragment`

6 years agohygiene: Rename `MarkKind` to `Transparency`
Vadim Petrochenkov [Tue, 19 Jun 2018 21:54:17 +0000 (00:54 +0300)]
hygiene: Rename `MarkKind` to `Transparency`

Move `is_builtin` for `Mark` to a separate flag

6 years agohygiene: Make sure expansion info is set at most once for a given `Mark`
Vadim Petrochenkov [Tue, 19 Jun 2018 21:13:11 +0000 (00:13 +0300)]
hygiene: Make sure expansion info is set at most once for a given `Mark`

6 years agoexpansion: Remove unnecessary override from `impl Folder for Marker`
Vadim Petrochenkov [Tue, 19 Jun 2018 21:09:56 +0000 (00:09 +0300)]
expansion: Remove unnecessary override from `impl Folder for Marker`

6 years agohygiene: Give `Debug` impls to hygiene structures
Vadim Petrochenkov [Tue, 19 Jun 2018 21:08:14 +0000 (00:08 +0300)]
hygiene: Give `Debug` impls to hygiene structures

6 years agoAuto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov
bors [Sat, 23 Jun 2018 14:33:10 +0000 (14:33 +0000)]
Auto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov

Rename hir::ExprAgain to hir::ExprContinue

The current name is confusing and historical.

I also used this PR to clean up the annoying indentation in `check/mod.rs`. If that's viewed as too tangential a change, I'll split it up, but it seemed reasonable to slip it in to reduce @bors's work. It's easy to compare for the two commits individually.

r? @petrochenkov

6 years agoAuto merge of #51723 - estebank:abolish-ice, r=oli-obk
bors [Sat, 23 Jun 2018 11:00:43 +0000 (11:00 +0000)]
Auto merge of #51723 - estebank:abolish-ice, r=oli-obk

Accept `TyError` in `analyze_closure` to avoid ICE

Fix #51714.

6 years agoReindent check/mod.rs
varkor [Sat, 23 Jun 2018 10:00:02 +0000 (11:00 +0100)]
Reindent check/mod.rs

6 years agoRename ExprAgain to ExprContinue
varkor [Sat, 23 Jun 2018 09:51:01 +0000 (10:51 +0100)]
Rename ExprAgain to ExprContinue

6 years agoAuto merge of #51580 - cramertj:async-await, r=eddyb
bors [Sat, 23 Jun 2018 09:02:45 +0000 (09:02 +0000)]
Auto merge of #51580 - cramertj:async-await, r=eddyb

async/await

This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: https://github.com/rust-lang/rust/issues/50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3.

Based on https://github.com/rust-lang/rust/pull/51414.
cc @petrochenkov for parsing changes.
r? @eddyb

6 years agoAuto merge of #51696 - estebank:fuzzy-ice-ice, r=oli-obk
bors [Sat, 23 Jun 2018 06:56:12 +0000 (06:56 +0000)]
Auto merge of #51696 - estebank:fuzzy-ice-ice, r=oli-obk

Accept `TyError` in patterns to avoid ICE on bad input

Fix #50585.

6 years agoAuto merge of #51724 - tikue:master, r=Mark-Simulacrum
bors [Sat, 23 Jun 2018 04:19:51 +0000 (04:19 +0000)]
Auto merge of #51724 - tikue:master, r=Mark-Simulacrum

Re-pub some items whose visibilities were recently reduced.

Reasons described in the most recent comments of https://github.com/rust-lang/rust/pull/51265.

tarpc can't move off of plugins until proc macros can be reexported from other crates.

Fixes https://github.com/google/tarpc/issues/191

6 years agoUpdate libsyntax test
Taylor Cramer [Sat, 23 Jun 2018 02:50:56 +0000 (19:50 -0700)]
Update libsyntax test

6 years agoAuto merge of #51712 - SLaabsDev:master, r=Mark-Simulacrum
bors [Sat, 23 Jun 2018 02:21:04 +0000 (02:21 +0000)]
Auto merge of #51712 - SLaabsDev:master, r=Mark-Simulacrum

Add support for current directory prefixes (#51071)

Fixes #51071

6 years agoFix rustdoc and remove default impl for FnHeader
Taylor Cramer [Sat, 23 Jun 2018 00:27:58 +0000 (17:27 -0700)]
Fix rustdoc and remove default impl for FnHeader

6 years agoAuto merge of #51697 - estebank:once-used-lifetime-label, r=oli-obk
bors [Sat, 23 Jun 2018 00:06:54 +0000 (00:06 +0000)]
Auto merge of #51697 - estebank:once-used-lifetime-label, r=oli-obk

Add label to lint for lifetimes used once

```
error: lifetime parameter `'a` only used once
  --> $DIR/fn-types.rs:19:10
   |
LL |   a: for<'a> fn(&'a u32), //~ ERROR `'a` only used once
   |          ^^      -- ...is used only here
   |          |
   |          this lifetime...
```

6 years agoRe-reexport some items that were recently made crate-private.
Tim Kuehn [Fri, 22 Jun 2018 23:23:25 +0000 (16:23 -0700)]
Re-reexport some items that were recently made crate-private.

6 years agoRemove impl trait names and move bits of await into a function
Taylor Cramer [Fri, 22 Jun 2018 23:08:07 +0000 (16:08 -0700)]
Remove impl trait names and move bits of await into a function

6 years agoAccept `TyError` in `analyze_closure` to avoid ICE
Esteban Küber [Fri, 22 Jun 2018 22:35:52 +0000 (15:35 -0700)]
Accept `TyError` in `analyze_closure` to avoid ICE

6 years agoAuto merge of #51482 - GuillaumeGomez:table-display, r=QuietMisdreavus
bors [Fri, 22 Jun 2018 22:02:10 +0000 (22:02 +0000)]
Auto merge of #51482 - GuillaumeGomez:table-display, r=QuietMisdreavus

Greatly improve tables display in docs

Fixes #51454.

r? @QuietMisdreavus

Before:

<img width="1440" alt="screen shot 2018-06-10 at 22 43 52" src="https://user-images.githubusercontent.com/3050060/41206138-cc61b2b4-6cff-11e8-9b6f-0b1e435d4b1b.png">

After:

<img width="1440" alt="screen shot 2018-06-10 at 23 33 16" src="https://user-images.githubusercontent.com/3050060/41207049-d455c03c-6d0e-11e8-968f-d4fccaeb4265.png">

6 years agoAuto merge of #51681 - varkor:rustc_deprecated-future-deprecation, r=petrochenkov
bors [Fri, 22 Jun 2018 19:55:30 +0000 (19:55 +0000)]
Auto merge of #51681 - varkor:rustc_deprecated-future-deprecation, r=petrochenkov

Support future deprecation for rustc_deprecated

Follow-up to #49179 to allow `since` parameters to be set to future versions of Rust and correspondingly to not be treated as deprecated until that version. This is required for #30459 to be completed (though we'll need to wait until this hits beta).

6 years agoRemove unused map_slice
Taylor Cramer [Fri, 22 Jun 2018 19:12:53 +0000 (12:12 -0700)]
Remove unused map_slice

6 years agoReview nits and updates
Taylor Cramer [Fri, 22 Jun 2018 18:36:01 +0000 (11:36 -0700)]
Review nits and updates

Move future_from_generator out of raw
Update await to use $crate
Renumber errors

6 years agoAuto merge of #51670 - estebank:issue-51634, r=oli-obk
bors [Fri, 22 Jun 2018 17:51:02 +0000 (17:51 +0000)]
Auto merge of #51670 - estebank:issue-51634, r=oli-obk

Don't suggest incorrect syntax

Fix #51634.

6 years agoAuto merge of #51704 - kennytm:rollup, r=kennytm
bors [Fri, 22 Jun 2018 15:26:52 +0000 (15:26 +0000)]
Auto merge of #51704 - kennytm:rollup, r=kennytm

Rollup of 6 pull requests

Successful merges:

 - #51158 (Mention spec and indented blocks in doctest docs)
 - #51629 (Do not consume semicolon twice while parsing local statement)
 - #51637 (Update zx_cprng_draw_new on Fuchsia)
 - #51664 (make more libsyntax methods public)
 - #51666 (Disable probestack when GCOV profiling is being used)
 - #51703 (Recognize the extra "LLVM tools versions" argument to build-manifest.)

Failed merges:

r? @ghost

6 years agoHandle current directory prefix for parsing command arguments in bootstrap test command.
Steven Laabs [Fri, 22 Jun 2018 04:57:06 +0000 (23:57 -0500)]
Handle current directory prefix for parsing command arguments in bootstrap test command.

6 years agoAdded stripping current directory prefixes when comparing suite path names
Steven Laabs [Thu, 21 Jun 2018 22:48:24 +0000 (17:48 -0500)]
Added stripping current directory prefixes when comparing suite path names

6 years agoAuto merge of #51184 - lambtowolf:master, r=nikomatsakis
bors [Fri, 22 Jun 2018 11:10:20 +0000 (11:10 +0000)]
Auto merge of #51184 - lambtowolf:master, r=nikomatsakis

Issue #50974 : Suboptimal error in case of duplicate `,` in struct constructor

Fixes #50974

6 years agoadd an explanatory comment for recovery behavior
Niko Matsakis [Tue, 5 Jun 2018 17:04:15 +0000 (13:04 -0400)]
add an explanatory comment for recovery behavior

6 years agoIssue #50974: Fix compilation error and test
Lamb [Wed, 30 May 2018 11:06:05 +0000 (13:06 +0200)]
Issue #50974: Fix compilation error and test

6 years agoFix when the help message is displayed
Maerten [Wed, 30 May 2018 07:16:18 +0000 (09:16 +0200)]
Fix when the help message is displayed

Only display the "remove this comma" suggestion when followed by an identifier

6 years agoIssue #50974: Adding issue number in the test
Lamb [Tue, 29 May 2018 19:44:55 +0000 (21:44 +0200)]
Issue #50974: Adding issue number in the test

6 years agoIssue #50974: Adding tests
Lamb [Tue, 29 May 2018 18:15:59 +0000 (20:15 +0200)]
Issue #50974: Adding tests

6 years agoIssue #50974: Change text of suggestion to be more direct
Lamb [Tue, 29 May 2018 18:15:47 +0000 (20:15 +0200)]
Issue #50974: Change text of suggestion to be more direct

6 years agoIssue #50974: Suboptimal error in case of duplicate `,` in struct constructor
Lamb [Tue, 29 May 2018 11:19:58 +0000 (13:19 +0200)]
Issue #50974: Suboptimal error in case of duplicate `,` in struct constructor

6 years agoRollup merge of #51703 - kennytm:fix-51699, r=nrc
kennytm [Fri, 22 Jun 2018 08:50:45 +0000 (16:50 +0800)]
Rollup merge of #51703 - kennytm:fix-51699, r=nrc

Recognize the extra "LLVM tools versions" argument to build-manifest.

Fix #51699.

6 years agoRollup merge of #51666 - marco-c:disable_probestack, r=nagisa
kennytm [Fri, 22 Jun 2018 08:50:44 +0000 (16:50 +0800)]
Rollup merge of #51666 - marco-c:disable_probestack, r=nagisa

Disable probestack when GCOV profiling is being used

If I compile Firefox with gcov profiling enabled, Firefox crashes at startup because of probestack.
Since it's disabled for PGO, I think it makes sense to disable it for gcov too.

6 years agoRollup merge of #51664 - jebrosen:pub_parse_methods2, r=Mark-Simulacrum
kennytm [Fri, 22 Jun 2018 08:50:43 +0000 (16:50 +0800)]
Rollup merge of #51664 - jebrosen:pub_parse_methods2, r=Mark-Simulacrum

make more libsyntax methods public

Followup for #51502, which was sufficient only for the latest stable release of Rocket. The `master` branch uses a few more. I plan to reimplement the deleted method `parse_seq` in Rocket (see SergioBenitez/Rocket#666), rather than resurrecting it in libsyntax.

r? @Mark-Simulacrum

6 years agoRollup merge of #51637 - abarth:new_prng, r=cramertj
kennytm [Fri, 22 Jun 2018 08:50:42 +0000 (16:50 +0800)]
Rollup merge of #51637 - abarth:new_prng, r=cramertj

Update zx_cprng_draw_new on Fuchsia

Fuchsia is changing the semantics for zx_cprng_draw and
zx_cprng_draw_new is a temporary name for the new semantics.

6 years agoRollup merge of #51629 - topecongiro:multiple-semicolon-in-local-span, r=petrochenkov
kennytm [Fri, 22 Jun 2018 08:50:41 +0000 (16:50 +0800)]
Rollup merge of #51629 - topecongiro:multiple-semicolon-in-local-span, r=petrochenkov

Do not consume semicolon twice while parsing local statement

The span for a `let` statement includes multiple semicolons. For example,

```rust
    let x = 2;;;
//  ^^^^^^^^^^^ The span for the above statement.
```

This PR fixes it.

cc https://github.com/rust-lang-nursery/rustfmt/issues/2791.

6 years agoRollup merge of #51158 - ogham:patch-1, r=steveklabnik
kennytm [Fri, 22 Jun 2018 08:50:39 +0000 (16:50 +0800)]
Rollup merge of #51158 - ogham:patch-1, r=steveklabnik

Mention spec and indented blocks in doctest docs

Fixes #49717.

This commit adds a new section to the Documentation Test docs, which briefly mentions indented code blocks, and links to the CommonMark specification for both.

I’m not sure about saying "fenced code blocks the more popular choice in the Rust community” because it seems like I’m speaking for everyone, but I can’t think of a better way to phrase it!

6 years agoAuto merge of #51660 - lqd:the-MIRnistry-of-walks, r=nikomatsakis
bors [Fri, 22 Jun 2018 08:34:26 +0000 (08:34 +0000)]
Auto merge of #51660 - lqd:the-MIRnistry-of-walks, r=nikomatsakis

NLL: Walk the MIR only once for the "unused mut" lint

Turns the quadratic loop gathering local variable assignments into a single MIR walk, and brings down the number of `super_mir` calls generated from `do_mir_borrowck` to the expected levels seen in `nll::replace_regions_in_mir` and `nll::compute_regions`, i.e. on clap: 1883 `super_mir` calls instead of 8011.

The limited perf numbers I could gather on my machines look to be what we expected: `clap-check` seems to be gaining back a lot of the 7% we previously saw in `visit_mir`.

Fixes #51641.

r? @nikomatsakis

6 years agoRecognize the extra "LLVM tools versions" argument to build-manifest.
kennytm [Fri, 22 Jun 2018 08:22:01 +0000 (16:22 +0800)]
Recognize the extra "LLVM tools versions" argument to build-manifest.

Fix #51699.

6 years agoAuto merge of #51686 - nikomatsakis:issue-51415-borrowck-match-default-bindings-bug...
bors [Fri, 22 Jun 2018 06:36:11 +0000 (06:36 +0000)]
Auto merge of #51686 - nikomatsakis:issue-51415-borrowck-match-default-bindings-bug, r=eddyb

yet another "old borrowck" bug around match default bindings

We were getting the type of the parameter from its pattern, but that didn't include adjustments. I did a `ripgrep` around and this seemed to be the only affected case.

The reason this didn't show up as an ICE earlier is that mem-categorization is lenient with respect to weird discrepancies. I am going to add more delay-span-bug calls shortly around that (I'll push onto the PR).

This example is an ICE, but I presume that there is a way to make a soundness example out of this -- it basically ignores borrows occuring inside match-default-bindings in a closure, though only if the implicit deref is at the top-level. It happens though that this occurs frequently in iterators, which often give a `&T` parameter.

Fixes #51415
Fixes #49534

r? @eddyb

6 years agoPathParameters -> GenericArgs fixes
Taylor Cramer [Fri, 22 Jun 2018 06:24:51 +0000 (23:24 -0700)]
PathParameters -> GenericArgs fixes

6 years agoAdd path parameters to std_path
Taylor Cramer [Fri, 22 Jun 2018 05:24:24 +0000 (22:24 -0700)]
Add path parameters to std_path

6 years agoFix test using ExprKind::Closure
Taylor Cramer [Wed, 20 Jun 2018 02:12:41 +0000 (19:12 -0700)]
Fix test using ExprKind::Closure

6 years agoTruncate errors to make tidy happy
Taylor Cramer [Tue, 19 Jun 2018 22:58:10 +0000 (15:58 -0700)]
Truncate errors to make tidy happy

6 years agoFix parse-fail tests that now mention async
Taylor Cramer [Tue, 19 Jun 2018 22:07:52 +0000 (15:07 -0700)]
Fix parse-fail tests that now mention async

6 years agoMove async edition check to the current span
Taylor Cramer [Tue, 19 Jun 2018 20:58:32 +0000 (13:58 -0700)]
Move async edition check to the current span

6 years agoAllow unsafe code inside of await macro
Taylor Cramer [Tue, 19 Jun 2018 17:36:16 +0000 (10:36 -0700)]
Allow unsafe code inside of await macro

6 years agoExplicitly ban async in trait impls
Taylor Cramer [Tue, 19 Jun 2018 17:35:05 +0000 (10:35 -0700)]
Explicitly ban async in trait impls

This wouldn't compile before because the return type wouldn't match,
but now it's properly an error.

6 years agoAsync methods
Taylor Cramer [Tue, 19 Jun 2018 04:18:10 +0000 (21:18 -0700)]
Async methods

6 years agoFix typo in multiple lifetimes error
Taylor Cramer [Mon, 18 Jun 2018 23:57:14 +0000 (16:57 -0700)]
Fix typo in multiple lifetimes error

6 years agoParse `unsafe async fn` instead of `async unsafe fn`
Taylor Cramer [Mon, 18 Jun 2018 23:49:34 +0000 (16:49 -0700)]
Parse `unsafe async fn` instead of `async unsafe fn`

6 years agoasync await desugaring and tests
Taylor Cramer [Wed, 6 Jun 2018 22:50:59 +0000 (15:50 -0700)]
async await desugaring and tests

6 years agoDisplay async fn in rustdoc.
Without Boats [Thu, 17 May 2018 21:47:52 +0000 (14:47 -0700)]
Display async fn in rustdoc.

6 years agoParse async fn header.
Without Boats [Thu, 17 May 2018 05:55:18 +0000 (22:55 -0700)]
Parse async fn header.

This is gated on edition 2018 & the `async_await` feature gate.

The parser will accept `async fn` and `async unsafe fn` as fn
items. Along the same lines as `const fn`, only `async unsafe fn`
is permitted, not `unsafe async fn`.The parser will not accept
`async` functions as trait methods.

To do a little code clean up, four fields of the function type
struct have been merged into the new `FnHeader` struct: constness,
asyncness, unsafety, and ABI.

Also, a small bug in HIR printing is fixed: it previously printed
`const unsafe fn` as `unsafe const fn`, which is grammatically
incorrect.

6 years agoAuto merge of #51463 - estebank:error-codes, r=nikomatsakis
bors [Fri, 22 Jun 2018 03:24:36 +0000 (03:24 +0000)]
Auto merge of #51463 - estebank:error-codes, r=nikomatsakis

Various changes to existing diagnostics

* [Add code to `invalid ABI` error, add span label, move list to help to make message shorter](https://github.com/rust-lang/rust/pull/51463/commits/23ae5af274defa9ff884f593e44a2bbcaf814a02):
```
error[E0697]: invalid ABI: found `路濫狼á́́`
  --> $DIR/unicode.rs:11:8
   |
LL | extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
   |        ^^^^^^^^^ invalid ABI
   |
   = help: valid ABIs: cdecl, stdcall, fastcall, vectorcall, thiscall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted
```
* [Add code to incorrect `pub` restriction error](https://github.com/rust-lang/rust/pull/51463/commits/e96fdea8a38f39f99f8b9a4000a689187a457e08)
* [Add message to `rustc_on_unimplemented` attributes in core to have them set a custom message _and_ label](https://github.com/rust-lang/rust/pull/51463/commits/2cc7e5ed307aee936c20479cfdc7409d6b52a464):
```
error[E0277]: `W` does not have a constant size known at compile-time
  --> $DIR/unsized-enum2.rs:33:8
   |
LL |     VA(W),
   |        ^ `W` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `W`
   = help: consider adding a `where W: std::marker::Sized` bound
   = note: no field of an enum variant may have a dynamically sized type
```
```
error[E0277]: `Foo` cannot be sent between threads safely
  --> $DIR/E0277-2.rs:26:5
   |
LL |     is_send::<Foo>();
   |     ^^^^^^^^^^^^^^ `Foo` cannot be sent between threads safely
   |
   = help: the trait `std::marker::Send` is not implemented for `Foo`
```
```
error[E0277]: can't compare `{integer}` with `std::string::String`
  --> $DIR/binops.rs:16:7
   |
LL |     5 < String::new();
   |       ^ no implementation for `{integer} < std::string::String` and `{integer} > std::string::String`
   |
   = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `{integer}`
```
```
error[E0277]: can't compare `{integer}` with `std::result::Result<{integer}, _>`
  --> $DIR/binops.rs:17:7
   |
LL |     6 == Ok(1);
   |       ^^ no implementation for `{integer} == std::result::Result<{integer}, _>`
   |
   = help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
```
```
error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
  --> $DIR/type-check-defaults.rs:16:19
   |
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
   |                   ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
   |
   = help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`
note: required by `Foo`
  --> $DIR/type-check-defaults.rs:15:1
   |
LL | struct Foo<T, U: FromIterator<T>>(T, U);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
* [Add link to book for `Sized` errors](https://github.com/rust-lang/rust/pull/51463/commits/1244dc7c283323aea1a3457a4458d590a3e160c8):
```
error[E0277]: `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
  --> $DIR/const-unsized.rs:13:29
   |
LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
   |                             ^^^^^^^^^^^^^^^^^^^^^^ `std::fmt::Debug + std::marker::Sync + 'static` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
   = note: constant expressions must have a statically known size
```
* [Point to previous line for single expected token not found](https://github.com/rust-lang/rust/pull/51463/commits/48165168fb0f059d8536cd4a2276b609d4a7f721) (if the current token is in a different line)

6 years agoAdd label to lint for lifetimes used once
Esteban Küber [Fri, 22 Jun 2018 01:17:42 +0000 (18:17 -0700)]
Add label to lint for lifetimes used once

6 years agoAccept `TyError` in patterns to avoid ICE on bad input
Esteban Küber [Fri, 22 Jun 2018 01:18:39 +0000 (18:18 -0700)]
Accept `TyError` in patterns to avoid ICE on bad input

6 years agoAuto merge of #51433 - scalexm:finish-rules, r=nikomatsakis
bors [Fri, 22 Jun 2018 01:17:52 +0000 (01:17 +0000)]
Auto merge of #51433 - scalexm:finish-rules, r=nikomatsakis

[chalkify] Small refactoring and WF/FromEnv rules for types

r? @nikomatsakis

6 years agoAuto merge of #51690 - nikomatsakis:issue-51683-existential-fail, r=oli-obk
bors [Thu, 21 Jun 2018 23:08:32 +0000 (23:08 +0000)]
Auto merge of #51690 - nikomatsakis:issue-51683-existential-fail, r=oli-obk

do not ICE when existing type info is incomplete

Apparently master is kinda ICE-y right now, but only for some people (sadly that set includes me).

I'm not crazy about this PR, because it seems to regress diagnostics a lot, but it *does* fix the problems. I think probably fixing the diagnostics should be done by doing a better job of suppressing errors?

Mitigates  #51683

r? @oli-obk

6 years agoreview comment
Esteban Küber [Thu, 21 Jun 2018 22:52:48 +0000 (15:52 -0700)]
review comment

6 years agoAuto merge of #48149 - varkor:generics-generalisation, r=petrochenkov
bors [Thu, 21 Jun 2018 20:58:51 +0000 (20:58 +0000)]
Auto merge of #48149 - varkor:generics-generalisation, r=petrochenkov

The Great Generics Generalisation: HIR Edition

This is essentially a followup to https://github.com/rust-lang/rust/pull/45930, consolidating the use of separate lifetime and type vectors into single kinds vectors wherever possible. This is intended to provide more of the groundwork for const generics (https://github.com/rust-lang/rust/issues/44580).

r? @eddyb
cc @yodaldevoid

6 years agotolerate existential types whose concrete expansion is not known
Niko Matsakis [Thu, 21 Jun 2018 20:21:44 +0000 (16:21 -0400)]
tolerate existential types whose concrete expansion is not known

6 years agodo not introduce *false* results from lifetime resolution
Niko Matsakis [Thu, 21 Jun 2018 19:26:44 +0000 (15:26 -0400)]
do not introduce *false* results from lifetime resolution

6 years agoAccount for bindings with types and in crate macros
Esteban Küber [Thu, 21 Jun 2018 19:10:53 +0000 (12:10 -0700)]
Account for bindings with types and in crate macros

6 years agouse `pat_ty_adjusted` from `expr_use_visitor` to type of arguments
Niko Matsakis [Thu, 21 Jun 2018 18:32:52 +0000 (14:32 -0400)]
use `pat_ty_adjusted` from `expr_use_visitor` to type of arguments

6 years agorename `pat_ty` to `pat_ty_adjusted` for clarity
Niko Matsakis [Thu, 21 Jun 2018 18:32:34 +0000 (14:32 -0400)]
rename `pat_ty` to `pat_ty_adjusted` for clarity

6 years agoSupport future deprecation for rustc_deprecated
varkor [Thu, 21 Jun 2018 13:37:35 +0000 (14:37 +0100)]
Support future deprecation for rustc_deprecated

6 years agoAuto merge of #51680 - Mark-Simulacrum:acc-revert, r=Mark-Simulacrum
bors [Thu, 21 Jun 2018 13:36:37 +0000 (13:36 +0000)]
Auto merge of #51680 - Mark-Simulacrum:acc-revert, r=Mark-Simulacrum

Revert #51662

This reverts that PR because it was never intended to merge into the master branch.

6 years agoRevert "Auto merge of #51662 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum"
Mark Simulacrum [Thu, 21 Jun 2018 12:53:26 +0000 (06:53 -0600)]
Revert "Auto merge of #51662 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum"

This reverts commit fff1abadd7a4ec861ca4b9c77035379578ef033d, reversing
changes made to 01172a7d137dcba06f190241caadcaabe7c94767.

6 years agoShare code between gather_used_muts and find_assignments
Rémy Rakic [Thu, 21 Jun 2018 12:12:26 +0000 (14:12 +0200)]
Share code between gather_used_muts and find_assignments

6 years agoAuto merge of #50336 - japaric:llvm-tools, r=Mark-Simulacrum
bors [Thu, 21 Jun 2018 11:28:14 +0000 (11:28 +0000)]
Auto merge of #50336 - japaric:llvm-tools, r=Mark-Simulacrum

ship LLVM tools with the toolchain

this PR adds llvm-{nm,objcopy,objdump,size} to the rustc sysroot (right next to LLD)

this slightly increases the size of the rustc component. I measured these numbers on x86_64 Linux:

- rustc-1.27.0-dev-x86_64-unknown-linux-gnu.tar.gz 180M -> 193M (+7%)
- rustc-1.27.0-dev-x86_64-unknown-linux-gnu.tar.xz 129M -> 137M (+6%)

r? @alexcrichton
cc #49584

6 years agoAuto merge of #51601 - Emerentius:step_by_range_diet, r=sfackler
bors [Thu, 21 Jun 2018 08:55:13 +0000 (08:55 +0000)]
Auto merge of #51601 - Emerentius:step_by_range_diet, r=sfackler

Specialize StepBy<Range(Inclusive)>

Part of #51557, related to #43064, #31155

As discussed in the above issues, `step_by` optimizes very badly on ranges which is related to
1. the special casing of the first `StepBy::next()` call
2. the need to do 2 additions of `n - 1` and `1` inside the range's `next()`

This PR eliminates both by overriding `next()` to always produce the current element and also step ahead by `n` elements in one go. The generated code is much better, even identical in the case of a `Range` with constant `start` and `end` where `start+step` can't overflow. Without constant bounds it's a bit longer than the manual loop. `RangeInclusive` doesn't optimize as nicely but is still much better than the original asm.
Unsigned integers optimize better than signed ones for some reason.

See the following two links for a comparison.

[godbolt: specialization for ..](https://godbolt.org/g/haHLJr)
[godbolt: specialization for ..=](https://godbolt.org/g/ewyMu6)

`RangeFrom`, the only other range with an `Iterator` implementation can't be specialized like this without changing behaviour due to overflow. There is no way to save "finished-ness".

The approach can not be used in general, because it would produce side effects of the underlying iterator too early.

May obsolete #51435, haven't checked.

6 years agoAuto merge of #51662 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors [Thu, 21 Jun 2018 04:02:57 +0000 (04:02 +0000)]
Auto merge of #51662 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum

[beta] Prepare 1.28.0 beta release

This feels likely to fail due to https://github.com/rust-lang/rust/issues/51650 but I want to see what CI says.

6 years agoFix error-chain warnings
Mark Simulacrum [Wed, 20 Jun 2018 23:04:54 +0000 (17:04 -0600)]
Fix error-chain warnings

6 years agoDon't suggest incorrect syntax
Esteban Küber [Wed, 20 Jun 2018 23:55:52 +0000 (16:55 -0700)]
Don't suggest incorrect syntax

6 years agono -Bsymbolic for mac; no static-libstdc++ for windows
Jorge Aparicio [Wed, 20 Jun 2018 22:48:04 +0000 (17:48 -0500)]
no -Bsymbolic for mac; no static-libstdc++ for windows

6 years agoAuto merge of #50698 - Eijebong:tempfile, r=oli-obk
bors [Wed, 20 Jun 2018 22:40:18 +0000 (22:40 +0000)]
Auto merge of #50698 - Eijebong:tempfile, r=oli-obk

Replace tempdir by tempfile

6 years agoDisable probestack when GCOV profiling is being used
Marco Castelluccio [Wed, 20 Jun 2018 21:07:55 +0000 (22:07 +0100)]
Disable probestack when GCOV profiling is being used

6 years agomake `parse_seq_to_before_end`, `mk_mac_expr`, and `parse_optional_str` public in...
jeb [Wed, 20 Jun 2018 18:19:05 +0000 (08:19 -1000)]
make `parse_seq_to_before_end`, `mk_mac_expr`, and `parse_optional_str` public in libsyntax

6 years agoFix tidy
Bastien Orivel [Sun, 13 May 2018 13:26:55 +0000 (15:26 +0200)]
Fix tidy

6 years agoReplace tempdir by tempfile in librustc
Bastien Orivel [Sat, 12 May 2018 21:19:35 +0000 (23:19 +0200)]
Replace tempdir by tempfile in librustc

This removes the last dependency on tempdir.

6 years agoReplace tempdir by tempfile in librustc_trans
Bastien Orivel [Tue, 8 May 2018 20:11:58 +0000 (22:11 +0200)]
Replace tempdir by tempfile in librustc_trans

6 years agoReplace tempdir by tempfile in librustdoc
Bastien Orivel [Tue, 8 May 2018 20:06:04 +0000 (22:06 +0200)]
Replace tempdir by tempfile in librustdoc

6 years agoNLL: Walk the MIR only once for the "unused mut" lint
Rémy Rakic [Wed, 20 Jun 2018 16:02:44 +0000 (18:02 +0200)]
NLL: Walk the MIR only once for the "unused mut" lint