]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #52755 - kennytm:update-rustfmt, r=nrc
bors [Sun, 29 Jul 2018 11:27:48 +0000 (11:27 +0000)]
Auto merge of #52755 - kennytm:update-rustfmt, r=nrc

Update rustfmt and RLS

5 years agoUpdate RLS and rustfmt.
kennytm [Thu, 26 Jul 2018 21:58:55 +0000 (05:58 +0800)]
Update RLS and rustfmt.

5 years agoTest clippy first to workaround the derive-new conflict.
kennytm [Sun, 29 Jul 2018 11:05:29 +0000 (19:05 +0800)]
Test clippy first to workaround the derive-new conflict.

5 years agoAuto merge of #52767 - ljedrz:avoid_format, r=petrochenkov
bors [Sun, 29 Jul 2018 09:33:37 +0000 (09:33 +0000)]
Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkov

Prefer to_string() to format!()

Simple benchmarks suggest in some cases it can be faster by even 37%:
```
test converting_f64_long  ... bench:         339 ns/iter (+/- 199)
test converting_f64_short ... bench:         136 ns/iter (+/- 34)
test converting_i32_long  ... bench:          87 ns/iter (+/- 16)
test converting_i32_short ... bench:          87 ns/iter (+/- 49)
test converting_str       ... bench:          54 ns/iter (+/- 15)
test formatting_f64_long  ... bench:         349 ns/iter (+/- 176)
test formatting_f64_short ... bench:         145 ns/iter (+/- 14)
test formatting_i32_long  ... bench:          98 ns/iter (+/- 14)
test formatting_i32_short ... bench:          93 ns/iter (+/- 15)
test formatting_str       ... bench:          86 ns/iter (+/- 23)
```

5 years agoExempt cloudabi from license check.
kennytm [Sun, 29 Jul 2018 03:54:27 +0000 (11:54 +0800)]
Exempt cloudabi from license check.

5 years agoCopy the test_data/ RLS tests into a writable directory.
kennytm [Sat, 28 Jul 2018 19:36:18 +0000 (03:36 +0800)]
Copy the test_data/ RLS tests into a writable directory.

See rust-lang-nursery/rls#966 for details.

5 years agoAuto merge of #52764 - sinkuu:cleanup, r=nikomatsakis
bors [Sun, 29 Jul 2018 06:32:24 +0000 (06:32 +0000)]
Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakis

Misc cleanups

5 years agoAuto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomez
bors [Sun, 29 Jul 2018 03:20:54 +0000 (03:20 +0000)]
Auto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomez

rustdoc: rework how default passes are chosen

This is a refactor that changes how we select default passes, and changes the set of passes used for `--document-private-items`. It's groundwork for a bigger refactor i want to do.

The major changes:

* There are now two sets of "default passes": one set for "no flags given" and one for "document private items".
* These sets can be selected by a new `DefaultPassOption` enum, which is selected from based on the presence of `--no-defaults` or `--document-private-items` CLI flags, or their associated crate attributes.
* When printing the list of passes, we also print the list of passes for `--document-private-items` in addition to the "default defaults".
* I added `propagate-doc-cfg` and `strip-priv-imports` to the "document private items" set. The former is to ensure items are properly tagged with the full set of cfg flags even when "document private items" is active. The latter is based on feedback and personal experience navigating the `rustc` docs, which use that flag. `strip-priv-imports` only removes non-pub `use` statements, so it should be harmless from a documentation standpoint to remove those items from "private items" documentation.

5 years agoAuto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakis
bors [Sun, 29 Jul 2018 01:14:39 +0000 (01:14 +0000)]
Auto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakis

Update the Cargo submodule and rustfix

Should hopefully bring in a few more `cargo fix`-related fixes.

5 years agoAuto merge of #52355 - pietroalbini:zfeature, r=eddyb
bors [Sat, 28 Jul 2018 23:10:10 +0000 (23:10 +0000)]
Auto merge of #52355 - pietroalbini:zfeature, r=eddyb

Add the -Zcrate-attr=foo unstable rustc option

This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code.

The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable.

cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum

5 years agoAuto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
bors [Sat, 28 Jul 2018 20:44:17 +0000 (20:44 +0000)]
Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus

[rustdoc] Generic impls

Fixes #33772.

r? @QuietMisdreavus

5 years agoAuto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix
bors [Sat, 28 Jul 2018 18:41:40 +0000 (18:41 +0000)]
Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix

do not overwrite child def-id in place but rather remove/insert

When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later.

Fixes #52050

r? @aturon -- do you still remember this code at all? :)

