]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoBless tests
Fabian Drinck [Sat, 16 Mar 2019 17:08:51 +0000 (18:08 +0100)]
Bless tests

5 years agoImprove warning
Fabian Drinck [Sat, 16 Mar 2019 16:38:12 +0000 (17:38 +0100)]
Improve warning

5 years agoEdit comments
Fabian Drinck [Sat, 16 Mar 2019 15:49:13 +0000 (16:49 +0100)]
Edit comments

5 years agoRemove redundant imports
Fabian Drinck [Sun, 10 Mar 2019 11:52:30 +0000 (12:52 +0100)]
Remove redundant imports

5 years agoAdd lint for redundant imports
Fabian Drinck [Fri, 22 Feb 2019 14:07:18 +0000 (15:07 +0100)]
Add lint for redundant imports

Co-authored-by: Stephan Schauerte <stephan.schauerte@gmail.com>
5 years agoAdd book.toml with title to unstable-book doc
Bastian Gruber [Sat, 30 Mar 2019 18:46:43 +0000 (19:46 +0100)]
Add book.toml with title to unstable-book doc

5 years agoDon't ignore git for LLVM info
Josh Stone [Sat, 30 Mar 2019 18:14:02 +0000 (11:14 -0700)]
Don't ignore git for LLVM info

5 years agoUse a single llvm_info variable
Josh Stone [Sat, 30 Mar 2019 18:11:32 +0000 (11:11 -0700)]
Use a single llvm_info variable

5 years agoAuto merge of #59516 - ehuss:update-cargo, r=alexcrichton
bors [Sat, 30 Mar 2019 17:22:21 +0000 (17:22 +0000)]
Auto merge of #59516 - ehuss:update-cargo, r=alexcrichton

Update cargo

Update cargo

