]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge pull request #11 from Wind-River/cleanup-2
Baoshan [Fri, 30 Aug 2019 20:55:54 +0000 (13:55 -0700)]
Merge pull request #11 from Wind-River/cleanup-2

remove directory libstd/sys/vxworks/backtrace which is not used any more

4 years agoremove directory libstd/sys/vxworks/backtrace which is not used any more
Baoshan Pang [Fri, 30 Aug 2019 20:44:38 +0000 (13:44 -0700)]
remove directory libstd/sys/vxworks/backtrace which is not used any more

4 years agoMerge pull request #9 from Wind-River/V7LIBC-948
Baoshan [Tue, 27 Aug 2019 22:06:16 +0000 (15:06 -0700)]
Merge pull request #9 from Wind-River/V7LIBC-948

remove the reference to __cxa_thread_atexit_impl

4 years agoremove the reference to __cxa_thread_atexit_impl
Baoshan Pang [Tue, 27 Aug 2019 17:13:59 +0000 (10:13 -0700)]
remove the reference to __cxa_thread_atexit_impl

4 years agoMerge pull request #8 from Wind-River/set_name_003
Baoshan [Fri, 23 Aug 2019 21:50:01 +0000 (14:50 -0700)]
Merge pull request #8 from Wind-River/set_name_003

VxWorks does not provide a way to set the task name except at creation time

4 years agoVxWorks does not provide a way to set the task name except at creation time
Baoshan Pang [Fri, 23 Aug 2019 20:25:01 +0000 (13:25 -0700)]
VxWorks does not provide a way to set the task name except at creation time

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 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 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

4 years agoMerge pull request #3 from Wind-River/vxworks-salim
Baoshan [Mon, 19 Aug 2019 15:45:43 +0000 (08:45 -0700)]
Merge pull request #3 from Wind-River/vxworks-salim

Fixed: error: unnecessary trailing semicolon

4 years agoAuto merge of #63700 - alexcrichton:update-backtrace, r=sfackler
bors [Mon, 19 Aug 2019 13:17:34 +0000 (13:17 +0000)]
Auto merge of #63700 - alexcrichton:update-backtrace, r=sfackler

std: Update `backtrace` crate dependency

This commit updates the `backtrace` crate from 0.3.34 to 0.3.35. The
[included set of changes][changes] for this update mostly includes some
gimli-related improvements (not relevant for the standard library) but
critically includes a fix for rust-lang/backtrace-rs#230. The standard
library will not aqcuire a session-local lock whenever a backtrace is
generated on Windows to allow external synchronization with the
`backtrace` crate itself, allowing `backtrace` to be safely used while
other threads may be panicking.

[changes]: https://github.com/rust-lang/backtrace-rs/compare/0.3.34...0.3.35

4 years agostd: Update `backtrace` crate dependency
Alex Crichton [Mon, 19 Aug 2019 13:13:18 +0000 (06:13 -0700)]
std: Update `backtrace` crate dependency

This commit updates the `backtrace` crate from 0.3.34 to 0.3.35. The
[included set of changes][changes] for this update mostly includes some
gimli-related improvements (not relevant for the standard library) but
critically includes a fix for rust-lang/backtrace-rs#230. The standard
library will not aqcuire a session-local lock whenever a backtrace is
generated on Windows to allow external synchronization with the
`backtrace` crate itself, allowing `backtrace` to be safely used while
other threads may be panicking.

[changes]: https://github.com/rust-lang/backtrace-rs/compare/0.3.34...0.3.35

4 years agoAuto merge of #63670 - Dante-Broggi:patch-2, r=Centril
bors [Mon, 19 Aug 2019 05:12:58 +0000 (05:12 +0000)]
Auto merge of #63670 - Dante-Broggi:patch-2, r=Centril

Size has a ::zero

4 years agoAuto merge of #63463 - matthewjasper:ty_param_cleanup, r=petrochenkov
bors [Mon, 19 Aug 2019 01:31:35 +0000 (01:31 +0000)]
Auto merge of #63463 - matthewjasper:ty_param_cleanup, r=petrochenkov

Don't special case the `Self` parameter by name

This results in a couple of small diagnostic regressions. They could be avoided by keeping the special case just for diagnostics, but that seems worse.

closes #50125
cc #60869

4 years agoAuto merge of #63045 - Rosto75:master, r=jonas-schievink
bors [Sun, 18 Aug 2019 22:01:21 +0000 (22:01 +0000)]
Auto merge of #63045 - Rosto75:master, r=jonas-schievink

Change the placement of two functions.

Right now, the order is as follows:
`pop_front()`
`push_front()`
`push_back()`
`pop_back()`

`swap_remove_back()`
`swap_remove_front()`

