]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMove def_id out add substsref
Wesley Wiser [Tue, 6 Aug 2019 01:11:55 +0000 (21:11 -0400)]
Move def_id out add substsref

4 years agoRemove eval_promoted const-prop hack
Wesley Wiser [Tue, 6 Aug 2019 00:01:59 +0000 (20:01 -0400)]
Remove eval_promoted const-prop hack

4 years agoMove promoted out of mir::Body
Wesley Wiser [Sun, 4 Aug 2019 20:20:21 +0000 (16:20 -0400)]
Move promoted out of mir::Body

4 years agoMove 'tcx lifetime on MirPass
Wesley Wiser [Sun, 4 Aug 2019 20:20:00 +0000 (16:20 -0400)]
Move 'tcx lifetime on MirPass

4 years agoAuto merge of #63705 - mark-i-m:fix-guide-1, r=ehuss
bors [Wed, 21 Aug 2019 22:25:45 +0000 (22:25 +0000)]
Auto merge of #63705 - mark-i-m:fix-guide-1, r=ehuss

Update rustc-guide

Should fix toolstate failure

r? @ehuss

4 years agoAuto merge of #63790 - Centril:rollup-m4ax3r9, r=Centril
bors [Wed, 21 Aug 2019 17:09:25 +0000 (17:09 +0000)]
Auto merge of #63790 - Centril:rollup-m4ax3r9, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #61236 (take into account the system theme)
 - #63717 (Fix nested eager expansions in arguments of `format_args`)
 - #63747 (update Miri)
 - #63772 (ci: move libc mirrors to the rust-lang-ci-mirrors bucket)
 - #63780 (Improve diagnostics: break/continue in wrong context)
 - #63781 (Run Clippy without json-rendered flag)

Failed merges:

r? @ghost

4 years agoupdate rustc-guide
Mark Mansi [Mon, 19 Aug 2019 16:06:15 +0000 (11:06 -0500)]
update rustc-guide

4 years agoRollup merge of #63781 - mati865:clippy, r=oli-obk,ehuss
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:45 +0000 (17:31 +0200)]
Rollup merge of #63781 - mati865:clippy, r=oli-obk,ehuss

Run Clippy without json-rendered flag

Removed in https://github.com/rust-lang/rust/pull/62766

Replacing it with `--json=diagnostic-rendered-ansi` fails:
```
error: using `--json` requires also using `--error-format=json`
```
Running `./x.py clippy src/libstd` locally works fine (with colors) on Linux so I don't know if there is something to fix.

4 years agoRollup merge of #63780 - u32i64:issue-63712, r=estebank
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:43 +0000 (17:31 +0200)]
Rollup merge of #63780 - u32i64:issue-63712, r=estebank

Improve diagnostics: break/continue in wrong context

- Fix #63712
- Use `` `break` `` or `` `continue` `` instead of always `break` in `cannot _...`
- Show the enclosing closure or async block we're talking about
- `` `break` outside of loop `` -> `` `break` outside of a loop `` for consistency

r? @estebank

4 years agoRollup merge of #63772 - pietroalbini:mirrors-libc, r=alexcrichton
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:42 +0000 (17:31 +0200)]
Rollup merge of #63772 - pietroalbini:mirrors-libc, r=alexcrichton

ci: move libc mirrors to the rust-lang-ci-mirrors bucket

Finishing up #63485. Already moved the objects.

r? @alexcrichton

4 years agoRollup merge of #63747 - RalfJung:miri, r=RalfJung
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:41 +0000 (17:31 +0200)]
Rollup merge of #63747 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/63673

r? @oli-obk

4 years agoRollup merge of #63717 - petrochenkov:eager, r=matthewjasper
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:39 +0000 (17:31 +0200)]
Rollup merge of #63717 - petrochenkov:eager, r=matthewjasper

Fix nested eager expansions in arguments of `format_args`

