Commit Graph

81437 Commits

Author SHA1 Message Date
kennytm
cab21f12d5
Update RLS and rustfmt. 2018-07-29 19:05:42 +08:00
kennytm
9c5c8d6491
Test clippy first to workaround the derive-new conflict. 2018-07-29 19:05:41 +08:00
Mikhail Modin
bb66d70b89 fix issues #51351 and #52133 2018-07-29 11:42:50 +01:00
bors
023fd7e74a 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)
```
2018-07-29 09:33:37 +00:00
Josef Reinhard Brandl
ea25cf1cc6 Fix From<LocalWaker> 2018-07-29 10:45:17 +02:00
kennytm
bc2ba799cb
Exempt cloudabi from license check. 2018-07-29 15:12:47 +08:00
kennytm
a28e3d28aa
Copy the test_data/ RLS tests into a writable directory.
See rust-lang-nursery/rls#966 for details.
2018-07-29 15:12:47 +08:00
Unknown
b6d3143488 pretty print for std::collections::vecdeque 2018-07-29 15:43:54 +09:00
bors
a5c2d0fffa Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakis
Misc cleanups
2018-07-29 06:32:24 +00:00
bors
fb0653e402 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.
2018-07-29 03:20:54 +00:00
bors
6a2c97c38d 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.
2018-07-29 01:14:39 +00:00
bors
6323d9a45b 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
2018-07-28 23:10:10 +00:00
bors
dab71516f1 Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
[rustdoc] Generic impls

Fixes #33772.

r? @QuietMisdreavus
2018-07-28 20:44:17 +00:00
Matthew Jasper
173c33019e Don't make "fake" match variables mutable 2018-07-28 21:18:34 +01:00
bors
4234adf0d4 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? :)
2018-07-28 18:41:40 +00:00
Guillaume Gomez
06364bd460 Move blanket implementations generation into its own function 2018-07-28 20:27:10 +02:00
Guillaume Gomez
bdbb5b9469 Remove core exclusion condition 2018-07-28 19:06:25 +02:00
Alex Crichton
fa5b3d31fa Update the Cargo submodule and rustfix
Should hopefully bring in a few more `cargo fix`-related fixes.
2018-07-28 09:50:34 -07:00
bors
d754582005 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)
2018-07-28 16:44:21 +00:00
ljedrz
421b2ba347 Don't format!() string literals 2018-07-28 17:58:52 +02:00
bors
26e73dabeb 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
2018-07-28 14:26:16 +00:00
Guillaume Gomez
7a3c7b2097 Don't display full blanket implementation and put it into its own section 2018-07-28 15:18:38 +02:00
bors
5b465e309d 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
2018-07-28 11:37:41 +00:00
bors
cc224282de 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
2018-07-28 09:40:05 +00:00
kennytm
59f8422a17
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
Use a slice where a vector is not necessary
2018-07-28 16:25:07 +08:00
kennytm
f0efbc0d6b
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
2018-07-28 16:25:06 +08:00
kennytm
f22c03fb57
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.
2018-07-28 16:25:05 +08:00
kennytm
2c088cb03e
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`.
2018-07-28 16:25:04 +08:00
kennytm
c9347f7f49
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.
2018-07-28 16:25:03 +08:00
kennytm
1fad057e2e
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.
2018-07-28 16:25:02 +08:00
kennytm
42e92d9ee5
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.
2018-07-28 16:25:01 +08:00
kennytm
b326319f15
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`.
2018-07-28 16:24:59 +08:00
kennytm
b584c3227d
Rollup merge of #52740 - estebank:crate-name, r=petrochenkov
Suggest underscore when using dashes in crate namet push fork

Fix #48437.
2018-07-28 16:24:58 +08:00
kennytm
7da22148ec
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.
2018-07-28 16:24:57 +08:00
kennytm
80c798b982
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
2018-07-28 16:24:55 +08:00
bors
0560747652 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
2018-07-28 07:42:13 +00:00
Esteban Küber
647d295fb2 review comments 2018-07-27 13:33:38 -07:00
bors
4f1e235744 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
2018-07-27 20:27:40 +00:00
Pietro Albini
71276c6abc
Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributes 2018-07-27 19:51:21 +02:00
Ralf Jung
4e6aea1a10 uodate reference again to hopefully fix all link issues 2018-07-27 18:40:47 +02:00
bors
43e6e2ef6a 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
2018-07-27 15:03:33 +00:00
ljedrz
1cca420435 Use slices where a vector is not necessary 2018-07-27 16:50:28 +02:00
Shotaro Yamada
e995a91a31 Better Option handling 2018-07-27 23:26:36 +09:00
Shotaro Yamada
1bc49a9743 Simplify 2018-07-27 23:26:36 +09:00
Shotaro Yamada
4c1cb7534b Unnecessary to_string 2018-07-27 23:26:36 +09:00
Shotaro Yamada
8296699fae Remove unnecessary .collect() 2018-07-27 23:26:36 +09:00
Shotaro Yamada
3525368a56 Use str::repeat 2018-07-27 23:26:36 +09:00
toidiu
130e3ab31b add section in book 2018-07-27 10:18:06 -04:00
Ralf Jung
a171ed2164 revert accidental atty downgrade 2018-07-27 15:10:52 +02:00
bors
b6cbc1e147 Auto merge of #52648 - davidtwco:issue-52533, r=nikomatsakis
[nll] improve the "fully elaborated type" case in region errors

Fixes #52533.

r? @nikomatsakis
2018-07-27 13:01:48 +00:00