Commit Graph

98208 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
777a12c3a4 Use dedicated type for spans in pre-expansion gating. 2019-08-20 20:26:37 +02:00
Eric Huss
7d92cf4826 Bump toml dependency.
Just removing an old/duplicated dependency from the workspace.
2019-08-20 10:46:35 -07:00
Mazdak Farrokhzad
e3e8b7f12a
Rollup merge of #63750 - eddyb:lazy-seq, r=Zoxc
rustc_metadata: replace LazySeq<T> with Lazy<[T]>.

Part of #59953, split out for separate landing (see https://github.com/rust-lang/rust/pull/59953#issuecomment-502460092).

r? @Zoxc
2019-08-20 19:42:21 +02:00
Mazdak Farrokhzad
234614a705
Rollup merge of #63746 - sd234678:remove-unneeded-comment-decoration-from-src/test, r=Centril
Cherry-pick src/test changes with Centril's changes

None
2019-08-20 19:42:20 +02:00
Mazdak Farrokhzad
3f7e7c2fd3
Rollup merge of #63209 - Centril:stabilize-async-await, r=cramertj
Stabilize `async_await` in Rust 1.39.0

Here we stabilize:
- free and inherent `async fn`s,
- the `<expr>.await` expression form,
- and the `async move? { ... }` block form.

Closes https://github.com/rust-lang/rust/issues/62149.
Closes https://github.com/rust-lang/rust/issues/50547.

All the blockers are now closed.