5 years agoMove blanket implementations generation into its own function
Guillaume Gomez [Sat, 28 Jul 2018 18:27:10 +0000 (20:27 +0200)]
Move blanket implementations generation into its own function

5 years agoRemove core exclusion condition
Guillaume Gomez [Sat, 28 Jul 2018 17:06:25 +0000 (19:06 +0200)]
Remove core exclusion condition

5 years agoUpdate the Cargo submodule and rustfix
Alex Crichton [Thu, 26 Jul 2018 00:25:12 +0000 (17:25 -0700)]
Update the Cargo submodule and rustfix

Should hopefully bring in a few more `cargo fix`-related fixes.

5 years agoAuto merge of #52744 - RalfJung:align_offset, r=Kimundi
bors [Sat, 28 Jul 2018 16:44:21 +0000 (16:44 +0000)]
Auto merge of #52744 - RalfJung:align_offset, r=Kimundi

make memrchr use align_offset

I hope I did not screw that up...

Cc @oli-obk who authored the original https://github.com/rust-lang/rust/pull/44537

Fixes #50567 (thanks @bjorn3)

5 years agoAuto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis
bors [Sat, 28 Jul 2018 14:26:16 +0000 (14:26 +0000)]
Auto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis

Change ManuallyDrop<T> to a lang item.

This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item `struct` instead of `union`).

A followup PR can easily solve #47034 as well, by just adding a few `?Sized` to `libcore/mem.rs`.

r? @nikomatsakis

5 years agoDon't display full blanket implementation and put it into its own section
Guillaume Gomez [Fri, 27 Jul 2018 20:59:16 +0000 (22:59 +0200)]
Don't display full blanket implementation and put it into its own section

5 years agoAuto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakis
bors [Sat, 28 Jul 2018 11:37:41 +0000 (11:37 +0000)]
Auto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakis

static infer feature gate

https://github.com/rust-lang/rust/issues/44493

r? @nikomatsakis

5 years agoAuto merge of #52802 - kennytm:rollup, r=kennytm
bors [Sat, 28 Jul 2018 09:40:05 +0000 (09:40 +0000)]
Auto merge of #52802 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #52702 (Suggest fix when encountering different mutability from impl to trait)
 - #52703 (Improve a few vectors - calculate capacity or build from iterators)
 - #52740 (Suggest underscore when using dashes in crate namet push fork)
 - #52759 (Impl Send & Sync for JoinHandle)
 - #52760 (rustc_metadata: test loading atoi instead of cos)
 - #52763 (Omit the vendor component in Fuchsia triple)
 - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag)
 - #52769 (Incorporate a stray test)
 - #52777 (Fix doc comment for 'ptr::copy_to' method)
 - #52779 (revert accidental atty downgrade)
 - #52781 (Use a slice where a vector is not necessary)

Failed merges:

r? @ghost

5 years agoRollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
kennytm [Sat, 28 Jul 2018 08:25:07 +0000 (16:25 +0800)]
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis

Use a slice where a vector is not necessary

5 years agoRollup merge of #52779 - RalfJung:atty, r=Mark-Simulacrum
kennytm [Sat, 28 Jul 2018 08:25:06 +0000 (16:25 +0800)]
Rollup merge of #52779 - RalfJung:atty, r=Mark-Simulacrum

revert accidental atty downgrade

This got accidentally downgraded by https://github.com/rust-lang/rust/pull/52488

Cc @nikomatsakis @pnkfelix

5 years agoRollup merge of #52777 - omni-viral:master, r=TimNN
kennytm [Sat, 28 Jul 2018 08:25:05 +0000 (16:25 +0800)]
Rollup merge of #52777 - omni-viral:master, r=TimNN

Fix doc comment for 'ptr::copy_to' method

Fix error in doc comment for `ptr::copy_to` method.

5 years agoRollup merge of #52769 - sinkuu:stray_test, r=alexcrichton
kennytm [Sat, 28 Jul 2018 08:25:04 +0000 (16:25 +0800)]
Rollup merge of #52769 - sinkuu:stray_test, r=alexcrichton

Incorporate a stray test

`liballoc/repeat-generic-slice.rs` doesn't seem to be tested (I think it was intended to be placed in `run-pass`). This PR incorporates the test into `liballoc/tests`.

5 years agoRollup merge of #52765 - sinkuu:remove_nonzeroing_move_opt, r=pnkfelix
kennytm [Sat, 28 Jul 2018 08:25:03 +0000 (16:25 +0800)]
Rollup merge of #52765 - sinkuu:remove_nonzeroing_move_opt, r=pnkfelix

Remove unused "-Zenable_nonzeroing_move_hints" flag

Removing a dead option which seems to be a remnant of the old drop-flag system.