Fixes https://github.com/rust-lang/rust/issues/63460
Fixes https://github.com/rust-lang/rust/issues/63685 (regression from making `format_args` opaque - https://github.com/rust-lang/rust/pull/63114)

r? @matthewjasper

4 years agoRollup merge of #61236 - GuillaumeGomez:system-theme, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 21 Aug 2019 15:31:38 +0000 (17:31 +0200)]
Rollup merge of #61236 - GuillaumeGomez:system-theme, r=Mark-Simulacrum

take into account the system theme

Fixes #61079.

The CSS can now take into account the system theme. I used it to generate some content on the document and from there, if no theme has already been selected, it'll look at the system level theme.

r? @QuietMisdreavus
cc @fenhl

4 years agomore `--bless`ing + test error annotations fixes
Artem Varaksa [Wed, 21 Aug 2019 12:13:13 +0000 (15:13 +0300)]
more `--bless`ing + test error annotations fixes

4 years agoAuto merge of #63779 - Centril:rollup-sx96dli, r=Centril
bors [Wed, 21 Aug 2019 11:40:23 +0000 (11:40 +0000)]
Auto merge of #63779 - Centril:rollup-sx96dli, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #63721 (Do not emit JSON dumps of diagnostic codes)
 - #63753 (Bump toml dependency.)
 - #63755 (Use dedicated type for spans in pre-expansion gating.)
 - #63759 (Allow 'default async fn' to parse.)
 - #63760 (Update books)
 - #63762 (`async_await` was stabilized in 1.39.0, not 1.38.0.)
 - #63766 (Remove some duplication when resolving constants)

Failed merges:

r? @ghost

4 years ago`r#type` -> `ty`
Artem Varaksa [Wed, 21 Aug 2019 11:32:38 +0000 (14:32 +0300)]
`r#type` -> `ty`

4 years agoReplaced skipStorage with saveTheme variable
Guillaume Gomez [Wed, 21 Aug 2019 10:49:01 +0000 (12:49 +0200)]
Replaced skipStorage with saveTheme variable

4 years agoimprove diagnostics: break/continue wrong context
Artem Varaksa [Wed, 21 Aug 2019 10:17:59 +0000 (13:17 +0300)]
improve diagnostics: break/continue wrong context

4 years agoRun Clippy without json-rendered flag
Mateusz Mikuła [Wed, 21 Aug 2019 10:14:00 +0000 (12:14 +0200)]
Run Clippy without json-rendered flag

4 years agoAdd a regression test for issue #63460
Vadim Petrochenkov [Wed, 21 Aug 2019 09:53:11 +0000 (12:53 +0300)]
Add a regression test for issue #63460

4 years agoRollup merge of #63766 - oli-obk:const_eval_dedup, r=zackmdavis
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:29 +0000 (11:52 +0200)]
Rollup merge of #63766 - oli-obk:const_eval_dedup, r=zackmdavis

Remove some duplication when resolving constants

4 years agoRollup merge of #63762 - rust-lang:fix-async-date, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:28 +0000 (11:52 +0200)]
Rollup merge of #63762 - rust-lang:fix-async-date, r=Mark-Simulacrum

`async_await` was stabilized in 1.39.0, not 1.38.0.

r? @Mark-Simulacrum

4 years agoRollup merge of #63760 - ehuss:update-books, r=ehuss
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:26 +0000 (11:52 +0200)]
Rollup merge of #63760 - ehuss:update-books, r=ehuss

Update books

## nomicon