<details>
- [x] FCP in https://github.com/rust-lang/rust/issues/62149
- [x] https://github.com/rust-lang/rust/issues/61949; PR in https://github.com/rust-lang/rust/pull/62849.
- [x] https://github.com/rust-lang/rust/issues/62517; PR in https://github.com/rust-lang/rust/pull/63376.
- [x] https://github.com/rust-lang/rust/issues/63225; PR in https://github.com/rust-lang/rust/pull/63501
- [x] https://github.com/rust-lang/rust/issues/63388; PR in https://github.com/rust-lang/rust/pull/63499
- [x] https://github.com/rust-lang/rust/issues/63500; PR in https://github.com/rust-lang/rust/pull/63501
- [x] https://github.com/rust-lang/rust/issues/62121#issuecomment-506884048
    - [x] Some tests for control flow (PR https://github.com/rust-lang/rust/pull/63387):
          - `?`
          - `return` in `async` blocks
          - `break`
    - [x] https://github.com/rust-lang/rust/pull/61775#issuecomment-506883180, i.e. tests for https://github.com/rust-lang/rust/pull/60944 with `async fn`s instead). PR in https://github.com/rust-lang/rust/pull/63383

</details>

r? @cramertj
2019-08-20 19:42:18 +02:00
Mazdak Farrokhzad
4593f40b29
Rollup merge of #62497 - o01eg:fix-62496, r=alexcrichton
Fix double resolving custom libdir

Fixes #62496

Related issue is https://bugs.gentoo.org/672816
2019-08-20 19:42:16 +02:00
Eduard-Mihai Burtescu
e7ceaa9748 rustc_metadata: replace LazySeq<T> with Lazy<[T]>. 2019-08-20 18:36:05 +03:00
bors
5a56e05abd Auto merge of #63744 - Centril:rollup-g4l3ra9, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #63216 (avoid unnecessary reservations in std::io::Take::read_to_end)
 - #63265 (Implement `nth_back` for ChunksExactMut)
 - #63691 (Fix bug in iter::Chain::size_hint)
 - #63722 (Don't use stage naming in RUSTFLAGS environment variables)
 - #63723 (Consolidate sigemptyset workarounds)
 - #63736 (Restore the rustc_plugin crate in the sysroot)
 - #63743 (Allow git to merge `Cargo.lock`)

Failed merges:

r? @ghost
2019-08-20 15:01:24 +00:00
Mazdak Farrokhzad
218bcf2e01
Rollup merge of #63743 - alexcrichton:allow-lock-merge, r=Mark-Simulacrum
Allow git to merge `Cargo.lock`

This commit backs out #46539 in order to fully leverage #63579 where
`git` should be able to merge `Cargo.lock` nowadays with only minimal
conflicts.
2019-08-20 16:26:44 +02:00
Mazdak Farrokhzad
cadf6b9343
Rollup merge of #63736 - SimonSapin:plugin, r=eddyb
Restore the rustc_plugin crate in the sysroot

It was accidentally removed in a rebase of https://github.com/rust-lang/rust/pull/62727

Fixes https://github.com/rust-lang/rust/issues/63729 (rls build failure)
2019-08-20 16:26:43 +02:00
Mazdak Farrokhzad
3662a9fb04
Rollup merge of #63723 - josephlr:sigemptyset, r=alexcrichton
Consolidate sigemptyset workarounds

In sys/unix/process, we work around the sigemptyset linking issues
on android in two different ways. This change consolidates these
workarounds, and avoids duplicating bindings from `libc`.
2019-08-20 16:26:41 +02:00
Mazdak Farrokhzad
af77aedb0e
Rollup merge of #63722 - Mark-Simulacrum:bootstrap-rustflags, r=alexcrichton
Don't use stage naming in RUSTFLAGS environment variables

This patch supports less behavior than before, since specifiying stage 1
vs stage 2 is no longer possible, but that is presumably a somewhat rare
use case anyway, so not supporting it seems acceptable (and it can be
readded easily if desired).

Fixes #33609
2019-08-20 16:26:40 +02:00
Mazdak Farrokhzad
ff352cd65a
Rollup merge of #63691 - timvermeulen:chain-size-hint, r=scottmcm
Fix bug in iter::Chain::size_hint

`Chain::size_hint` currently ignores `self.state`, which means that the size hints of the underlying iterators are always combined regardless of the iteration state. This, of course, should only happen when the state is `ChainState::Both`.
2019-08-20 16:26:38 +02:00
Mazdak Farrokhzad
60649e3a2e
Rollup merge of #63265 - JohnTitor:implement-nth-back-for-chunksexactmut, r=scottmcm
Implement `nth_back` for ChunksExactMut

This is a part of #54054.

r? @scottmcm
2019-08-20 16:26:37 +02:00
Mazdak Farrokhzad
a5299dd5d1
Rollup merge of #63216 - oconnor663:take_read_to_end, r=sfackler
avoid unnecessary reservations in std::io::Take::read_to_end

Prevously the `read_to_end` implementation for `std::io::Take` used its
own `limit` as a cap on the `reservation_size`. However, that could
still result in an over-allocation like this:

1. Call `reader.take(5).read_to_end(&mut vec)`.
2. `read_to_end_with_reservation` reserves 5 bytes and calls `read`.
3. `read` writes 5 bytes.
4. `read_to_end_with_reservation` reserves 5 bytes and calls `read`.
5. `read` writes 0 bytes.
6. The read loop ends with `vec` having length 5 and capacity 10.

The reservation of 5 bytes was correct for the read at step 2 but
unnecessary for the read at step 4. By that second read, `Take::limit`
is 0, but the `read_to_end_with_reservation` loop is still using the
same `reservation_size` it started with.

Solve this by having `read_to_end_with_reservation` take a closure,
which lets it get a fresh `reservation_size` for each read. This is an
implementation detail which doesn't affect any public API.
2019-08-20 16:26:34 +02:00
Alex Crichton
815ce8cb1d Allow git to merge Cargo.lock
This commit backs out #46539 in order to fully leverage #63579 where
`git` should be able to merge `Cargo.lock` nowadays with only minimal
conflicts.
2019-08-20 06:56:46 -07:00
Mark Rousskov
72e2cfd934 Remove serialization of diagnostics to files
This is no longer used by the index generator and was always an unstable
compiler detail, so strip it out.

This also leaves in RUSTC_ERROR_METADATA_DST since the stage0 compiler
still needs it to be set.
2019-08-20 09:55:31 -04:00
Mark Rousskov
99ce39b30a Load error codes via build script instead of JSON parsing
This scans the tree for `error_codes.rs` and loads all of them.
2019-08-20 09:55:31 -04:00
Simon Sapin
c561abeea2 Restore the rustc_plugin crate in the sysroot
It was accidentally removed in a rebase of https://github.com/rust-lang/rust/pull/62727

Fixes https://github.com/rust-lang/rust/issues/63729
2019-08-20 13:30:50 +02:00
bors
51879c3aba Auto merge of #63587 - flip1995:clippyup, r=flip1995
Update Clippy and cargo

r? @Manishearth  @oli-obk
2019-08-20 11:24:31 +00:00
Artyom Pavlov
bd1dc7cf92
fix libc checksum 2019-08-20 10:26:10 +00:00
Artyom Pavlov
e500fc3171
Merge branch 'master' into redox_builder 2019-08-20 10:08:57 +00:00
bors
14890954ce Auto merge of #63709 - matklad:decomposed-tokens, r=petrochenkov
Move token gluing to token stream parsing

work towards #63689, this moves token gluing from the lexer to the token tree layer. This is only a minimal step, but I like the negative diff here.

r? @petrochenkov
2019-08-20 07:44:44 +00:00
flip1995
96c3ec12f6
Update Cargo.lock 2019-08-20 09:32:53 +02:00
flip1995
4f5629567d
Update cargo 2019-08-20 09:32:12 +02:00
flip1995
82dec85b40
Update Clippy 2019-08-20 09:32:12 +02:00
Seiichi Uchida
0be01fa655 Update rustfmt to 1.4.5 2019-08-20 16:23:46 +09:00
Phosphorus15
e33d8707c8 Refined implementations of asinh and acosh 2019-08-20 15:12:41 +08:00
Phosphorus15
535efa4afd Used copysign to avoid unnecessary branches. 2019-08-20 12:39:12 +08:00
bors
7858dc237d Auto merge of #63497 - eddyb:miri-subst, r=oli-obk
rustc_mir: fix miri substitution/"universe" discipline.

Alternative to #61041, based on @RalfJung's own attempt at it.
I haven't done a full audit, but I believe everything is fixed now.

Fixes #61432.
Closes #61336, as a drive-by fix (for a subset of #43408, that is already special-cased).

r? @oli-obk / @RalfJung cc @varkor @yodaldevoid
2019-08-20 04:14:51 +00:00
Jeremy Fitzhardinge
d2219c2e2e rustc: implement argsfiles for command line
This makes `rustc` support `@path` arguments on the command line. The `path` is opened and the file is interpreted
as new command line options which are logically inserted at that point in the command-line. The options in the file
are one per line. The file is UTF-8 encoded, and may have either Unix or Windows line endings.
It does not support recursive use of `@path`.

This is useful for very large command lines, or when command-lines are being generated into files by other tooling.
2019-08-19 19:06:46 -07:00
Jeremy Fitzhardinge
859657f2c5 Use named arguments for formatting usage message.
It was getting a bit awkward.
2019-08-19 19:06:46 -07:00
Mazdak Farrokhzad
21476e7d6c --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
Mazdak Farrokhzad
228015acd2 Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
Mazdak Farrokhzad
6a14411b76 Remove async_await feature gate tests. 2019-08-20 02:38:02 +02:00
Mazdak Farrokhzad
b0d4782948 Stabilize 'async_await'. 2019-08-20 02:38:02 +02:00
bors
d8d99baf56 Auto merge of #62727 - SimonSapin:plugins-tls-dylib, r=petrochenkov
Deprecate using rustc_plugin without the rustc_driver dylib.

CC https://github.com/rust-lang/rust/pull/59800, 7198687bb2

Fix https://github.com/rust-lang/rust/issues/62717
2019-08-20 00:31:13 +00:00
Joe Richey
8e91dca596 Consolidate sigemptyset workarounds
In sys/unix/process, we work around the sigemptyset linking issues
on android in two different ways. This change consolidates these
workarounds, and avoids duplicating bindings from `libc`.
2019-08-19 16:15:34 -07:00
Mark Rousskov
9b3f072292 Don't use stage naming in RUSTFLAGS environment variables
This patch supports less behavior than before, since specifiying stage 1
vs stage 2 is no longer possible, but that is presumably a somewhat rare
use case anyway, so not supporting it seems acceptable (and it can be
readded easily if desired).
2019-08-19 18:52:14 -04:00
Simon Sapin
d0bbc6062d Deprecate using rustc_plugin without the rustc_driver dylib.
CC https://github.com/rust-lang/rust/pull/59800
7198687bb2

Fix https://github.com/rust-lang/rust/issues/62717
2019-08-20 00:21:32 +02:00
sd234678
4eec03d33e Cherry-pick src/test changes with Centril's changes 2019-08-19 22:31:46 +01:00
bors
c1b08dd260 Auto merge of #63715 - Centril:rollup-dga8qtp, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #63252 (Remove recommendation about idiomatic syntax for Arc::clone)
 - #63376 (use different lifetime name for object-lifetime-default elision)
 - #63620 (Use constraint span when lowering associated types)
 - #63699 (Fix suggestion from incorrect `move async` to `async move`.)
 - #63704 ( Fixed: error: unnecessary trailing semicolon)

Failed merges:

r? @ghost
2019-08-19 20:49:39 +00:00
Mazdak Farrokhzad
ac34594209
Rollup merge of #63704 - Wind-River:master, r=Centril
Fixed: error: unnecessary trailing semicolon
2019-08-19 22:48:59 +02:00
Mazdak Farrokhzad
2c0f05a04f
Rollup merge of #63699 - gilescope:async-move-diagnostic, r=estebank
Fix suggestion from incorrect `move async` to `async move`.

PR for #61920. Happy with the test. There must be a better implementation though - possibly a MIR visitor to estabilsh a span that doesn't include the `async` keyword?
2019-08-19 22:48:57 +02:00
Mazdak Farrokhzad
a2080a60ac
Rollup merge of #63620 - estebank:assoc-type-span, r=Centril
Use constraint span when lowering associated types

Fix #63594.

r? @Centril
2019-08-19 22:48:55 +02:00
Mazdak Farrokhzad
bece1177c0
Rollup merge of #63376 - nikomatsakis:async-await-issue-62517, r=cramertj
use different lifetime name for object-lifetime-default elision

Introduce a distinct value for `LifetimeName` to use when this is a object-lifetime-default elision. This allows us to avoid creating incorrect lifetime parameters for the opaque types that result. We really need to overhaul this setup at some point! It's getting increasingly byzantine. But this seems like a relatively... surgical fix.

r? @cramertj

Fixes #62517
2019-08-19 22:48:54 +02:00
Mazdak Farrokhzad
4486c02695
Rollup merge of #63252 - nrc:arc-doc, r=alexcrichton
Remove recommendation about idiomatic syntax for Arc::clone

I believe we should not make this recommendation. I don't want to argue that `Arc::clone` is less idiomatic than `arc.clone`, but that the choice is not clear cut and that we should not be making this kind of call in the docs.

The `.clone()` form has advantages too: it is more succinct, it is more likely to be understood by beginners, and it is more uniform with other `clone` calls, indeed with most other method calls.

Whichever approach is better, I think that this discussion belongs in a style guide or textbook, rather than the library docs. We don't talk much about idiomatic code in the docs, this place is pretty exceptional.

The recommendation is also not followed in this repo. It is hard to figure out how many calls there are of the `.clone()` form, but there are 1550 uses of `Arc` and only 65 uses of `Arc::clone`. The recommendation has existed for over two years.

The recommendation was added in https://github.com/rust-lang/rust/pull/42137, as a result of https://github.com/rust-lang/rfcs/pull/1954. However, note that that RFC was closed because it was not necessary to change the docs (the original RFC proposed a new function instead). So I don't think an RFC is necessary here (and I'm not trying to re-litigate the discussion on that RFC (which favoured `Arc::clone` as idiomatic) in any case).

cc @nical (who added the docs in the first place; sorry :-) )

r? @alexcrichton (or someone else on @rust-lang/libs )
2019-08-19 22:48:52 +02:00
Artyom Pavlov
34c9f8c649
remove any from cfgs 2019-08-19 20:02:50 +00:00
Artyom Pavlov
1dd2d3076d
cfg fix 2 2019-08-19 20:01:02 +00:00
Artyom Pavlov
1417f53863
fix cfg 2019-08-19 19:58:35 +00:00