5 years agoRollup merge of #52763 - petrhosek:fuchsia-triple, r=alexcrichton
kennytm [Sat, 28 Jul 2018 08:25:02 +0000 (16:25 +0800)]
Rollup merge of #52763 - petrhosek:fuchsia-triple, r=alexcrichton

Omit the vendor component in Fuchsia triple

Previously, using unknown as the vendor value would lead to the same
result, but with the multiarch runtimes support in Clang, the target is
now used to locate the runtime libraries and so the format is important.
The denormalized format with omitted vendor component is the format we
use with Clang and should be using for Rust as well.

5 years agoRollup merge of #52760 - cuviper:test_loading_atoi, r=alexcrichton
kennytm [Sat, 28 Jul 2018 08:25:01 +0000 (16:25 +0800)]
Rollup merge of #52760 - cuviper:test_loading_atoi, r=alexcrichton

rustc_metadata: test loading atoi instead of cos

Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes #45410.

5 years agoRollup merge of #52759 - stjepang:impl-send-sync-for-joinhandle, r=TimNN
kennytm [Sat, 28 Jul 2018 08:24:59 +0000 (16:24 +0800)]
Rollup merge of #52759 - stjepang:impl-send-sync-for-joinhandle, r=TimNN

Impl Send & Sync for JoinHandle

This is just a cosmetic change - it slightly relaxes and clarifies the public API without effectively promising any new guarantees.