I believe it would be more natural, and easier to follow, if we place `pop_back()` right after the `pop_front()`, and `swap_remove_back()` after the `swap_remove_front()` like this:
`pop_front()`
`pop_back()`
`push_front()`
`push_back()`

`swap_remove_front()`
`swap_remove_back()`

The rest of the documentation (at least in this module) adheres to the same logic, where the 'front' function always precedes its 'back' equivalent.

4 years agoFix bug in iter::Chain::size_hint
Tim Vermeulen [Sun, 18 Aug 2019 19:47:23 +0000 (21:47 +0200)]
Fix bug in iter::Chain::size_hint

4 years agoPre intern the `Self` parameter type
Matthew Jasper [Mon, 12 Aug 2019 21:15:12 +0000 (22:15 +0100)]
Pre intern the `Self` parameter type

Use this to simplify the object safety code a bit.

4 years agoAuto merge of #63659 - gilescope:async-in-closure, r=Centril
bors [Sun, 18 Aug 2019 18:23:28 +0000 (18:23 +0000)]
Auto merge of #63659 - gilescope:async-in-closure, r=Centril

Improved error message for break in async block

Fixes #63391

4 years agoAuto merge of #63635 - oli-obk:default-slice-dangles, r=eddyb
bors [Sun, 18 Aug 2019 13:22:38 +0000 (13:22 +0000)]
Auto merge of #63635 - oli-obk:default-slice-dangles, r=eddyb

Do not generate allocations for zero sized allocations

Alternative to https://github.com/rust-lang/rust/issues/62487

r? @eddyb

There are other places where we could do this, too, but that would cause `static FOO: () = ();` to not have a unique address

4 years agoBetter error message for break in async blocks.
Giles Cope [Sat, 17 Aug 2019 11:17:02 +0000 (12:17 +0100)]
Better error message for break in async blocks.

4 years agoAuto merge of #63269 - Aaron1011:feature/proc-macro-data, r=eddyb,petrochenkov
bors [Sun, 18 Aug 2019 08:15:38 +0000 (08:15 +0000)]
Auto merge of #63269 - Aaron1011:feature/proc-macro-data, r=eddyb,petrochenkov

Serialize additional data for procedural macros

Split off from #62855

This PR serializes the declaration `Span` and attributes for all
procedural macros. This allows Rustdoc to properly render doc comments
and source links when performing inlinig procedural macros across crates

4 years agoAuto merge of #62948 - matklad:failable-file-loading, r=petrochenkov
bors [Sun, 18 Aug 2019 04:37:01 +0000 (04:37 +0000)]
Auto merge of #62948 - matklad:failable-file-loading, r=petrochenkov

Normalize newlines when loading files

Fixes #62865

4 years agoFixed: error: unnecessary trailing semicolon
Salim Nasser [Sun, 18 Aug 2019 01:56:38 +0000 (18:56 -0700)]
Fixed: error: unnecessary trailing semicolon

4 years agoAuto merge of #61708 - dlrobertson:or-patterns-0, r=centril
bors [Sun, 18 Aug 2019 01:02:20 +0000 (01:02 +0000)]
Auto merge of #61708 - dlrobertson:or-patterns-0, r=centril

Initial implementation of or-patterns

An incomplete implementation of or-patterns (e.g. `Some(0 | 1)` as a pattern). This patch set aims to implement initial parsing of `or-patterns`.

Related to: #54883

CC @alexreg @varkor
r? @Centril

4 years agoAuto merge of #63671 - Centril:rollup-zufavt5, r=Centril
bors [Sat, 17 Aug 2019 21:30:10 +0000 (21:30 +0000)]
Auto merge of #63671 - Centril:rollup-zufavt5, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #62451 (Add APIs for uninitialized Box, Rc, and Arc. (Plus get_mut_unchecked))
 - #63487 (Remove meaningless comments in src/test)
 - #63657 (Crank up invalid value lint)
 - #63667 (resolve: Properly integrate derives and `macro_rules` scopes)
 - #63669 (fix typos in mir/interpret)

Failed merges:

r? @ghost

4 years agoRollup merge of #63669 - Dante-Broggi:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sat, 17 Aug 2019 20:57:35 +0000 (22:57 +0200)]
Rollup merge of #63669 - Dante-Broggi:patch-1, r=jonas-schievink

fix typos in mir/interpret

4 years agoRollup merge of #63667 - petrochenkov:deriveholders, r=matthewjasper
Mazdak Farrokhzad [Sat, 17 Aug 2019 20:57:34 +0000 (22:57 +0200)]
Rollup merge of #63667 - petrochenkov:deriveholders, r=matthewjasper

resolve: Properly integrate derives and `macro_rules` scopes

