Rollup merge of #63796 - estebank:opaque_future, r=Centril
Tweak E0308 on opaque types
```
error[E0308]: if and else have incompatible types
--> file.rs:21:9
|
18 | / if true {
19 | | thing_one()
| | ----------- expected because of this
20 | | } else {
21 | | thing_two()
| | ^^^^^^^^^^^ expected opaque type, found a different opaque type
22 | | }.await
| |_____- if and else have incompatible types
|
= note: expected type `impl std::future::Future` (opaque type)
found type `impl std::future::Future` (opaque type)
= note: distinct uses of `impl Trait` result in different opaque types
= help: if both futures resolve to the same type, consider `await`ing on both of them
```
Rollup merge of #63782 - GuillaumeGomez:theme-switch-fix, r=kinnison
Fix confusion in theme picker functions
To reproduce the bug currently: click on the theme picker button twice (to show it then hide it). Then click anywhere else: the dropdown menu appears again.
The problem was coming from a confusion of what the `hideThemeButtonState` and `showThemeButtonState` were supposed to do. I switched their codes and updated the `switchThemeButtonState` function. It now works as expected.
bors [Thu, 22 Aug 2019 06:14:49 +0000 (06:14 +0000)]
Auto merge of #63175 - jsgf:argsfile, r=jsgf
rustc: implement argsfiles for command line
Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line. This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`.
See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters.
This is useful for very large command lines, or when command lines are being generated into files by other tooling.
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.
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
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.
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)
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`
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).
This will make @path work with miri and other non-standard entrypoints.
Also since this simplifies librustc_driver::args, move it into a simple source file. Also
remove the tests since they're doing nothing more than checking `str::lines` has the right
behaviour.
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`.
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).
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`.
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.
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.