Currently we have [these auto trait implementations](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#synthetic-implementations):

```rust
impl<T: Send> Send for JoinHandle<T> {}
impl<T: Sync> Sync for JoinHandle<T> {}
```

Bound `T: Send` doesn't make much sense because `JoinHandle<T>` can be created only when `T: Send`. Note that [`JoinHandle::<T>::join`](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#method.join) doesn't require `T: Send` so why should the `Send` impl?

And the `Sync` impl doesn't need `T: Sync` because `JoinHandle<T>` cannot even share `T` - it can only send it to the thread that calls `join`.

5 years agoRollup merge of #52740 - estebank:crate-name, r=petrochenkov
kennytm [Sat, 28 Jul 2018 08:24:58 +0000 (16:24 +0800)]
Rollup merge of #52740 - estebank:crate-name, r=petrochenkov

Suggest underscore when using dashes in crate namet push fork

Fix #48437.

5 years agoRollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakis
kennytm [Sat, 28 Jul 2018 08:24:57 +0000 (16:24 +0800)]
Rollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakis

Improve a few vectors - calculate capacity or build from iterators

Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.

5 years agoRollup merge of #52702 - csmoe:mut_diff, r=estebank
kennytm [Sat, 28 Jul 2018 08:24:55 +0000 (16:24 +0800)]
Rollup merge of #52702 - csmoe:mut_diff, r=estebank

Suggest fix when encountering different mutability from impl to trait

Closes https://github.com/rust-lang/rust/issues/52412
r? @estebank

5 years agoAuto merge of #52678 - matthewjasper:better-spans, r=nikomatsakis
bors [Sat, 28 Jul 2018 07:42:13 +0000 (07:42 +0000)]
Auto merge of #52678 - matthewjasper:better-spans, r=nikomatsakis

[NLL] Use better spans in some errors

* Use the span of the discriminant and patterns for "fake" statements created to properly check matches. I plan to special case these soon, but this felt like a good first step
* Use the span of the statement, rather than the initialization, when reporting move errors for `let x = ...`, which avoids giving an unhelpful suggestion to use `&{ }`.

r? @nikomatsakis cc @pnkfelix

5 years agoreview comments
Esteban Küber [Fri, 27 Jul 2018 20:11:48 +0000 (13:11 -0700)]
review comments

5 years agoAuto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrum
bors [Fri, 27 Jul 2018 20:27:40 +0000 (20:27 +0000)]
Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrum

Rollup of bare_trait_objects PRs

All deny attributes were moved into bootstrap so they can be disabled with a line of config.

Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free.

r? @Mark-Simulacrum
cc @ljedrz @kennytm

5 years agoAdd the -Zcrate-attr=foo nightly rustc flag to inject crate attributes
Pietro Albini [Wed, 18 Jul 2018 18:34:08 +0000 (20:34 +0200)]
Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributes

5 years agouodate reference again to hopefully fix all link issues
Ralf Jung [Fri, 27 Jul 2018 16:40:47 +0000 (18:40 +0200)]
uodate reference again to hopefully fix all link issues

5 years agoAuto merge of #52770 - pietroalbini:bump-bootstrap, r=Mark-Simulacrum
bors [Fri, 27 Jul 2018 15:03:33 +0000 (15:03 +0000)]
Auto merge of #52770 - pietroalbini:bump-bootstrap, r=Mark-Simulacrum

Bump bootstrap compiler

This PR bumps the bootstrap compiler to the latest beta, `beta-2017-07-27`. That should be the latest beta with relevant changes (the only nominated PR at the moment is a docs change).

r? @Mark-Simulacrum

5 years agoUse slices where a vector is not necessary
ljedrz [Fri, 27 Jul 2018 14:50:28 +0000 (16:50 +0200)]
Use slices where a vector is not necessary

5 years agoBetter Option handling
Shotaro Yamada [Mon, 2 Apr 2018 23:45:06 +0000 (08:45 +0900)]
Better Option handling

5 years agoSimplify
Shotaro Yamada [Sun, 1 Apr 2018 04:52:45 +0000 (13:52 +0900)]
Simplify

5 years agoUnnecessary `to_string`
Shotaro Yamada [Sat, 17 Mar 2018 00:46:32 +0000 (09:46 +0900)]
Unnecessary `to_string`

5 years agoRemove unnecessary `.collect()`
Shotaro Yamada [Fri, 16 Mar 2018 13:35:26 +0000 (22:35 +0900)]
Remove unnecessary `.collect()`

5 years agoUse str::repeat
Shotaro Yamada [Sun, 1 Apr 2018 04:48:15 +0000 (13:48 +0900)]
Use str::repeat

5 years agoadd section in book
toidiu [Fri, 27 Jul 2018 14:18:06 +0000 (10:18 -0400)]
add section in book

5 years agorevert accidental atty downgrade
Ralf Jung [Fri, 27 Jul 2018 13:10:52 +0000 (15:10 +0200)]
revert accidental atty downgrade

5 years agoAuto merge of #52648 - davidtwco:issue-52533, r=nikomatsakis
bors [Fri, 27 Jul 2018 13:01:48 +0000 (13:01 +0000)]
Auto merge of #52648 - davidtwco:issue-52533, r=nikomatsakis

[nll] improve the "fully elaborated type" case in region errors

Fixes #52533.

r? @nikomatsakis

5 years agoFix doc comment for 'ptr::copy_to' method
Zakarum [Fri, 27 Jul 2018 12:26:57 +0000 (15:26 +0300)]
Fix doc comment for 'ptr::copy_to' method

5 years agoupdate reference to fix links
Ralf Jung [Fri, 27 Jul 2018 11:38:20 +0000 (13:38 +0200)]
update reference to fix links

5 years agoRegion inference error messages no longer start with 'free region'
David Wood [Thu, 26 Jul 2018 13:36:41 +0000 (15:36 +0200)]
Region inference error messages no longer start with 'free region'

5 years agoAuto merge of #52733 - pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm,...
bors [Fri, 27 Jul 2018 11:02:27 +0000 (11:02 +0000)]
Auto merge of #52733 - pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm, r=nikomatsakis

[NLL] make temp for each candidate in `match` arm

In NLL, `ref mut` patterns leverage the two-phase borrow infrastructure to allow the shared borrows within a guard before the "activation" of the mutable borrow when we begin execution of the match arm's body. (There is further discussion of this on PR #50783.)

To accommodate the restrictions we impose on two-phase borrows (namely that there is a one-to-one mapping between each activation and the original initialization), this PR is making separate temps for each candidate pattern. So in an arm like this:
```rust
PatA(_, ref mut ident) |
PatB(ref mut ident) |
PatC(_, _, ref mut ident) |
PatD(ref mut ident) if guard_stuff(ident) => ...
```

instead of 3 temps (two for the guard and one for the arm body), we now have 4 + 2 temps associated with `ident`: one for each candidate plus the actual temp that the guard uses directly, and then the sixth is the temp used in the arm body.

Fix #51348

5 years agoImproved mechanism for naming regions in non-annotated types.
David Wood [Thu, 26 Jul 2018 10:29:58 +0000 (12:29 +0200)]
Improved mechanism for naming regions in non-annotated types.

5 years agoChange label from closure to function where appropriate.
David Wood [Tue, 24 Jul 2018 14:22:41 +0000 (16:22 +0200)]
Change label from closure to function where appropriate.

5 years agobump bootstrap compiler to beta-2018-07-27
Pietro Albini [Fri, 27 Jul 2018 10:24:17 +0000 (12:24 +0200)]
bump bootstrap compiler to beta-2018-07-27

5 years agoadd smoke test for ManuallyDrop
Ralf Jung [Fri, 27 Jul 2018 10:12:55 +0000 (12:12 +0200)]
add smoke test for ManuallyDrop

5 years agoFixed missing whitespace on some elaborated types.
David Wood [Mon, 23 Jul 2018 15:41:18 +0000 (17:41 +0200)]
Fixed missing whitespace on some elaborated types.

5 years agoUpdate affected tests.
David Wood [Mon, 23 Jul 2018 14:27:24 +0000 (16:27 +0200)]
Update affected tests.

5 years agouse slice::align_to
Ralf Jung [Fri, 27 Jul 2018 09:54:38 +0000 (11:54 +0200)]
use slice::align_to

5 years agoImproved fully elaborated type generation to replace `'_#2r`-style regions.
David Wood [Mon, 23 Jul 2018 14:26:33 +0000 (16:26 +0200)]
Improved fully elaborated type generation to replace `'_#2r`-style regions.

5 years agoAdded fully elaborated type label for inferred arguments.
David Wood [Mon, 23 Jul 2018 11:09:30 +0000 (13:09 +0200)]
Added fully elaborated type label for inferred arguments.

5 years agoSimplified closure handling to need no new cosntraint categories.
David Wood [Mon, 23 Jul 2018 11:07:11 +0000 (13:07 +0200)]
Simplified closure handling to need no new cosntraint categories.

5 years agoPrefer to_string() to format!()
ljedrz [Fri, 27 Jul 2018 09:11:18 +0000 (11:11 +0200)]
Prefer to_string() to format!()

5 years agoAuto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakis
bors [Fri, 27 Jul 2018 09:10:07 +0000 (09:10 +0000)]
Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakis

Add `-Z borrowck=migrate`

This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition.

The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy:

If your code is accepted by NLL, then we accept it.
If your code is rejected by both NLL and the old AST-borrowck, then we reject it.
If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**.

These warnings will be turned into hard errors in the future, and they say so in these diagnostics.

Fix #46908

5 years agoIncorporate a stray test
Shotaro Yamada [Sat, 28 Apr 2018 16:19:06 +0000 (01:19 +0900)]
Incorporate a stray test

5 years agoRemove unused option flag
Shotaro Yamada [Fri, 20 Apr 2018 10:53:55 +0000 (19:53 +0900)]
Remove unused option flag

5 years agoAdd stability attributes
Stjepan Glavina [Fri, 27 Jul 2018 08:08:02 +0000 (10:08 +0200)]
Add stability attributes

5 years agoAuto merge of #52650 - oli-obk:associated_existential_types, r=nikomatsakis
bors [Fri, 27 Jul 2018 07:16:12 +0000 (07:16 +0000)]
Auto merge of #52650 - oli-obk:associated_existential_types, r=nikomatsakis

Implement associated existential types

r? @nikomatsakis

no idea if these work with generic traits. I'm going home for the day :rofl:

5 years agoOmit the vendor component in Fuchsia triple
Petr Hosek [Fri, 27 Jul 2018 00:57:20 +0000 (17:57 -0700)]
Omit the vendor component in Fuchsia triple

Previously, using unknown as the vendor value would lead to the same
result, but with the multiarch runtimes support in Clang, the target is
now used to locate the runtime libraries and so the format is important.
The denormalized format with omitted vendor component is the format we
use with Clang and should be using for Rust as well.

5 years agofix tidy
toidiu [Fri, 27 Jul 2018 04:02:58 +0000 (00:02 -0400)]
fix tidy

5 years agoAuto merge of #52724 - alexcrichton:update-compiler-builtins, r=alexcrichton
bors [Fri, 27 Jul 2018 03:24:16 +0000 (03:24 +0000)]
Auto merge of #52724 - alexcrichton:update-compiler-builtins, r=alexcrichton

Update the compiler-builtins submodule

Pull in a fix for japaric/libm#129

5 years agofix test and add feature gate test
toidiu [Fri, 27 Jul 2018 02:58:03 +0000 (22:58 -0400)]
fix test and add feature gate test

5 years agosome comment about not infering static lifetimes test
toidiu [Fri, 27 Jul 2018 00:32:01 +0000 (20:32 -0400)]
some comment about not infering static lifetimes test

5 years agofeature gate for inferring 'static lifetimes
toidiu [Fri, 27 Jul 2018 00:25:27 +0000 (20:25 -0400)]
feature gate for inferring 'static lifetimes

5 years agorustc_metadata: test loading atoi instead of cos
Josh Stone [Fri, 27 Jul 2018 00:20:02 +0000 (17:20 -0700)]
rustc_metadata: test loading atoi instead of cos

Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes #45410.

5 years agoImpl Send & Sync for JoinHandle
Stjepan Glavina [Thu, 26 Jul 2018 23:08:13 +0000 (01:08 +0200)]
Impl Send & Sync for JoinHandle

5 years agoAuto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebank
bors [Thu, 26 Jul 2018 22:20:17 +0000 (22:20 +0000)]
Auto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebank

Try to fix an ICE

might fix #52671

5 years agoUse better spans for cannot-move errors
Matthew Jasper [Sun, 22 Jul 2018 20:38:31 +0000 (21:38 +0100)]
Use better spans for cannot-move errors

5 years agoUse better spans for dummy accesses used in matches
Matthew Jasper [Sun, 22 Jul 2018 20:13:18 +0000 (21:13 +0100)]
Use better spans for dummy accesses used in matches

5 years agoreview feedback: no reason to clone just to make a singleton slice.
Felix S. Klock II [Thu, 26 Jul 2018 20:48:56 +0000 (22:48 +0200)]
review feedback: no reason to clone just to make a singleton slice.

5 years agorustdoc: rework how default passes are chosen
QuietMisdreavus [Thu, 26 Jul 2018 20:33:25 +0000 (15:33 -0500)]
rustdoc: rework how default passes are chosen

5 years agoSuggest underscore when using dashes in crate namet push fork
Esteban Küber [Thu, 26 Jul 2018 05:18:47 +0000 (22:18 -0700)]
Suggest underscore when using dashes in crate namet push fork

5 years agoImprove a few vectors - calculate capacity or build from iterators
ljedrz [Wed, 25 Jul 2018 11:20:53 +0000 (13:20 +0200)]
Improve a few vectors - calculate capacity or build from iterators

5 years agoAuto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 26 Jul 2018 17:42:59 +0000 (17:42 +0000)]
Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 16 pull requests