So,
```rust
#[derive(A, B)]
struct S;

m!();
```
turns into something like
```rust
struct S;

A_placeholder!( struct S; );

B_placeholder!( struct S; );

m!();
```
during expansion.

And for `m!()` its "`macro_rules` scope" (aka "legacy scope") should point to the `B_placeholder` call rather than to the derive container `#[derive(A, B)]`.

`fn build_reduced_graph` now makes sure the legacy scope points to the right thing.
(It's still a mystery for me why this worked before https://github.com/rust-lang/rust/pull/63535.)

Unfortunately, placeholders from derives are currently treated separately from placeholders from other macros and need to be passed as `extra_placeholders` rather than a part of the AST fragment.
That's fixable, but I wanted to keep this PR more minimal to close the regression faster.

Fixes https://github.com/rust-lang/rust/issues/63651
r? @matthewjasper

4 years agoRollup merge of #63657 - RalfJung:invalid_value, r=Centril
Mazdak Farrokhzad [Sat, 17 Aug 2019 20:57:32 +0000 (22:57 +0200)]
Rollup merge of #63657 - RalfJung:invalid_value, r=Centril

Crank up invalid value lint

* Warn against uninit `bool` and `char`.
* Warn against 0-init `NonNull` and friends
* Detect transmute-from-0 as zero-initialization ([seen in the wild](https://github.com/glium/glium/issues/1775#issuecomment-522144636))

4 years agoRollup merge of #63487 - sd234678:remove-meaningless-comments-in-src/test-2, r=Centril
Mazdak Farrokhzad [Sat, 17 Aug 2019 20:57:30 +0000 (22:57 +0200)]
Rollup merge of #63487 - sd234678:remove-meaningless-comments-in-src/test-2, r=Centril

Remove meaningless comments in src/test

Moved from #63411

4 years agoRollup merge of #62451 - SimonSapin:new_uninit, r=RalfJung
Mazdak Farrokhzad [Sat, 17 Aug 2019 20:57:29 +0000 (22:57 +0200)]
Rollup merge of #62451 - SimonSapin:new_uninit, r=RalfJung

Add APIs for uninitialized Box, Rc, and Arc. (Plus get_mut_unchecked)

Assigning `MaybeUninit::<Foo>::uninit()` to a local variable is usually free, even when `size_of::<Foo>()` is large. However, passing it for example to `Arc::new` [causes at least one copy](https://youtu.be/F1AquroPfcI?t=4116) (from the stack to the newly allocated heap memory) even though there is no meaningful data. It is theoretically possible that a Sufficiently Advanced Compiler could optimize this copy away, but this is [reportedly unlikely to happen soon in LLVM](https://youtu.be/F1AquroPfcI?t=5431).

This PR proposes two sets of features:

* Constructors for containers (`Box`, `Rc`, `Arc`) of `MaybeUninit<T>` or `[MaybeUninit<T>]` that do not initialized the data, and unsafe conversions to the known-initialized types (without `MaybeUninit`). The constructors are guaranteed not to make unnecessary copies.

* On `Rc` and `Arc`, an unsafe `get_mut_unchecked` method that provides `&mut T` access without checking the reference count. `Arc::get_mut` involves multiple atomic operations whose cost can be non-trivial. `Rc::get_mut` is less costly, but we add `Rc::get_mut_unchecked` anyway for symmetry with `Arc`.

  These can be useful independently, but they will presumably be typical when the new constructors of `Rc` and `Arc` are used.

  An alternative with a safe API would be to introduce `UniqueRc` and `UniqueArc` types that have the same memory layout as `Rc` and `Arc` (and so zero-cost conversion to them) but are guaranteed to have only one reference. But introducing entire new types feels “heavier” than new constructors on existing types, and initialization of `MaybeUninit<T>` typically requires unsafe code anyway.

Summary of new APIs (all unstable in this PR):

```rust
impl<T> Box<T> { pub fn new_uninit() -> Box<MaybeUninit<T>> {…} }
impl<T> Box<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Box<T> {…} }
impl<T> Box<[T]> { pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} }
impl<T> Box<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Box<[T]> {…} }

impl<T> Rc<T> { pub fn new_uninit() -> Rc<MaybeUninit<T>> {…} }
impl<T> Rc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Rc<T> {…} }
impl<T> Rc<[T]> { pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} }
impl<T> Rc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Rc<[T]> {…} }

impl<T> Arc<T> { pub fn new_uninit() -> Arc<MaybeUninit<T>> {…} }
impl<T> Arc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Arc<T> {…} }
impl<T> Arc<[T]> { pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} }
impl<T> Arc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Arc<[T]> {…} }

impl<T: ?Sized> Rc<T> { pub unsafe fn get_mut_unchecked(this: &mut Self) -> &mut T {…} }
impl<T: ?Sized> Arc<T> { pub unsafe fn get_mut_unchecked(this: &mut Self) -> &mut T {…} }
```

4 years agotest in a way that works even with musl
Ralf Jung [Sat, 17 Aug 2019 20:11:43 +0000 (22:11 +0200)]
test in a way that works even with musl

4 years agosize has a zero
Dante-Broggi [Sat, 17 Aug 2019 20:09:49 +0000 (16:09 -0400)]
size has a zero

4 years agoDoc nit
Simon Sapin [Sat, 17 Aug 2019 19:40:35 +0000 (21:40 +0200)]
Doc nit

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agofix typos
Dante-Broggi [Sat, 17 Aug 2019 19:33:44 +0000 (15:33 -0400)]
fix typos

4 years agoresolve/expand: Rename some things for clarity
Vadim Petrochenkov [Sat, 17 Aug 2019 17:49:00 +0000 (20:49 +0300)]
resolve/expand: Rename some things for clarity

4 years agoAuto merge of #63658 - RalfJung:miri-op, r=oli-obk
bors [Sat, 17 Aug 2019 17:53:31 +0000 (17:53 +0000)]
Auto merge of #63658 - RalfJung:miri-op, r=oli-obk

Refactor Miri ops (unary, binary) to have more types

This is the part of https://github.com/rust-lang/rust/pull/63448 that is just a refactoring. It helps that PR by making it easier to perform machine arithmetic.

r? @oli-obk @eddyb

4 years agoresolve: Properly integrate derives and `macro_rules` scopes
Vadim Petrochenkov [Sat, 17 Aug 2019 16:32:52 +0000 (19:32 +0300)]
resolve: Properly integrate derives and `macro_rules` scopes

4 years agoSerialize additional data for procedural macros
Aaron Hill [Sun, 4 Aug 2019 20:41:01 +0000 (16:41 -0400)]
Serialize additional data for procedural macros

Split off from #62855

This PR deerializes the declaration `Span` and attributes for all
procedural macros from their underlying function definitions.
This allows Rustdoc to properly render doc comments
and source links when inlining procedural macros across crates

4 years agoinitial implementation of or-pattern parsing
Dan Robertson [Sun, 14 Jul 2019 01:05:52 +0000 (01:05 +0000)]
initial implementation of or-pattern parsing

Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`.
This is a partial implementation of RFC 2535.

4 years agoInitial implementation of or patterns
varkor [Fri, 19 Oct 2018 14:40:07 +0000 (15:40 +0100)]
Initial implementation of or patterns

4 years agoRename private helper method allocate_for_unsized to allocate_for_layout
Simon Sapin [Sat, 17 Aug 2019 13:39:21 +0000 (15:39 +0200)]
Rename private helper method allocate_for_unsized to allocate_for_layout

4 years agoless &
Ralf Jung [Sat, 17 Aug 2019 14:48:08 +0000 (16:48 +0200)]
less &

4 years agoDoc nits
Simon Sapin [Sat, 17 Aug 2019 13:15:17 +0000 (15:15 +0200)]
Doc nits

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoAuto merge of #63462 - matthewjasper:hygienic-builtin-derives, r=petrochenkov
bors [Sat, 17 Aug 2019 12:53:53 +0000 (12:53 +0000)]
Auto merge of #63462 - matthewjasper:hygienic-builtin-derives, r=petrochenkov

Opaque builtin derive macros

* Buiilt-in derives are now opaque macros
    * This required limiting the visibility of some previously unexposed functions in `core`.
    * This also required the change to `Ident` serialization.
* All gensyms are replaced with hygienic identifiers
* Use hygiene to avoid most other name-resolution issues with buiilt-in derives.
    *  As far as I know the only remaining case that breaks is an ADT that has the same name as one of its parameters. Fixing this completely seemed to be more effort than it's worth.
* Remove gensym in `Ident::decode`, which lead to linker errors due to `inline` being gensymmed.
    * `Ident`now panics if incremental compilation tries to serialize it (it currently doesn't).
    * `Ident` no longer uses `gensym` to emulate cross-crate hygiene. It only applied to reexports.
    * `SyntaxContext` is no longer serializable.
    * The long-term fix for this is to properly implement cross-crate hygiene, but this seemed to be acceptable for now.
* Move type/const parameter shadowing checks to `resolve`
    * This was previously split between resolve and type checking. The type checking pass compared `InternedString`s, not Identifiers.
* Removed the `SyntaxContext` from `{ast, hir}::{InlineAsm, GlobalAsm}`

cc #60869
r? @petrochenkov

4 years agodrift leftward
Ralf Jung [Sat, 17 Aug 2019 11:49:27 +0000 (13:49 +0200)]
drift leftward