25 commits in 8a7d05615e5bc0a7fb961b4919c44f5221ee54da..38b9a76bc8b59ac862663807fc51c9b757337fd6
2019-08-07 07:46:59 -0500 to 2019-08-19 10:04:32 -0400
- Fix transmute_copy link
- some edits
- drop parenthetical
- clarify dangling
- fix def.n of dangling
- fold uninit integer rule with reading uninit memory
- refactor null a bit
- resolve some nits
- raw ptrs must be initialized like integers
- Apply suggestions from code review
- explain when metadata is invalid
- mention !
- add more cases of UB
- avoid redundant UB
- stick to broader UB for raw ptr offsets/derefs for now
- be more precise about dangling
- subsume the NonNull things as library types
- handle recursion in the heading
- Define 'producing'
- NonNull, NonZero*
- list more ptr offset computations
- UB
- Fix typo in subtyping
- Add colon to `MySuperSliceable` too
- Fix typo `str::mem` to `std::mem`

## reference

2 commits in b4b3536839042a6743fc76f0d9ad2a812020aeaa..d191a0cdd3b92648e0f1e53b13140a14677cc65b
2019-08-07 02:29:50 +0200 to 2019-08-15 08:42:23 +0200
- Fix warning in stable-check (rust-lang-nursery/reference#653)
- our closure syntax comes from Ruby (rust-lang-nursery/reference#650)

## rust-by-example

5 commits in f2c15ba5ee89ae9469a2cf60494977749901d764..580839d90aacd537f0293697096fa8355bc4e673
2019-08-07 10:14:25 -0300 to 2019-08-17 23:17:50 -0300
- macros.md: Changing Sometime to more appropriate adverb form Sometimes (rust-lang/rust-by-example#1243)
- Add colon after "See Also" (rust-lang/rust-by-example#1242)
- Update enter_question_mark.md (rust-lang/rust-by-example#1208)
- Add destructuring bind examples (rust-lang/rust-by-example#1238)
- Change initial parameters in `fibonacci()` call. (rust-lang/rust-by-example#1241)

## embedded-book

1 commits in c5da1e11915d3f28266168baaf55822f7e3fe999..432ca26686c11d396eed6a59499f93ce1bf2433c
2019-08-05 23:02:10 +0000 to 2019-08-09 23:20:22 +0000
- semihosting: add comment adding feature flag to panic-semihosting  (rust-embedded/book#203)

4 years agoRollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkov
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:25 +0000 (11:52 +0200)]
Rollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkov

Allow 'default async fn' to parse.

- Parse default async fn. Fixes #63716.

(`cherry-pick`ed from 3rd commit in https://github.com/rust-lang/rust/pull/63749.)

r? @petrochenkov

4 years agoRollup merge of #63755 - Centril:simplify-prexp-gating, r=petrochenkov
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:23 +0000 (11:52 +0200)]
Rollup merge of #63755 - Centril:simplify-prexp-gating, r=petrochenkov

Use dedicated type for spans in pre-expansion gating.

- Simplify the overall pre-expansion gating "experience".

4 years agoRollup merge of #63753 - ehuss:bump-toml, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:21 +0000 (11:52 +0200)]
Rollup merge of #63753 - ehuss:bump-toml, r=Mark-Simulacrum

Bump toml dependency.

Just removing an old/duplicated dependency from the workspace.

4 years agoRollup merge of #63721 - Mark-Simulacrum:decouple-error-index, r=matthewjasper
Mazdak Farrokhzad [Wed, 21 Aug 2019 09:52:20 +0000 (11:52 +0200)]
Rollup merge of #63721 - Mark-Simulacrum:decouple-error-index, r=matthewjasper

Do not emit JSON dumps of diagnostic codes

This decouples the error index generator from libsyntax for the most part (though it still depends on librustdoc for the markdown parsing and generation).

Fixes #34588

4 years agoresolve/expand: Rename some things for clarity and add comments
Vadim Petrochenkov [Mon, 19 Aug 2019 21:24:28 +0000 (00:24 +0300)]
resolve/expand: Rename some things for clarity and add comments

4 years agoexpand: Do not do questionable span adjustment before eagerly expanding an expression
Vadim Petrochenkov [Mon, 19 Aug 2019 20:44:57 +0000 (23:44 +0300)]
expand: Do not do questionable span adjustment before eagerly expanding an expression

Maybe it made sense when it was introduced, but now it's doing something incorrect.

4 years agoexpand: Keep the correct current expansion ID for eager expansions
Vadim Petrochenkov [Mon, 19 Aug 2019 20:35:25 +0000 (23:35 +0300)]
expand: Keep the correct current expansion ID for eager expansions

Solve the problem of `ParentScope` entries for eager expansions not exising in the resolver map by creating them on demand.

4 years agoAdd a test for an opaque macro eagerly expanding its arguments
Vadim Petrochenkov [Mon, 19 Aug 2019 20:10:07 +0000 (23:10 +0300)]
Add a test for an opaque macro eagerly expanding its arguments

4 years agotake into account the system theme
Guillaume Gomez [Mon, 27 May 2019 13:57:44 +0000 (15:57 +0200)]
take into account the system theme

4 years agoupdate Miri
Ralf Jung [Wed, 21 Aug 2019 07:37:23 +0000 (09:37 +0200)]
update Miri

4 years agoci: move libc mirrors to the rust-lang-ci-mirrors bucket
Pietro Albini [Wed, 21 Aug 2019 07:06:55 +0000 (09:06 +0200)]
ci: move libc mirrors to the rust-lang-ci-mirrors bucket

4 years agoRemove some duplication when resolving constants
Oliver Scherer [Wed, 21 Aug 2019 00:29:08 +0000 (02:29 +0200)]
Remove some duplication when resolving constants

4 years agoasync_await was stabilized in 1.39.0, not 1.38.0.
Mazdak Farrokhzad [Tue, 20 Aug 2019 22:23:08 +0000 (00:23 +0200)]
async_await was stabilized in 1.39.0, not 1.38.0.

4 years agoUpdate books
Eric Huss [Tue, 20 Aug 2019 21:03:13 +0000 (14:03 -0700)]
Update books

4 years agoAllow 'default async fn' to parse.
Mazdak Farrokhzad [Tue, 20 Aug 2019 16:10:43 +0000 (18:10 +0200)]
Allow 'default async fn' to parse.

4 years agoAuto merge of #63752 - Centril:rollup-nlxwety, r=Centril
bors [Tue, 20 Aug 2019 18:33:16 +0000 (18:33 +0000)]
Auto merge of #63752 - Centril:rollup-nlxwety, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #62497 (Fix double resolving custom libdir)
 - #63209 (Stabilize `async_await` in Rust 1.39.0)
 - #63746 (Cherry-pick src/test changes with Centril's changes)
 - #63750 (rustc_metadata: replace LazySeq<T> with Lazy<[T]>.)

Failed merges:

r? @ghost

4 years agoUse dedicated type for spans in pre-expansion gating.
Mazdak Farrokhzad [Tue, 20 Aug 2019 15:07:42 +0000 (17:07 +0200)]
Use dedicated type for spans in pre-expansion gating.

4 years agoBump toml dependency.
Eric Huss [Tue, 20 Aug 2019 17:46:35 +0000 (10:46 -0700)]
Bump toml dependency.

Just removing an old/duplicated dependency from the workspace.

4 years agoRollup merge of #63750 - eddyb:lazy-seq, r=Zoxc
Mazdak Farrokhzad [Tue, 20 Aug 2019 17:42:21 +0000 (19:42 +0200)]
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

4 years agoRollup merge of #63746 - sd234678:remove-unneeded-comment-decoration-from-src/test...
Mazdak Farrokhzad [Tue, 20 Aug 2019 17:42:20 +0000 (19:42 +0200)]
Rollup merge of #63746 - sd234678:remove-unneeded-comment-decoration-from-src/test, r=Centril

Cherry-pick src/test changes with Centril's changes

None

4 years agoRollup merge of #63209 - Centril:stabilize-async-await, r=cramertj
Mazdak Farrokhzad [Tue, 20 Aug 2019 17:42:18 +0000 (19:42 +0200)]
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

4 years agoRollup merge of #62497 - o01eg:fix-62496, r=alexcrichton
Mazdak Farrokhzad [Tue, 20 Aug 2019 17:42:16 +0000 (19:42 +0200)]
Rollup merge of #62497 - o01eg:fix-62496, r=alexcrichton

Fix double resolving custom libdir

Fixes #62496

Related issue is https://bugs.gentoo.org/672816

4 years agorustc_metadata: replace LazySeq<T> with Lazy<[T]>.
Eduard-Mihai Burtescu [Wed, 22 May 2019 10:30:07 +0000 (13:30 +0300)]
rustc_metadata: replace LazySeq<T> with Lazy<[T]>.

4 years agoAuto merge of #63744 - Centril:rollup-g4l3ra9, r=Centril
bors [Tue, 20 Aug 2019 15:01:24 +0000 (15:01 +0000)]
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

4 years agoRollup merge of #63743 - alexcrichton:allow-lock-merge, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:44 +0000 (16:26 +0200)]
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.

4 years agoRollup merge of #63736 - SimonSapin:plugin, r=eddyb
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:43 +0000 (16:26 +0200)]
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)

4 years agoRollup merge of #63723 - josephlr:sigemptyset, r=alexcrichton
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:41 +0000 (16:26 +0200)]
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`.

4 years agoRollup merge of #63722 - Mark-Simulacrum:bootstrap-rustflags, r=alexcrichton
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:40 +0000 (16:26 +0200)]
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

4 years agoRollup merge of #63691 - timvermeulen:chain-size-hint, r=scottmcm
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:38 +0000 (16:26 +0200)]
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`.

4 years agoRollup merge of #63265 - JohnTitor:implement-nth-back-for-chunksexactmut, r=scottmcm
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:37 +0000 (16:26 +0200)]
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

4 years agoRollup merge of #63216 - oconnor663:take_read_to_end, r=sfackler
Mazdak Farrokhzad [Tue, 20 Aug 2019 14:26:34 +0000 (16:26 +0200)]
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.

4 years agoAllow git to merge `Cargo.lock`
Alex Crichton [Tue, 20 Aug 2019 13:56:46 +0000 (06:56 -0700)]
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.

4 years agoRemove serialization of diagnostics to files
Mark Rousskov [Mon, 19 Aug 2019 22:26:08 +0000 (18:26 -0400)]
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.

4 years agoLoad error codes via build script instead of JSON parsing
Mark Rousskov [Mon, 19 Aug 2019 22:04:25 +0000 (18:04 -0400)]
Load error codes via build script instead of JSON parsing

This scans the tree for `error_codes.rs` and loads all of them.

4 years agoRestore the rustc_plugin crate in the sysroot
Simon Sapin [Tue, 20 Aug 2019 11:03:00 +0000 (13:03 +0200)]
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

4 years agoAuto merge of #63587 - flip1995:clippyup, r=flip1995
bors [Tue, 20 Aug 2019 11:24:31 +0000 (11:24 +0000)]
Auto merge of #63587 - flip1995:clippyup, r=flip1995

Update Clippy and cargo

r? @Manishearth  @oli-obk

4 years agoAuto merge of #63709 - matklad:decomposed-tokens, r=petrochenkov
bors [Tue, 20 Aug 2019 07:44:44 +0000 (07:44 +0000)]
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

4 years agoUpdate Cargo.lock
flip1995 [Tue, 20 Aug 2019 07:32:53 +0000 (09:32 +0200)]
Update Cargo.lock

4 years agoUpdate cargo
flip1995 [Mon, 19 Aug 2019 11:55:35 +0000 (13:55 +0200)]
Update cargo

4 years agoUpdate Clippy
flip1995 [Thu, 15 Aug 2019 14:04:30 +0000 (16:04 +0200)]
Update Clippy

4 years agoAuto merge of #63497 - eddyb:miri-subst, r=oli-obk
bors [Tue, 20 Aug 2019 04:14:51 +0000 (04:14 +0000)]
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

4 years ago--bless post no async_await gates in tests.
Mazdak Farrokhzad [Fri, 2 Aug 2019 01:48:43 +0000 (03:48 +0200)]
--bless post no async_await gates in tests.

4 years agoRemove async_await gates from tests.
Mazdak Farrokhzad [Fri, 2 Aug 2019 01:45:58 +0000 (03:45 +0200)]
Remove async_await gates from tests.

4 years agoRemove async_await feature gate tests.
Mazdak Farrokhzad [Fri, 2 Aug 2019 01:45:29 +0000 (03:45 +0200)]
Remove async_await feature gate tests.

4 years agoStabilize 'async_await'.
Mazdak Farrokhzad [Fri, 2 Aug 2019 01:44:00 +0000 (03:44 +0200)]
Stabilize 'async_await'.

4 years agoAuto merge of #62727 - SimonSapin:plugins-tls-dylib, r=petrochenkov
bors [Tue, 20 Aug 2019 00:31:13 +0000 (00:31 +0000)]
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, https://github.com/rust-lang/rust/commit/7198687bb2df13a3298ef1e8f594753073d6b9e8

Fix https://github.com/rust-lang/rust/issues/62717

4 years agoConsolidate sigemptyset workarounds
Joe Richey [Mon, 19 Aug 2019 23:14:07 +0000 (16:14 -0700)]
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`.

4 years agoDon't use stage naming in RUSTFLAGS environment variables
Mark Rousskov [Mon, 19 Aug 2019 22:52:14 +0000 (18:52 -0400)]
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).

4 years agoDeprecate using rustc_plugin without the rustc_driver dylib.
Simon Sapin [Tue, 16 Jul 2019 17:08:32 +0000 (19:08 +0200)]
Deprecate using rustc_plugin without the rustc_driver dylib.

CC https://github.com/rust-lang/rust/pull/59800
https://github.com/rust-lang/rust/commit/7198687bb2df13a3298ef1e8f594753073d6b9e8

Fix https://github.com/rust-lang/rust/issues/62717

4 years agoCherry-pick src/test changes with Centril's changes
sd234678 [Mon, 19 Aug 2019 21:31:46 +0000 (22:31 +0100)]
Cherry-pick src/test changes with Centril's changes

4 years agoAuto merge of #63715 - Centril:rollup-dga8qtp, r=Centril
bors [Mon, 19 Aug 2019 20:49:39 +0000 (20:49 +0000)]
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

4 years agoRollup merge of #63704 - Wind-River:master, r=Centril
Mazdak Farrokhzad [Mon, 19 Aug 2019 20:48:59 +0000 (22:48 +0200)]
Rollup merge of #63704 - Wind-River:master, r=Centril

 Fixed: error: unnecessary trailing semicolon

4 years agoRollup merge of #63699 - gilescope:async-move-diagnostic, r=estebank
Mazdak Farrokhzad [Mon, 19 Aug 2019 20:48:57 +0000 (22:48 +0200)]
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?

4 years agoRollup merge of #63620 - estebank:assoc-type-span, r=Centril
Mazdak Farrokhzad [Mon, 19 Aug 2019 20:48:55 +0000 (22:48 +0200)]
Rollup merge of #63620 - estebank:assoc-type-span, r=Centril

Use constraint span when lowering associated types

Fix #63594.

r? @Centril

4 years agoRollup merge of #63376 - nikomatsakis:async-await-issue-62517, r=cramertj
Mazdak Farrokhzad [Mon, 19 Aug 2019 20:48:54 +0000 (22:48 +0200)]
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

4 years agoRollup merge of #63252 - nrc:arc-doc, r=alexcrichton
Mazdak Farrokhzad [Mon, 19 Aug 2019 20:48:52 +0000 (22:48 +0200)]
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 )

4 years agoreview comments
Esteban Küber [Mon, 19 Aug 2019 19:24:06 +0000 (12:24 -0700)]
review comments

4 years agoglue tokens when building token stream
Aleksey Kladov [Mon, 19 Aug 2019 16:30:44 +0000 (19:30 +0300)]
glue tokens when building token stream

4 years agoremove composite tokens support from the lexer
Aleksey Kladov [Mon, 19 Aug 2019 16:00:24 +0000 (19:00 +0300)]
remove composite tokens support from the lexer

4 years agoUse constraint span when lowering associated types
Esteban Küber [Thu, 15 Aug 2019 23:40:12 +0000 (16:40 -0700)]
Use constraint span when lowering associated types

4 years agoadjust test to be check-pass
Niko Matsakis [Mon, 19 Aug 2019 17:53:06 +0000 (13:53 -0400)]
adjust test to be check-pass

4 years agouse static as object-lifetime default for type XX in `Foo<Item=XX>`
Niko Matsakis [Mon, 12 Aug 2019 14:41:05 +0000 (10:41 -0400)]
use static as object-lifetime default for type XX in `Foo<Item=XX>`

Currently the default is "inherited" from context, so e.g.  `&impl
Foo<Item = dyn Bar>` would default to `&'x impl Foo<Item = dyn Bar +
'x>`, but this triggers an ICE and is not very consistent.

This patch doesn't implement what I expect would be the correct
semantics, because those are likely too complex. Instead, it handles
what I'd expect to be the common case -- where the trait has no
lifetime parameters.

4 years agodistinguish object-lifetime-default elision from other elision
Niko Matsakis [Thu, 8 Aug 2019 07:36:24 +0000 (03:36 -0400)]
distinguish object-lifetime-default elision from other elision

Object-lifetime-default elision is distinct from other forms of
elision; it always refers to some enclosing lifetime *present in the
surrounding type* (e.g., `&dyn Bar` expands to `&'a (dyn Bar + 'a)`.
If there is no enclosing lifetime, then it expands to `'static`.

Therefore, in an `impl Trait<Item = dyn Bar>` setting, we don't expand
to create a lifetime parameter for the `dyn Bar + 'X` bound.  It will
just be resolved to `'static`.

Annoyingly, the responsibility for this resolution is spread across
multiple bits of code right now (`middle::resolve_lifetimes`,
`lowering`). The lowering code knows that the default is for an object
lifetime, but it doesn't know what the correct result would be.
Probably this should be fixed, but what we do now is a surgical fix:
we have it generate a different result for elided lifetimes in a
object context, and then we can ignore those results when figuring out
the lifetimes that are captured in the opaque type.

4 years agoadd debug logs
Niko Matsakis [Thu, 8 Aug 2019 07:49:45 +0000 (03:49 -0400)]
add debug logs

4 years agoAuto merge of #63579 - alexcrichton:new-lockfile, r=Mark-Simulacrum
bors [Mon, 19 Aug 2019 17:04:10 +0000 (17:04 +0000)]
Auto merge of #63579 - alexcrichton:new-lockfile, r=Mark-Simulacrum

Use to Cargo's experimental lockfile format

This commit changes the lock file format of this repository to an
experimental format that isn't rolled out by default in Cargo but is
intended to eventually become the default. The new format moves
information around and compresses the lock file a bit. The intention of
the new format is to reduce the amount of git merge conflicts that
happen in a repository, with rust-lang/rust being a prime candidate for
testing this.

The new format wille ventually become the default but for now it is
off-by-default in Cargo, but Cargo will preserve the format if it sees
it. Since we always build with a beta version of Cargo for the
rust-lang/rust repository it should be safe to go ahead and change the
lock file format here and everyone building this repository will
automatically pick it up.

It's intended that we'll evaluate this lock file format in the
rust-lang/rust repository to see if it reduces the number of perceived
merge conflicts for changes that touch the lock file. This will in turn
help inform the development of the feature in Cargo and whether we
choose to stabilize this and turn it on by default.

Note that this commit does not actually change the contents of the lock
file in terms of a resolution graph, it simply reencodes the lock file
with a new format.

4 years agoUse to Cargo's experimental lockfile format
Alex Crichton [Thu, 15 Aug 2019 00:45:09 +0000 (17:45 -0700)]
Use to Cargo's experimental lockfile format

This commit changes the lock file format of this repository to an
experimental format that isn't rolled out by default in Cargo but is
intended to eventually become the default. The new format moves
information around and compresses the lock file a bit. The intention of
the new format is to reduce the amount of git merge conflicts that
happen in a repository, with rust-lang/rust being a prime candidate for
testing this.

The new format wille ventually become the default but for now it is
off-by-default in Cargo, but Cargo will preserve the format if it sees
it. Since we always build with a beta version of Cargo for the
rust-lang/rust repository it should be safe to go ahead and change the
lock file format here and everyone building this repository will
automatically pick it up.

It's intended that we'll evaluate this lock file format in the
rust-lang/rust repository to see if it reduces the number of perceived
merge conflicts for changes that touch the lock file. This will in turn
help inform the development of the feature in Cargo and whether we
choose to stabilize this and turn it on by default.

Note that this commit does not actually change the contents of the lock
file in terms of a resolution graph, it simply reencodes the lock file
with a new format.

4 years agotest: add test for #61432.
Eduard-Mihai Burtescu [Mon, 19 Aug 2019 16:33:49 +0000 (19:33 +0300)]
test: add test for #61432.

4 years agoFix suggestion from move async to async move.
Giles Cope [Mon, 19 Aug 2019 12:25:06 +0000 (13:25 +0100)]
Fix suggestion from move async to async move.

4 years agotest: add test from #61041.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 16:00:47 +0000 (19:00 +0300)]
test: add test from #61041.

4 years agorustc_typeck: fix the generics for (const-generic) `N` expression in e.g. `[T; N]`.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 17:23:07 +0000 (20:23 +0300)]
rustc_typeck: fix the generics for (const-generic) `N` expression in e.g. `[T; N]`.

4 years agorustc_mir: disallow non-monomorphic reifications.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 17:23:57 +0000 (20:23 +0300)]
rustc_mir: disallow non-monomorphic reifications.

4 years agorustc_mir: disallow non-monomorphic vtables.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 15:59:45 +0000 (18:59 +0300)]
rustc_mir: disallow non-monomorphic vtables.

4 years agorustc_mir: add missing subst_from_frame_and_normalize_erasing_regions calls.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 13:33:38 +0000 (16:33 +0300)]
rustc_mir: add missing subst_from_frame_and_normalize_erasing_regions calls.

4 years agorustc_mir: use self.resolve instead of Instance::resolve where possible.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 13:33:08 +0000 (16:33 +0300)]
rustc_mir: use self.resolve instead of Instance::resolve where possible.

4 years agorustc_mir: make subst_from_frame_and_normalize_erasing_regions infallible.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 13:32:48 +0000 (16:32 +0300)]
rustc_mir: make subst_from_frame_and_normalize_erasing_regions infallible.

4 years agorustc_mir: remove wrong calls to subst_from_frame_and_normalize_erasing_regions.
Eduard-Mihai Burtescu [Mon, 12 Aug 2019 13:31:55 +0000 (16:31 +0300)]
rustc_mir: remove wrong calls to subst_from_frame_and_normalize_erasing_regions.

4 years agostart cleaning up subst mess
Ralf Jung [Sun, 11 Aug 2019 08:12:26 +0000 (10:12 +0200)]
start cleaning up subst mess

fix an ICE

fix method name