Successful merges:

 - #52558 (Add tests for ICEs which no longer repro)
 - #52610 (Clarify what a task is)
 - #52617 (Don't match on region kinds when reporting NLL errors)
 - #52635 (Fix #[linkage] propagation though generic functions)
 - #52647 (Suggest to take and ignore args while closure args count mismatching)
 - #52649 (Point spans to inner elements of format strings)
 - #52654 (Format linker args in a way that works for gcc and ld)
 - #52667 (update the stdsimd submodule)
 - #52674 (Impl Executor for Box<E: Executor>)
 - #52690 (ARM: expose `rclass` and `dsp` target features)
 - #52692 (Improve readability in a few sorts)
 - #52695 (Hide some lints which are not quite right the way they are reported to the user)
 - #52718 (State default capacity for BufReader/BufWriter)
 - #52721 (std::ops::Try impl for std::task::Poll)
 - #52723 (rustc: Register crates under their real names)
 - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests))

Failed merges:

 - #52678 ([NLL] Use better spans in some errors)

r? @ghost

5 years agomake memrchr use align_offset
Ralf Jung [Thu, 26 Jul 2018 16:29:38 +0000 (18:29 +0200)]
make memrchr use align_offset

5 years agoAuto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelix
bors [Thu, 26 Jul 2018 15:23:50 +0000 (15:23 +0000)]
Auto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelix

introduce universes to NLL type check

This branch aims to fix #48071 and also advance chalk integration a bit at the same time. It re-implements the subtyping/type-equating check so that NLL doesn't "piggy back" on the subtyping code of the old type checker.

This new code uses the "universe-based" approach to handling higher-ranked lifetimes, which sidesteps some of the limitations of the current "leak-based" scheme. This avoids the ICE in #48071.

At the same time, I aim for this to potentially be a kind of optimization. This NLL code is (currently) not cached, but it also generates constraints without doing as much instantiation, substitution, and folding. Right now, though, it still piggy backs on the `relate_tys` trait, which is a bit unfortunate -- it means we are doing more hashing and things than we have to. I want to measure the see the perf. Refactoring that trait is something I'd prefer to leave for follow-up work.

r? @pnkfelix -- but I want to measure perf etc first

5 years agoRollup merge of #52734 - nagisa:sparcfix, r=oli-obk
Mark Rousskov [Thu, 26 Jul 2018 15:18:42 +0000 (09:18 -0600)]
Rollup merge of #52734 - nagisa:sparcfix, r=oli-obk

sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)

Fixes #52638

Supersedes #52730

cc @psumbera

5 years agoRollup merge of #52723 - alexcrichton:fix-extern-rename-ice, r=estebank
Mark Rousskov [Thu, 26 Jul 2018 15:18:41 +0000 (09:18 -0600)]
Rollup merge of #52723 - alexcrichton:fix-extern-rename-ice, r=estebank

rustc: Register crates under their real names

Whenever we register a crate into the crate store, make sure to use the real
name mentioned in the metadata instead of the name mentioned in the `extern
crate` statement, as the statement can be wrong!

