Commit Graph

98126 Commits

Author SHA1 Message Date
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
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
Esteban Küber
1808e4da68 review comments 2019-08-19 12:24:06 -07:00
Aleksey Kladov
914e1f4564 glue tokens when building token stream 2019-08-19 21:59:33 +03:00
Aleksey Kladov
8b932dfda7 remove composite tokens support from the lexer 2019-08-19 21:59:09 +03:00
Esteban Küber
94ee54c425 Use constraint span when lowering associated types 2019-08-19 11:50:34 -07:00
Niko Matsakis
7ee1af51cc adjust test to be check-pass 2019-08-19 13:53:06 -04:00
Niko Matsakis
832199ee76 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.
2019-08-19 13:50:44 -04:00
Niko Matsakis
af86fb1959 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.
2019-08-19 13:50:42 -04:00
Niko Matsakis
b51df1def0 add debug logs 2019-08-19 13:48:45 -04:00
bors
29a54035c7 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.
2019-08-19 17:04:10 +00:00
Alex Crichton
093ede240a 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.
2019-08-19 09:56:22 -07:00
Eduard-Mihai Burtescu
96fc98904f test: add test for #61432. 2019-08-19 19:33:49 +03:00
Giles Cope
ef3e66d69f Fix suggestion from move async to async move. 2019-08-19 17:14:38 +01:00
Eduard-Mihai Burtescu
cb6650047b test: add test from #61041. 2019-08-19 18:57:09 +03:00
Eduard-Mihai Burtescu
f4aa00b71d rustc_typeck: fix the generics for (const-generic) N expression in e.g. [T; N]. 2019-08-19 18:57:09 +03:00
Eduard-Mihai Burtescu
7d9af83ffc rustc_mir: disallow non-monomorphic reifications. 2019-08-19 18:57:09 +03:00
Eduard-Mihai Burtescu
ceabe0dc54 rustc_mir: disallow non-monomorphic vtables. 2019-08-19 18:57:09 +03:00
Eduard-Mihai Burtescu
4149964ae4 rustc_mir: add missing subst_from_frame_and_normalize_erasing_regions calls. 2019-08-19 18:57:09 +03:00
Eduard-Mihai Burtescu
0919f7c3a3 rustc_mir: use self.resolve instead of Instance::resolve where possible. 2019-08-19 18:57:08 +03:00
Eduard-Mihai Burtescu
ada6f1cd3d rustc_mir: make subst_from_frame_and_normalize_erasing_regions infallible. 2019-08-19 18:57:01 +03:00
Eduard-Mihai Burtescu
b4f217ed7b rustc_mir: remove wrong calls to subst_from_frame_and_normalize_erasing_regions. 2019-08-19 18:55:19 +03:00
Ralf Jung
d4196a7673 start cleaning up subst mess
fix an ICE

fix method name
2019-08-19 18:55:18 +03:00
Baoshan
7ab6fa0914
Merge pull request #3 from Wind-River/vxworks-salim
Fixed: error: unnecessary trailing semicolon
2019-08-19 08:45:43 -07:00
bors
f86521e0a3 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
2019-08-19 13:17:34 +00:00
Alex Crichton
1301b100ca 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
2019-08-19 06:13:18 -07:00
Shotaro Yamada
1fe6160c7e Fix ICE with impl Trait in type bounds 2019-08-19 17:49:54 +09:00
Shotaro Yamada
3620456faf Use BTreeMap for deterministic iter order 2019-08-19 17:49:54 +09:00
Shotaro Yamada
cc6dbb4f23 Fix tidy 2019-08-19 17:49:54 +09:00