22 commits in 0e35bd8af0ec72d3225c4819b330b94628f0e9d0..63231f438a2b5b84ccf319a5de22343ee0316323
2019-03-13 06:52:51 +0000 to 2019-03-27 12:26:45 +0000
- Code cleanup (rust-lang/cargo#6787)
- Add cargo:rustc-link-arg to pass custom linker arguments (rust-lang/cargo#6298)
- Testsuite: remove some unnecessary is_nightly checks. (rust-lang/cargo#6786)
- cargo metadata: Don't show `null` deps. (rust-lang/cargo#6534)
- Some fingerprint cleanup. (rust-lang/cargo#6785)
- Fix fingerprint for canceled build script. (rust-lang/cargo#6782)
- Canonicalize default target if it ends with `.json` (rust-lang/cargo#6778)
- Fix setting `panic=unwind` compiling lib a extra time. (rust-lang/cargo#6781)
- Always nicely show errors from crates.io if possible (rust-lang/cargo#6771)
- Testsuite: Make `cwd()` relative to project root. (rust-lang/cargo#6768)
- Allow `cargo fix` if gitignore matches root working dir. (rust-lang/cargo#6767)
- Remove redundant imports (rust-lang/cargo#6763)
- Handle backcompat hazard with `toml` crate (rust-lang/cargo#6761)
- Fix spurious error in dirty_both_lib_and_test. (rust-lang/cargo#6756)
- Update toml requirement from 0.4.2 to 0.5.0 (rust-lang/cargo#6760)
- Reuse std::env::consts::EXE_SUFFIX (rust-lang/cargo#6758)
- Proptest 0.9.1 (rust-lang/cargo#6753)
- Don't need extern crate in 2018 (rust-lang/cargo#6752)
- Release a jobserver token while locking a file (rust-lang/cargo#6748)
- Minor doc fix for publish command synopsis (rust-lang/cargo#6749)
- Stricter package change detection. (rust-lang/cargo#6740)
- Fix resolving yanked crates when using a local registry. (rust-lang/cargo#6742)

5 years agoUse the existing LLVM GitInfo for checking rebuilds
Josh Stone [Sat, 30 Mar 2019 16:45:26 +0000 (09:45 -0700)]
Use the existing LLVM GitInfo for checking rebuilds

5 years agoUpdate cargo
Eric Huss [Fri, 29 Mar 2019 03:13:13 +0000 (20:13 -0700)]
Update cargo

5 years agoAuto merge of #59561 - Centril:rollup, r=Centril
bors [Sat, 30 Mar 2019 14:12:12 +0000 (14:12 +0000)]
Auto merge of #59561 - Centril:rollup, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #59343 (rustc(codegen): uncache `def_symbol_name` prefix from `symbol_name`.)
 - #59380 (Fix invalid DWARF for enums when using ThinLTO)
 - #59463 (skip dyn keyword lint under macros)
 - #59539 (Fix infinite recursion)
 - #59544 (manifest: only include miri on the nightly channel)

Failed merges:

r? @ghost

5 years agoAdded a missing !.
Christian [Sat, 30 Mar 2019 13:35:51 +0000 (14:35 +0100)]
Added a missing !.

5 years agoAdded an example that shows how the remainder function on floating point values is...
Christian [Sat, 30 Mar 2019 13:26:54 +0000 (14:26 +0100)]
Added an example that shows how the remainder function on floating point values is computed internally.

5 years agoRollup merge of #59544 - cuviper:miri-nightly, r=Centril
Mazdak Farrokhzad [Sat, 30 Mar 2019 13:14:58 +0000 (14:14 +0100)]
Rollup merge of #59544 - cuviper:miri-nightly, r=Centril

manifest: only include miri on the nightly channel

miri needs to build std with xargo, which doesn't allow stable/beta:
<https://github.com/japaric/xargo/pull/204#issuecomment-374888868>

Therefore, at this time there's no point in making miri available on any
but the nightly channel.  If we get a stable way to build `std`, like
[RFC 2663], then we can re-evaluate whether to start including miri,
perhaps still as `miri-preview`.

[RFC 2663]: https://github.com/rust-lang/rfcs/pull/2663

5 years agoRollup merge of #59539 - GuillaumeGomez:rustdoc-infinite-recursion, r=eddyb
Mazdak Farrokhzad [Sat, 30 Mar 2019 13:14:56 +0000 (14:14 +0100)]
Rollup merge of #59539 - GuillaumeGomez:rustdoc-infinite-recursion, r=eddyb

Fix infinite recursion

Temporary fix for #59502.

r? @eddyb

5 years agoRollup merge of #59463 - pnkfelix:issue-56327-skip-dyn-keyword-lint-under-macros...
Mazdak Farrokhzad [Sat, 30 Mar 2019 13:14:55 +0000 (14:14 +0100)]
Rollup merge of #59463 - pnkfelix:issue-56327-skip-dyn-keyword-lint-under-macros, r=matthewjasper

skip dyn keyword lint under macros

This PR is following my own intuition that `rustfix` should never inject bugs into working code (even if that comes at the expense of it failing to fix things that will become bugs).

Fix #56327

5 years agoRollup merge of #59380 - philipc:thinlto-variant, r=michaelwoerister
Mazdak Farrokhzad [Sat, 30 Mar 2019 13:14:53 +0000 (14:14 +0100)]
Rollup merge of #59380 - philipc:thinlto-variant, r=michaelwoerister

Fix invalid DWARF for enums when using ThinLTO

We were setting the same identifier for both the DW_TAG_structure_type
and the DW_TAG_variant_part. This becomes a problem when using ThinLTO
becauses it uses the identifier as a key for a map of types that is used
to delete duplicates based on the ODR, so one of them is deleted as a
duplicate, resulting in invalid DWARF.

The DW_TAG_variant_part isn't a standalone type, so it doesn't need
an identifier. Fix by omitting its identifier.

ODR uniquing is [enabled here](https://github.com/rust-lang/rust/blob/f21dee2c6179276321a88a63300dce74ff707e92/src/rustllvm/PassWrapper.cpp#L1101).

5 years agoRollup merge of #59343 - eddyb:rm-def-symbol-name, r=michaelwoerister
Mazdak Farrokhzad [Sat, 30 Mar 2019 13:14:52 +0000 (14:14 +0100)]
Rollup merge of #59343 - eddyb:rm-def-symbol-name, r=michaelwoerister

rustc(codegen): uncache `def_symbol_name` prefix from `symbol_name`.

The `def_symbol_name` query was an optimization to avoid recomputing the common part of a symbol name, as only the hash needs to be added to it for each symbol.

However, #57967 will add a new mangling scheme, which doesn't readily support this kind of reuse - while it's plausible, it requires a lot more effort, since you'd have to "symbolically evaluate" mangling, and keep it in a form where the backreference positions can be computed correctly in the final step.

So I want to see how much time we're actually saving with this `def_symbol_name` optimization, nowadays.

cc @michaelwoerister

5 years agoUse CString
Yuki OKUSHI [Sat, 30 Mar 2019 12:37:02 +0000 (21:37 +0900)]
Use CString

5 years agoFix infinite recursion
Guillaume Gomez [Fri, 29 Mar 2019 22:57:03 +0000 (23:57 +0100)]
Fix infinite recursion

5 years agoUse target_mcount
Yuki OKUSHI [Sat, 30 Mar 2019 09:50:34 +0000 (18:50 +0900)]
Use target_mcount

5 years agoAdd target_mcount option
Yuki OKUSHI [Sat, 30 Mar 2019 09:50:19 +0000 (18:50 +0900)]
Add target_mcount option

5 years agoAuto merge of #59550 - Centril:rollup, r=Centril
bors [Sat, 30 Mar 2019 08:32:13 +0000 (08:32 +0000)]
Auto merge of #59550 - Centril:rollup, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #59376 (RFC 2008: Enum Variants)
 - #59453 (Recover from parse error in tuple syntax)
 - #59455 (Account for short-hand field syntax when suggesting borrow)
 - #59499 (Fix broken download link in the armhf-gnu image)
 - #59512 (implement `AsRawFd` for stdio locks)
 - #59525 (Whitelist some rustc attrs)
 - #59528 (Improve the dbg! macro docs )
 - #59532 (In doc examples, don't ignore read/write results)
 - #59534 (rustdoc: collapse blanket impls in the same way as normal impls)
 - #59537 (Fix OnceWith docstring.)

Failed merges:

r? @ghost

5 years agoRollup merge of #59537 - goffrie:patch-3, r=Centril
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:47 +0000 (07:51 +0100)]
Rollup merge of #59537 - goffrie:patch-3, r=Centril

Fix OnceWith docstring.

This was incorrectly copypasta'd from RepeatWith.

5 years agoRollup merge of #59534 - laurmaedje:collapse-blanket-impls, r=GuillaumeGomez
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:45 +0000 (07:51 +0100)]
Rollup merge of #59534 - laurmaedje:collapse-blanket-impls, r=GuillaumeGomez

rustdoc: collapse blanket impls in the same way as normal impls

If the rustdoc setting _Auto-hide trait implementations documentation_ is activated (on by default), normal trait implementations are collapsed by default.

Blanket impls on the other hand are not collapsed. I'm not sure whether this is intended, but considering that the blanket impls for `From`, `Into`, `TryFrom`, ... are on every type, it would reduce the documentation bloat if these would also be collapsed when the setting is active.

(I'm not really familiar with the codebase and therefore just copied the code for the normal impl collapsing, but I could deduplicate it into a method, of course, too.)

5 years agoRollup merge of #59532 - mbrubeck:docs, r=Centril
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:44 +0000 (07:51 +0100)]
Rollup merge of #59532 - mbrubeck:docs, r=Centril

In doc examples, don't ignore read/write results

Calling `Read::read` or `Write::write` without checking the returned `usize` value is almost always an error.  Example code in the documentation should demonstrate how to use the return value correctly.  Otherwise, people might copy the example code thinking that it is okay to "fire and forget" these methods.

5 years agoRollup merge of #59528 - DevQps:improve-dbg-macro-docs, r=Centril
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:43 +0000 (07:51 +0100)]
Rollup merge of #59528 - DevQps:improve-dbg-macro-docs, r=Centril

Improve the dbg! macro docs

# Description

As stated has been discussed in #58383 the docs do not clearly state why it is useful to have the option to use `dbg!` in release builds as well. This PR should change that.

closes #58383

5 years agoRollup merge of #59525 - pnkfelix:whitelist-some-rustc-attrs, r=petrochenkov
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:41 +0000 (07:51 +0100)]
Rollup merge of #59525 - pnkfelix:whitelist-some-rustc-attrs, r=petrochenkov

Whitelist some rustc attrs

These rustc attrs are used within libcore, and were causing failures when one mixed incremental compilation with bootstrapping (due to a default of `-D warnings` when bootstrapping).

Fix #59523
Fix #59524

Cc #58633

5 years agoRollup merge of #59512 - euclio:stdio-locks, r=sfackler
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:40 +0000 (07:51 +0100)]
Rollup merge of #59512 - euclio:stdio-locks, r=sfackler

implement `AsRawFd` for stdio locks

cc https://github.com/rust-lang/rfcs/issues/2074.

5 years agoRollup merge of #59499 - pietroalbini:fix-arm-broken-link, r=alexcrichton
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:38 +0000 (07:51 +0100)]
Rollup merge of #59499 - pietroalbini:fix-arm-broken-link, r=alexcrichton

Fix broken download link in the armhf-gnu image

Thanks to @johnterickson for pointing this out!

r? @alexcrichton

5 years agoRollup merge of #59455 - estebank:borrow-sugg-shorthand-field, r=davidtwco
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:37 +0000 (07:51 +0100)]
Rollup merge of #59455 - estebank:borrow-sugg-shorthand-field, r=davidtwco

Account for short-hand field syntax when suggesting borrow

Fix #52965.

5 years agoRollup merge of #59453 - estebank:recover-tuple-parse, r=petrochenkov
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:36 +0000 (07:51 +0100)]
Rollup merge of #59453 - estebank:recover-tuple-parse, r=petrochenkov

Recover from parse error in tuple syntax

5 years agoRollup merge of #59376 - davidtwco:finally-rfc-2008-variants, r=petrochenkov,QuietMis...
Mazdak Farrokhzad [Sat, 30 Mar 2019 06:51:34 +0000 (07:51 +0100)]
Rollup merge of #59376 - davidtwco:finally-rfc-2008-variants, r=petrochenkov,QuietMisdreavus

RFC 2008: Enum Variants

Part of #44109. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion.

r? @petrochenkov
cc @nikomatsakis

5 years agoAuto merge of #59464 - alexcrichton:wasi-pr, r=fitzgen
bors [Sat, 30 Mar 2019 02:34:13 +0000 (02:34 +0000)]
Auto merge of #59464 - alexcrichton:wasi-pr, r=fitzgen

Add a new wasm32-unknown-wasi target

This commit adds a new wasm32-based target distributed through rustup,
supported in the standard library, and implemented in the compiler. The
`wasm32-unknown-wasi` target is intended to be a WebAssembly target
which matches the [WASI proposal recently announced][LINK]. In summary
the WASI target is an effort to define a standard set of syscalls for
WebAssembly modules, allowing WebAssembly modules to not only be
portable across architectures but also be portable across environments
implementing this standard set of system calls.

The wasi target in libstd is still somewhat bare bones. This PR does not
fill out the filesystem, networking, threads, etc. Instead it only
provides the most basic of integration with the wasi syscalls, enabling
features like:

* `Instant::now` and `SystemTime::now` work
* `env::args` is hooked up
* `env::vars` will look up environment variables
* `println!` will print to standard out
* `process::{exit, abort}` should be hooked up appropriately

None of these APIs can work natively on the `wasm32-unknown-unknown`
target, but with the assumption of the WASI set of syscalls we're able
to provide implementations of these syscalls that engines can implement.
Currently the primary engine implementing wasi is [wasmtime], but more
will surely emerge!

In terms of future development of libstd, I think this is something
we'll probably want to discuss. The purpose of the WASI target is to
provide a standardized set of syscalls, but it's *also* to provide a
standard C sysroot for compiling C/C++ programs. This means it's
intended that functions like `read` and `write` are implemented for this
target with a relatively standard definition and implementation. It's
unclear, therefore, how we want to expose file descriptors and how we'll
want to implement system primitives. For example should `std::fs::File`
have a libc-based file descriptor underneath it? The raw wasi file
descriptor? We'll see! Currently these details are all intentionally
hidden and things we can change over time.

A `WasiFd` sample struct was added to the standard library as part of
this commit, but it's not currently used. It shows how all the wasi
syscalls could be ergonomically bound in Rust, and they offer a possible
implementation of primitives like `std::fs::File` if we bind wasi file
descriptors exactly.

Apart from the standard library, there's also the matter of how this
target is integrated with respect to its C standard library. The
reference sysroot, for example, provides managment of standard unix file
descriptors and also standard APIs like `open` (as opposed to the
relative `openat` inspiration for the wasi ssycalls). Currently the
standard library relies on the C sysroot symbols for operations such as
environment management, process exit, and `read`/`write` of stdio fds.
We want these operations in Rust to be interoperable with C if they're
used in the same process. Put another way, if Rust and C are linked into
the same WebAssembly binary they should work together, but that requires
that the same C standard library is used.

We also, however, want the `wasm32-unknown-wasi` target to be
usable-by-default with the Rust compiler without requiring a separate
toolchain to get downloaded and configured. With that in mind, there's
two modes of operation for the `wasm32-unknown-wasi` target:

1. By default the C standard library is statically provided inside of
   `liblibc.rlib` distributed as part of the sysroot. This means that
   you can `rustc foo.wasm --target wasm32-unknown-unknown` and you're
   good to go, a fully workable wasi binary pops out. This is
   incompatible with linking in C code, however, which may be compiled
   against a different sysroot than the Rust code was previously
   compiled against. In this mode the default of `rust-lld` is used to
   link binaries.

2. For linking with C code, the `-C target-feature=-crt-static` flag
   needs to be passed. This takes inspiration from the musl target for
   this flag, but the idea is that you're no longer using the provided
   static C runtime, but rather one will be provided externally. This
   flag is intended to also get coupled with an external `clang`
   compiler configured with its own sysroot. Therefore you'll typically
   use this flag with `-C linker=/path/to/clang-script-wrapper`. Using
   this mode the Rust code will continue to reference standard C
   symbols, but the definition will be pulled in by the linker configured.

Alright so that's all the current state of this PR. I suspect we'll
definitely want to discuss this before landing of course! This PR is
coupled with libc changes as well which I'll be posting shortly.

[LINK]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/
[wasmtime]: https://github.com/cranestation/wasmtime-wasi

5 years agomanifest: only include miri on the nightly channel
Josh Stone [Sat, 30 Mar 2019 00:59:07 +0000 (17:59 -0700)]
manifest: only include miri on the nightly channel

miri needs to build std with xargo, which doesn't allow stable/beta:
<https://github.com/japaric/xargo/pull/204#issuecomment-374888868>

Therefore, at this time there's no point in making miri available on any
but the nightly channel.  If we get a stable way to build `std`, like
[RFC 2663], then we can re-evaluate whether to start including miri,
perhaps still as `miri-preview`.

[RFC 2663]: https://github.com/rust-lang/rfcs/pull/2663

5 years agoAdd a new wasm32-unknown-wasi target
Alex Crichton [Wed, 13 Feb 2019 18:02:22 +0000 (10:02 -0800)]
Add a new wasm32-unknown-wasi target

This commit adds a new wasm32-based target distributed through rustup,
supported in the standard library, and implemented in the compiler. The
`wasm32-unknown-wasi` target is intended to be a WebAssembly target
which matches the [WASI proposal recently announced.][LINK]. In summary
the WASI target is an effort to define a standard set of syscalls for
WebAssembly modules, allowing WebAssembly modules to not only be
portable across architectures but also be portable across environments
implementing this standard set of system calls.

The wasi target in libstd is still somewhat bare bones. This PR does not
fill out the filesystem, networking, threads, etc. Instead it only
provides the most basic of integration with the wasi syscalls, enabling
features like:

* `Instant::now` and `SystemTime::now` work
* `env::args` is hooked up
* `env::vars` will look up environment variables
* `println!` will print to standard out
* `process::{exit, abort}` should be hooked up appropriately

None of these APIs can work natively on the `wasm32-unknown-unknown`
target, but with the assumption of the WASI set of syscalls we're able
to provide implementations of these syscalls that engines can implement.
Currently the primary engine implementing wasi is [wasmtime], but more
will surely emerge!

In terms of future development of libstd, I think this is something
we'll probably want to discuss. The purpose of the WASI target is to
provide a standardized set of syscalls, but it's *also* to provide a
standard C sysroot for compiling C/C++ programs. This means it's
intended that functions like `read` and `write` are implemented for this
target with a relatively standard definition and implementation. It's
unclear, therefore, how we want to expose file descriptors and how we'll
want to implement system primitives. For example should `std::fs::File`
have a libc-based file descriptor underneath it? The raw wasi file
descriptor? We'll see! Currently these details are all intentionally
hidden and things we can change over time.

A `WasiFd` sample struct was added to the standard library as part of
this commit, but it's not currently used. It shows how all the wasi
syscalls could be ergonomically bound in Rust, and they offer a possible
implementation of primitives like `std::fs::File` if we bind wasi file
descriptors exactly.

Apart from the standard library, there's also the matter of how this
target is integrated with respect to its C standard library. The
reference sysroot, for example, provides managment of standard unix file
descriptors and also standard APIs like `open` (as opposed to the
relative `openat` inspiration for the wasi ssycalls). Currently the
standard library relies on the C sysroot symbols for operations such as
environment management, process exit, and `read`/`write` of stdio fds.
We want these operations in Rust to be interoperable with C if they're
used in the same process. Put another way, if Rust and C are linked into
the same WebAssembly binary they should work together, but that requires
that the same C standard library is used.

We also, however, want the `wasm32-unknown-wasi` target to be
usable-by-default with the Rust compiler without requiring a separate
toolchain to get downloaded and configured. With that in mind, there's
two modes of operation for the `wasm32-unknown-wasi` target:

1. By default the C standard library is statically provided inside of
   `liblibc.rlib` distributed as part of the sysroot. This means that
   you can `rustc foo.wasm --target wasm32-unknown-unknown` and you're
   good to go, a fully workable wasi binary pops out. This is
   incompatible with linking in C code, however, which may be compiled
   against a different sysroot than the Rust code was previously
   compiled against. In this mode the default of `rust-lld` is used to
   link binaries.

2. For linking with C code, the `-C target-feature=-crt-static` flag
   needs to be passed. This takes inspiration from the musl target for
   this flag, but the idea is that you're no longer using the provided
   static C runtime, but rather one will be provided externally. This
   flag is intended to also get coupled with an external `clang`
   compiler configured with its own sysroot. Therefore you'll typically
   use this flag with `-C linker=/path/to/clang-script-wrapper`. Using
   this mode the Rust code will continue to reference standard C
   symbols, but the definition will be pulled in by the linker configured.

Alright so that's all the current state of this PR. I suspect we'll
definitely want to discuss this before landing of course! This PR is
coupled with libc changes as well which I'll be posting shortly.

[LINK]:
[wasmtime]:

5 years agoFix OnceWith docstring.
Geoffry Song [Fri, 29 Mar 2019 22:03:14 +0000 (15:03 -0700)]
Fix OnceWith docstring.

This was incorrectly copypasta'd from RepeatWith.

5 years agoAuto merge of #58846 - bjorn3:misc_cg_ssa_refactor, r=eddyb
bors [Fri, 29 Mar 2019 21:46:15 +0000 (21:46 +0000)]
Auto merge of #58846 - bjorn3:misc_cg_ssa_refactor, r=eddyb

Misc refactorings to rustc_codegen_ssa

Unlike #56636 this doesn't split `BuilderMethods` into a lot of traits. That makes this PR twice as small and the split turned out to not be very useful anyway.

r? @eddyb

5 years agoSuggest using anonymous lifetime in `impl Trait` return
Esteban Küber [Mon, 4 Mar 2019 19:52:03 +0000 (11:52 -0800)]
Suggest using anonymous lifetime in `impl Trait` return

5 years agoIn doc examples, don't ignore read/write results
Matt Brubeck [Fri, 29 Mar 2019 16:30:08 +0000 (09:30 -0700)]
In doc examples, don't ignore read/write results

Calling `Read::read` or `Write::write` without checking the returned
`usize` value is almost always an error.  Example code in the
documentation should demonstrate how to use the return value correctly.
Otherwise, people might copy the example code thinking that it is okay
to "fire and forget" these methods.

5 years agoCollapse blanket impls in the same way as normal impls
Laurenz [Fri, 29 Mar 2019 18:47:19 +0000 (19:47 +0100)]
Collapse blanket impls in the same way as normal impls

5 years agoFix incorrect code
Esteban Küber [Fri, 29 Mar 2019 13:46:39 +0000 (06:46 -0700)]
Fix incorrect code

5 years agoAuto merge of #59522 - Centril:rollup, r=Centril
bors [Fri, 29 Mar 2019 18:09:51 +0000 (18:09 +0000)]
Auto merge of #59522 - Centril:rollup, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #59366 (Update books)
 - #59436 (Update jemalloc-sys to version 0.3.0)
 - #59454 (Update rustfmt to 1.2.0)
 - #59462 (Fix error in Rust 2018 + no_core environment)
 - #59467 (Better diagnostic for binary operation on BoxedValues)
 - #59473 (Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans)
 - #59480 (Update stdsimd)
 - #59486 (Visit `ImplItem` in `dead_code` lint)
 - #59510 (Rename `type_parameters` to `generics` and so on)

Failed merges:

 - #59516 (Update cargo)

r? @ghost

5 years agoUse ExactSizeIterator + TrustedLen instead of num_cases arg for switch
bjorn3 [Fri, 29 Mar 2019 16:23:52 +0000 (17:23 +0100)]
Use ExactSizeIterator + TrustedLen instead of num_cases arg for switch

5 years agoAdd a method for emiting a switch.
bjorn3 [Sat, 8 Dec 2018 17:42:31 +0000 (18:42 +0100)]
Add a method for emiting a switch.

5 years agoRemove inline_asm_call from cg_ssa
bjorn3 [Sat, 8 Dec 2018 15:07:27 +0000 (16:07 +0100)]
Remove inline_asm_call from cg_ssa

`count_insn` is no longer called for inline asm, because it is private to builder.rs

5 years agoRemove type_variadic_func and typ_array from cg_ssa
bjorn3 [Sat, 8 Dec 2018 10:48:43 +0000 (11:48 +0100)]
Remove type_variadic_func and typ_array from cg_ssa

5 years agoRemove a lot of methods from *TypeMethods
bjorn3 [Fri, 1 Mar 2019 14:47:06 +0000 (15:47 +0100)]
Remove a lot of methods from *TypeMethods

5 years agoRemove scalar_lltypes from cg_ssa
bjorn3 [Fri, 7 Dec 2018 17:04:34 +0000 (18:04 +0100)]
Remove scalar_lltypes from cg_ssa

5 years agoMove get_param and set_value_name
bjorn3 [Tue, 4 Dec 2018 19:20:45 +0000 (20:20 +0100)]
Move get_param and set_value_name

5 years agoRemove a lot of methods from BuilderMethods
bjorn3 [Sun, 2 Dec 2018 17:54:46 +0000 (18:54 +0100)]
Remove a lot of methods from BuilderMethods

5 years ago[WIP] Make some debug info methods take &mut FunctionDebugContext
bjorn3 [Sun, 2 Dec 2018 17:25:42 +0000 (18:25 +0100)]
[WIP] Make some debug info methods take &mut FunctionDebugContext

declare_local still takes &FunctionDebugContext, because of borrowck errors

5 years agoRemove internal mutability from source_locations_enabled
bjorn3 [Sun, 2 Dec 2018 17:09:26 +0000 (18:09 +0100)]
Remove internal mutability from source_locations_enabled

5 years agoRemove param_substs from FunctionCx
bjorn3 [Sun, 2 Dec 2018 17:04:39 +0000 (18:04 +0100)]
Remove param_substs from FunctionCx

5 years agoRemove const_{cstr,str_slice,get_elt,get_real} and is_const_real methods from cg_ssa
bjorn3 [Sun, 2 Dec 2018 15:53:39 +0000 (16:53 +0100)]
Remove const_{cstr,str_slice,get_elt,get_real} and is_const_real methods from cg_ssa

This introduces the static_panic_msg trait method to StaticBuilderMethods.

5 years agoRemove const_{fat_ptr,array,vector,bytes} from cg_ssa
bjorn3 [Sun, 2 Dec 2018 14:58:40 +0000 (15:58 +0100)]
Remove const_{fat_ptr,array,vector,bytes} from cg_ssa

5 years agoMisc
bjorn3 [Sun, 2 Dec 2018 13:35:11 +0000 (14:35 +0100)]
Misc

5 years agoAdd a comment
bjorn3 [Fri, 1 Mar 2019 14:05:18 +0000 (15:05 +0100)]
Add a comment

5 years agoUse Builder instead of CodegenCx for OperandRef and LocalRef
bjorn3 [Fri, 1 Mar 2019 14:03:48 +0000 (15:03 +0100)]
Use Builder instead of CodegenCx for OperandRef and LocalRef

5 years ago`eval_mir_constant` doesn't need a builder param
bjorn3 [Sun, 2 Dec 2018 12:57:41 +0000 (13:57 +0100)]
`eval_mir_constant` doesn't need a builder param

5 years agoDon't use c_uint in cg_ssa
bjorn3 [Sun, 2 Dec 2018 11:54:54 +0000 (12:54 +0100)]
Don't use c_uint in cg_ssa

5 years agoUpdate src/libstd/macros.rs
Mazdak Farrokhzad [Fri, 29 Mar 2019 15:25:38 +0000 (16:25 +0100)]
Update src/libstd/macros.rs

Removed duplicate line.

Co-Authored-By: DevQps <46896178+DevQps@users.noreply.github.com>
5 years agoUpdate src/libstd/macros.rs
Mazdak Farrokhzad [Fri, 29 Mar 2019 15:24:13 +0000 (16:24 +0100)]
Update src/libstd/macros.rs

Wrapped lines earlier such that it is more coherent with the rest of the text.

Co-Authored-By: DevQps <46896178+DevQps@users.noreply.github.com>
5 years agoAdjusted the indentation.
Christian [Fri, 29 Mar 2019 15:18:24 +0000 (16:18 +0100)]
Adjusted the indentation.

5 years agoEdited the dbg! docs stating that dbg! works the same way in release builds.
Christian [Fri, 29 Mar 2019 14:56:22 +0000 (15:56 +0100)]
Edited the dbg! docs stating that dbg! works the same way in release builds.

5 years agoRegression test for incremental treatment of rustc_scalar_valid_range_{start,end}.
Felix S. Klock II [Fri, 29 Mar 2019 14:05:03 +0000 (15:05 +0100)]
Regression test for incremental treatment of rustc_scalar_valid_range_{start,end}.

5 years agoWhitelist rustc_layout_scalar_valid_range_{start,end} so incr comp does not flag...
Felix S. Klock II [Fri, 29 Mar 2019 14:04:09 +0000 (15:04 +0100)]
Whitelist rustc_layout_scalar_valid_range_{start,end} so incr comp does not flag them as unused.

5 years agoRegression test for incremental treatment of rustc_on_unimplemented.
Felix S. Klock II [Fri, 29 Mar 2019 14:03:31 +0000 (15:03 +0100)]
Regression test for incremental treatment of rustc_on_unimplemented.

5 years agorevert change to test file as per review request
Esteban Küber [Fri, 29 Mar 2019 03:10:00 +0000 (20:10 -0700)]
revert change to test file as per review request

5 years agoWhitelist `rustc_on_unimplemented` to avoid erroneous flagging as an unused attribute.
Felix S. Klock II [Fri, 29 Mar 2019 13:24:14 +0000 (14:24 +0100)]
Whitelist `rustc_on_unimplemented` to avoid erroneous flagging as an unused attribute.

5 years agoRollup merge of #59510 - varkor:rename-type_parameters, r=eddyb
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:32 +0000 (12:32 +0100)]
Rollup merge of #59510 - varkor:rename-type_parameters, r=eddyb

Rename `type_parameters` to `generics` and so on

Some old variable names had fallen through the generics generalisation pull requests.

5 years agoRollup merge of #59486 - varkor:dead-code-impl, r=sanxiyn
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:30 +0000 (12:32 +0100)]
Rollup merge of #59486 - varkor:dead-code-impl, r=sanxiyn

Visit `ImplItem` in `dead_code` lint

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

5 years agoRollup merge of #59480 - gnzlbg:us, r=alexcrichton
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:29 +0000 (12:32 +0100)]
Rollup merge of #59480 - gnzlbg:us, r=alexcrichton

Update stdsimd

This PR fixes a regression introduced by ACLE support on thumbv4 targets, see: https://github.com/rust-lang-nursery/stdsimd/pull/704 .

5 years agoRollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwco
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:28 +0000 (12:32 +0100)]
Rollup merge of #59473 - estebank:borrow-sugg-inside-macro, r=davidtwco

Do not emit incorrect borrow suggestion involving macros and fix overlapping multiline spans

Fix #58298.

5 years agoRollup merge of #59467 - hgallagher1993:local_branch, r=estebank
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:26 +0000 (12:32 +0100)]
Rollup merge of #59467 - hgallagher1993:local_branch, r=estebank

Better diagnostic for binary operation on BoxedValues

Fixes #59458

5 years agoRollup merge of #59462 - taiki-e:no-core, r=petrochenkov
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:24 +0000 (12:32 +0100)]
Rollup merge of #59462 - taiki-e:no-core, r=petrochenkov

Fix error in Rust 2018 + no_core environment

Minimized reproduction: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5b9f6c3026ec9d856699fa6dbd4361f0

This is a fix for the error that occurred in #58702.

r? @Centril

5 years agoRollup merge of #59454 - topecongiro:rustfmt-1.2.0, r=nrc
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:23 +0000 (12:32 +0100)]
Rollup merge of #59454 - topecongiro:rustfmt-1.2.0, r=nrc

Update rustfmt to 1.2.0

This release includes bug fixes and performance improvements from 1.1.0. Also it adds a new rustfmt tool attribute `#[rustfmt::skip::macros]`, which lets you skip formatting macro calls of your choice.

cc @nrc @Centril @Xanewok

5 years agoRollup merge of #59436 - gnzlbg:update_jemalloc, r=alexcrichton
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:21 +0000 (12:32 +0100)]
Rollup merge of #59436 - gnzlbg:update_jemalloc, r=alexcrichton

Update jemalloc-sys to version 0.3.0

This PR updates jemalloc-sys from 0.1.8 to 0.3.0.

5 years agoRollup merge of #59366 - ehuss:update-books, r=QuietMisdreavus
Mazdak Farrokhzad [Fri, 29 Mar 2019 11:32:19 +0000 (12:32 +0100)]
Rollup merge of #59366 - ehuss:update-books, r=QuietMisdreavus

Update books

Update reference, book, rust-by-example, edition-guide, embedded-book

## reference

15 commits in 41493ffce5d0e17d54eaf5ec9a995054e2b9aece..27ad493a10364e907ec476e2ad61e8a1614b57e1
2019-03-05 12:32:22 +0100 to 2019-03-26 02:06:15 +0100
- Document wasm_import_module for #[link]. (rust-lang-nursery/reference#554)
- Fix tidy error. (rust-lang-nursery/reference#552)
- Some minor contributing updates. (rust-lang-nursery/reference#551)
- Document `type_length_limit`. (rust-lang-nursery/reference#546)
- Add some terms to the glossary. (rust-lang-nursery/reference#547)
- Document `target_feature` and `cfg_target_feature`. (rust-lang-nursery/reference#545)
- Remove undocumented page (rust-lang-nursery/reference#539)
- Reorg and update attributes (rust-lang-nursery/reference#537)
- Fix some minor link errors. (rust-lang-nursery/reference#538)
- Add linkchecker. (rust-lang-nursery/reference#521)
- Expand docs on Macros By Example. (rust-lang-nursery/reference#511)
- document #[panic_handler] (rust-lang-nursery/reference#362)
- document #[used] (rust-lang-nursery/reference#361)
- Note that UB is program-global (rust-lang-nursery/reference#490)
- Fix copy-paste error in procedural-macros.md (rust-lang-nursery/reference#533)

## book

16 commits in 9cffbeabec3bcec42d09432bfe7705125c848889..b93ec30bbc7b1b5c2f44223249ab359bed2ed5a6
2019-03-02 08:22:41 -0500 to 2019-03-26 16:54:10 -0400
- Unignore example that now compiles
- Fix code snippet (rust-lang/book#1863)
- Fix mdbook link text in readme (rust-lang/book#1881)
- Wrap to 80 cols
- Make sentence more complete (rust-lang/book#1885)
- consistenly use increment and decrement (rust-lang/book#1884)
- Fix link to Reference's conditional-compilation. (rust-lang/book#1878)
- Fix subject/verb agreement
- Remove nostarch snapshot files that have been incorporated and checked
- haha teach the dictionary steve's name
- Add authorship info to the front page
- fix accidental &lt;ol&gt;'s (rust-lang/book#1866)
- Edits to Macros (rust-lang/book#1848)
- Mention `lock` returns `MutexGuard` wrapped in a `LockResult`
- Add an example that illustrates NLL (rust-lang/book#1842)
- change the parameter name from `type` to `kind` (rust-lang/book#1845)

## rust-by-example

33 commits in 2ce92beabb912d417a7314d6da83ac9b50dc2afb..f68ef3d0f4959f6a7d92a08d9994b117f0f4d32d
2018-11-20 10:10:23 -0500 to 2019-03-12 15:32:12 -0300
- Fix some broken links. (rust-lang/rust-by-example#1161)
- Update links in README (rust-lang/rust-by-example#1167)
- Add score/lifetimes/trait.md (rust-lang/rust-by-example#1168)
- Fix rust-lang/rust-by-example#1147 - No more `open_mode` method (rust-lang/rust-by-example#1164)
- Fix for loop description in list print example (rust-lang/rust-by-example#1162)
- Add link to Cargo chapter in the index page (rust-lang/rust-by-example#1159)
- Fix grammar in sentence about integer notation (rust-lang/rust-by-example#1157)
- Do not use deprecated functions from `std::error::Error` trait (rust-lang/rust-by-example#1151)
- Update new_types.md to clarify conversion to base type (rust-lang/rust-by-example#1148)
- Fix compatibility with Rust 2018 (rust-lang/rust-by-example#1150)
- Hello: Fix hint link in `fmt` chapter. (rust-lang/rust-by-example#1146)
- Clarify pub(restricted) example a bit (rust-lang/rust-by-example#1133)
- Add "literal" to list of macro designators (rust-lang/rust-by-example#1153)
- Minor fixes for the macros chapter (rust-lang/rust-by-example#1113)
- Use new book links instead of the old second-edition ones (rust-lang/rust-by-example#1143)
- Recommend implementing Display over ToString (rust-lang/rust-by-example#1145)
- Remove unused import and format with `rustfmt` (rust-lang/rust-by-example#1144)
- fix typo (rust-lang/rust-by-example#1142)
- Update syntax for 2018 Edition (rust-lang/rust-by-example#1136)
- Added two missing full stops (rust-lang/rust-by-example#1138)
- Removed unnecessary spaces before macro designators in macros/dry (rust-lang/rust-by-example#1139)
- fix install mdbook command (rust-lang/rust-by-example#1128)
- Changed word `function` to `type` in comment of fn area (rust-lang/rust-by-example#1132)
- Added two missing backticks in generics/multi_bounds (rust-lang/rust-by-example#1129)
- Fixed small logic error in error/option_unwrap/and_then (rust-lang/rust-by-example#1127)
- Fix typo (rust-lang/rust-by-example#1125)
- The code of conduct link was dead. I fixed it. (rust-lang/rust-by-example#1122)
- I added a space in the Display fmt for Complex (rust-lang/rust-by-example#1123)
- Fix Rust install link in the index (rust-lang/rust-by-example#1124)
- Update cargo conventions section (rust-lang/rust-by-example#1121)
- Fixed curly braces in the `To and from Strings` chapter to be parentheses (rust-lang/rust-by-example#1120)
- Edit a typo (rust-lang/rust-by-example#1119)
- Fixes rust-lang/rust-by-example#1115 by correcting the typo from into_iterator to into_iter (rust-lang/rust-by-example#1118)

## edition-guide

1 commits in aa0022c875907886cae8f3ef8e9ebf6e2a5e728d..b56ddb11548450a6df4edd1ed571b2bc304eb9e6
2019-02-27 22:10:39 -0800 to 2019-03-10 10:23:16 +0100
- Links fixes (rust-lang-nursery/edition-guide#133)

## embedded-book

6 commits in 9e656ead82bfe869493dec82653a52e27fa6a05c..07fd3880ea0874d82b1d9ed30ad3427ec98b4e8a
2019-03-03 16:03:26 +0000 to 2019-03-27 15:40:52 +0000
- Fix test errors.  (rust-embedded/book#180)
- Update qemu.md  (rust-embedded/book#170)
- Update no-std.md to remove obsolete FAQ link  (rust-embedded/book#177)
- We've come a long way :)  (rust-embedded/book#176)
- Correct link to team  (rust-embedded/book#175)
- Update some book links to their new homes.  (rust-embedded/book#173)

5 years agoAuto merge of #59303 - euclio:remove-rebuild-trigger, r=cuviper
bors [Fri, 29 Mar 2019 11:20:55 +0000 (11:20 +0000)]
Auto merge of #59303 - euclio:remove-rebuild-trigger, r=cuviper

replace llvm-rebuild-trigger with submodule commit hash

As mentioned in #59285.

This PR removes the need to update the `llvm-rebuild-trigger` file. Instead, the latest commit hash of the appropriate LLVM submodule will be stored in the stamp file and used to detect if a build is required.

Fixes #42405.
Fixes #54959.
Fixes #55537.

5 years agoSupport non-exhaustive enum variants in rustdoc.
David Wood [Sat, 23 Mar 2019 01:36:30 +0000 (02:36 +0100)]
Support non-exhaustive enum variants in rustdoc.

This commit adds support for non-exhaustive enum variants in rustdoc,
extending the existing support for non-exhaustive enums and structs.

5 years agoUpdate documentation.
David Wood [Sat, 23 Mar 2019 01:35:22 +0000 (02:35 +0100)]
Update documentation.

This commit updates the unstable book and diagnostics to reflect that
the `#[non_exhaustive]` attribute is now available for enum variants.

5 years agoAuto merge of #59513 - Centril:rollup, r=Centril
bors [Fri, 29 Mar 2019 08:14:41 +0000 (08:14 +0000)]
Auto merge of #59513 - Centril:rollup, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #58019 (Combine all builtin late lints and make lint checking parallel)
 - #59358 (Use `track_errors` instead of hand rolling)
 - #59394 (warn -> deny duplicate match bindings)
 - #59401 (bootstrap: build crates under libtest with -Z emit-stack-sizes)
 - #59423 (Visit path in `walk_mac`)
 - #59468 (musl: build toolchain libs with -fPIC)
 - #59476 (Use `SmallVec` in `TokenStreamBuilder`.)
 - #59496 (Remove unnecessary with_globals calls)
 - #59498 (Use 'write_all' instead of 'write' in example code)
 - #59503 (Stablize {f32,f64}::copysign().)
 - #59511 (Fix missed fn rename in #59284)

Failed merges:

r? @ghost

5 years agorustc_target: factor out common fields of non-Single Variants.
Eduard-Mihai Burtescu [Fri, 29 Mar 2019 05:44:54 +0000 (07:44 +0200)]
rustc_target: factor out common fields of non-Single Variants.

5 years agorustc(codegen): uncache `def_symbol_name` prefix from `symbol_name`.
Eduard-Mihai Burtescu [Thu, 21 Mar 2019 16:06:04 +0000 (18:06 +0200)]
rustc(codegen): uncache `def_symbol_name` prefix from `symbol_name`.

5 years agoAuto merge of #58605 - nagisa:fix-the-metadata, r=michaelwoerister
bors [Fri, 29 Mar 2019 05:00:58 +0000 (05:00 +0000)]
Auto merge of #58605 - nagisa:fix-the-metadata, r=michaelwoerister

Use informational target machine for metadata

Since there is nothing to optimise there...

Should fix #58323 but haven’t tested locally.

r? @michaelwoerister

5 years agoFix error in Rust 2018 + no_core environment
Taiki Endo [Fri, 29 Mar 2019 04:54:50 +0000 (13:54 +0900)]
Fix error in Rust 2018 + no_core environment

5 years agoimplement `AsRawFd` for stdio locks
Andy Russell [Fri, 29 Mar 2019 00:45:40 +0000 (20:45 -0400)]
implement `AsRawFd` for stdio locks

5 years agoFix MultilineAnnotation field name
Esteban Küber [Fri, 29 Mar 2019 03:19:50 +0000 (20:19 -0700)]
Fix MultilineAnnotation field name

5 years agoAdd comemnts clarifying logic
Esteban Küber [Fri, 29 Mar 2019 03:18:50 +0000 (20:18 -0700)]
Add comemnts clarifying logic

5 years agoreview comments
Esteban Küber [Thu, 28 Mar 2019 11:47:09 +0000 (04:47 -0700)]
review comments

5 years agoreview comments
Esteban Küber [Fri, 29 Mar 2019 03:03:13 +0000 (20:03 -0700)]
review comments

5 years agoDeduplicate parse recovery code
Esteban Küber [Fri, 29 Mar 2019 02:58:45 +0000 (19:58 -0700)]
Deduplicate parse recovery code

5 years agofix text after rebase
Esteban Küber [Fri, 29 Mar 2019 02:58:00 +0000 (19:58 -0700)]
fix text after rebase

5 years agoRollup merge of #59511 - jethrogb:jb/maybeinit-deprecated, r=Centril
Mazdak Farrokhzad [Fri, 29 Mar 2019 01:41:00 +0000 (02:41 +0100)]
Rollup merge of #59511 - jethrogb:jb/maybeinit-deprecated, r=Centril

Fix missed fn rename in #59284

See https://github.com/rust-lang/rust/pull/59284#issuecomment-477822797

5 years agoRollup merge of #59503 - crlf0710:stablize_copysign, r=SimonSapin
Mazdak Farrokhzad [Fri, 29 Mar 2019 01:40:58 +0000 (02:40 +0100)]
Rollup merge of #59503 - crlf0710:stablize_copysign, r=SimonSapin

Stablize {f32,f64}::copysign().

Stablization PR for #55169/#58046. Please check if i'm doing it correctly. Is 1.35.0 good to go?

5 years agoRollup merge of #59498 - mbrubeck:write_all, r=Centril
Mazdak Farrokhzad [Fri, 29 Mar 2019 01:40:57 +0000 (02:40 +0100)]
Rollup merge of #59498 - mbrubeck:write_all, r=Centril

Use 'write_all' instead of 'write' in example code

Using `write` without looping and checking the result can cause silent data loss.  Example code should use `write_all` so that people don't copy this pattern.  (Of course this does not include example code for docs that are specifically about the `write` method.)

5 years agoRollup merge of #59496 - Zoxc:fix-globals, r=oli-obk
Mazdak Farrokhzad [Fri, 29 Mar 2019 01:40:56 +0000 (02:40 +0100)]
Rollup merge of #59496 - Zoxc:fix-globals, r=oli-obk

Remove unnecessary with_globals calls

5 years agoRollup merge of #59476 - nnethercote:TokenStreamBuilder-SmallVec, r=petrochenkov
Mazdak Farrokhzad [Fri, 29 Mar 2019 01:40:54 +0000 (02:40 +0100)]
Rollup merge of #59476 - nnethercote:TokenStreamBuilder-SmallVec, r=petrochenkov

Use `SmallVec` in `TokenStreamBuilder`.

This reduces by 12% the number of allocations done for a "clean incremental" of `webrender_api`, which reduces the instruction count by about 0.5%.

r? @petrochenkov