Closes #51796

5 years agoRollup merge of #52721 - cramertj:try-poll, r=aturon
Mark Rousskov [Thu, 26 Jul 2018 15:18:40 +0000 (09:18 -0600)]
Rollup merge of #52721 - cramertj:try-poll, r=aturon

std::ops::Try impl for std::task::Poll

I originally left out the `Try` impl for `Poll` because I was curious if we needed it, and @MajorBreakfast and I had discussed the potential for it to introduce confusion about exactly what control-flow was happening at different points. However, after porting a pretty significant chunk of Fuchsia over to futures 0.3, I discovered that I was *constantly* having to do repetitive matching on `Poll<Result<...>>` or `Poll<Option<Result<...>>>` in order to propagate errors correctly. `try_poll` (propagate `Poll::Ready(Err(..))`s) helped in some places, but it was far more common to need some form of conversion between `Result`, `Poll<Result<...>>`, and `Poll<Option<Result<...>>>`. The `Try` trait conveniently provides all of these conversions in addition to a more concise syntax (`?`), so I'd like to experiment with using these instead.

cc @seanmonstar

r? @aturon

Note: this change means that far more futures 0.1 code can work without significant changes since it papers over the fact that `Result` is no longer at the top-level when using `Stream` and `Future` (since it's now `Poll<Result<...>>` or `Poll<Option<Result<...>>>` instead of `Result<Poll<..>>` and `Result<Poll<Option<...>>>`).

5 years agoRollup merge of #52718 - fintelia:patch-2, r=cramertj
Mark Rousskov [Thu, 26 Jul 2018 15:18:39 +0000 (09:18 -0600)]
Rollup merge of #52718 - fintelia:patch-2, r=cramertj

State default capacity for BufReader/BufWriter

Addresses #52513

5 years agoRollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkov
Mark Rousskov [Thu, 26 Jul 2018 15:18:37 +0000 (09:18 -0600)]
Rollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkov

Hide some lints which are not quite right the way they are reported to the user

fixes #52603

5 years agoRollup merge of #52692 - ljedrz:sort_improvements, r=petrochenkov
Mark Rousskov [Thu, 26 Jul 2018 15:18:36 +0000 (09:18 -0600)]
Rollup merge of #52692 - ljedrz:sort_improvements, r=petrochenkov

Improve readability in a few sorts

Use `sort_by_key` where possible.

5 years agoRollup merge of #52690 - paoloteti:rclass-dsp, r=alexcrichton
Mark Rousskov [Thu, 26 Jul 2018 15:18:35 +0000 (09:18 -0600)]
Rollup merge of #52690 - paoloteti:rclass-dsp, r=alexcrichton

ARM: expose `rclass` and `dsp` target features

- `dsp`: the subtarget supports the DSP (saturating arith. and such)
         instructions
- `rclass`: target is a Cortex-R

Both features are useful to support ARM MCUs on `coresimd`.

Note: Cortex-R52 is the first Armv8-R with `neon` support.

r? @alexcrichton
cc @japaric

5 years agoRollup merge of #52674 - tinaun:patch-2, r=cramertj
Mark Rousskov [Thu, 26 Jul 2018 15:18:34 +0000 (09:18 -0600)]
Rollup merge of #52674 - tinaun:patch-2, r=cramertj

Impl Executor for Box<E: Executor>

removes the need for the compatibility lib between futures 0.1 and 0.3 to use a wrapper type to implement Executor for Box<Executor>

5 years agoRollup merge of #52667 - japaric:stdsimd-up, r=alexcrichton
Mark Rousskov [Thu, 26 Jul 2018 15:18:32 +0000 (09:18 -0600)]
Rollup merge of #52667 - japaric:stdsimd-up, r=alexcrichton

update the stdsimd submodule

to bring in the doc generation fix

r? @alexcrichton
cc @Mark-Simulacrum

5 years agoRollup merge of #52654 - alecmocatta:master, r=alexcrichton
Mark Rousskov [Thu, 26 Jul 2018 15:18:31 +0000 (09:18 -0600)]
Rollup merge of #52654 - alecmocatta:master, r=alexcrichton

Format linker args in a way that works for gcc and ld

Pass multiple linker arguments rather than concatenate with commas (fixes #52634).

`-l library` -> `-llibrary` to work with apple's ld.

To build with apple's ld I'm currently also passing `-C link-args="-arch x86_64 -macosx_version_min 10.13.0"`. I'll try and understand the latter flag better before PRing that.

This PR currently works for me. Hopefully CI will pick up any grievous ramifications in other toolchains?

Thanks to @alexcrichton for the pointer to the relevant code!

5 years agoRollup merge of #52649 - estebank:fmt-span, r=oli-obk
Mark Rousskov [Thu, 26 Jul 2018 15:18:30 +0000 (09:18 -0600)]
Rollup merge of #52649 - estebank:fmt-span, r=oli-obk

Point spans to inner elements of format strings

- Point at missing positional specifiers in string literal
```
error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
  --> $DIR/ifmt-bad-arg.rs:34:38
   |
LL |     format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
   |                                      ^^ ^^ ^^
   |
   = note: positional arguments are zero-based
```

- Point at named formatting specifier in string literal
```
error: there is no argument named `foo`
  --> $DIR/ifmt-bad-arg.rs:37:17
   |
LL |     format!("{} {foo} {} {bar} {}", 1, 2, 3);
   |                 ^^^^^
```

- Update label for formatting string in "multiple unused formatting arguments" to be more correct
```
error: multiple unused formatting arguments
  --> $DIR/ifmt-bad-arg.rs:42:17
   |
LL |     format!("", 1, 2);               //~ ERROR: multiple unused formatting arguments
   |             --  ^  ^
   |             |
   |             multiple missing formatting specifiers
```

- When using `printf` string formatting, provide a structured suggestion instead of a note
```
error: multiple unused formatting arguments
  --> $DIR/format-foreign.rs:12:30
   |
LL |     println!("%.*3$s %s!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
   |              --------------  ^^^^^^^^  ^^^^^^^  ^
   |              |
   |              multiple missing formatting specifiers
   |
   = note: printf formatting not supported; see the documentation for `std::fmt`
help: format specifiers in Rust are written using `{}`
   |
LL |     println!("{:.2$} {}!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
   |               ^^^^^^ ^^
```

5 years agoRollup merge of #52647 - csmoe:closure_arg_ignore, r=estebank
Mark Rousskov [Thu, 26 Jul 2018 15:18:29 +0000 (09:18 -0600)]
Rollup merge of #52647 - csmoe:closure_arg_ignore, r=estebank

Suggest to take and ignore args while closure args count mismatching

Closes #52473

5 years agoRollup merge of #52635 - yodaldevoid:issue_18804, r=oli-obk
Mark Rousskov [Thu, 26 Jul 2018 15:18:27 +0000 (09:18 -0600)]
Rollup merge of #52635 - yodaldevoid:issue_18804, r=oli-obk

Fix #[linkage] propagation though generic functions

Fixes #18804

In the non-local branch of `get_static` (where the fix was implemented) `span_fatal` had to be replaced with `bug!` as we have no span in that case.

5 years agoRollup merge of #52617 - matthewjasper:remove-unused-code, r=nikomatsakis
Mark Rousskov [Thu, 26 Jul 2018 15:18:26 +0000 (09:18 -0600)]
Rollup merge of #52617 - matthewjasper:remove-unused-code, r=nikomatsakis

Don't match on region kinds when reporting NLL errors

First half (by number of tests affected) of the changes to "does not live long enough".

Now that lexical MIR borrowck is gone, region kinds are always ReVar, so matching on them to change errors does nothing.

Changes "borrowed value only lives until here" to "`x` is dropped here while still borrowed".

r? @pnkfelix  cc @nikomatsakis

5 years agoRollup merge of #52610 - MajorBreakfast:task-terminology, r=cramertj
Mark Rousskov [Thu, 26 Jul 2018 15:18:25 +0000 (09:18 -0600)]
Rollup merge of #52610 - MajorBreakfast:task-terminology, r=cramertj

Clarify what a task is

Currently we call two distinct concepts "task":
1. The top-level future that is polled until completion
2. The lightweight "thread" that is responsible for polling the top-level future. What additional data beside the future is stored in this type varies between different `Executor` implementations.

I'd prefer to return to the old formulation by @alexcrichton:
```rust
/// A handle to a "task", which represents a single lightweight "thread" of
/// execution driving a future to completion.
pub struct Task {
```
Source: [`task_impl/mod.rs` in futures-rs 0.1](https://github.com/rust-lang-nursery/futures-rs/blob/1328fc9e8af5737183df477c7501e6ea24ff2053/src/task_impl/mod.rs#L49-L50)

I think that this change will make it much easier to explain everything.

r? @aturon
@cramertj

5 years agoRollup merge of #52558 - wesleywiser:ice_melting, r=estebank
Mark Rousskov [Thu, 26 Jul 2018 15:18:23 +0000 (09:18 -0600)]
Rollup merge of #52558 - wesleywiser:ice_melting, r=estebank

Add tests for ICEs which no longer repro

Adds tests for some ICEs which no longer repro and closes the associated issues.