Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #57624

Closed
wants to merge 27 commits into from
Closed

Rollup of 8 pull requests #57624

wants to merge 27 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jan 15, 2019

Successful merges:

Failed merges:

r? @ghost

sinkuu and others added 27 commits January 12, 2019 01:54
 name                        old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
 fmt::write_str_macro1       13,927       12,489             -1,438  -10.33%   x 1.12
 fmt::write_str_macro2       24,633       23,418             -1,215   -4.93%   x 1.05
 fmt::write_str_macro_debug  234,633      233,092            -1,541   -0.66%   x 1.01
 fmt::write_str_ref          5,819        5,823                   4    0.07%   x 1.00
 fmt::write_str_value        6,012        5,828                -184   -3.06%   x 1.03
 fmt::write_vec_macro1       18,550       17,143             -1,407   -7.58%   x 1.08
 fmt::write_vec_macro2       30,369       28,920             -1,449   -4.77%   x 1.05
 fmt::write_vec_macro_debug  244,338      244,901               563    0.23%   x 1.00
 fmt::write_vec_ref          5,952        5,885                 -67   -1.13%   x 1.01
 fmt::write_vec_value        5,944        5,894                 -50   -0.84%   x 1.01
name                        old2 ns/iter  new2 ns/iter  diff ns/iter   diff %  speedup
fmt::write_str_macro1       12,295        12,308                  13    0.11%   x 1.00
fmt::write_str_macro2       24,079        21,451              -2,628  -10.91%   x 1.12
fmt::write_str_macro_debug  238,363       230,807             -7,556   -3.17%   x 1.03
fmt::write_str_ref          6,203         6,064                 -139   -2.24%   x 1.02
fmt::write_str_value        6,225         6,075                 -150   -2.41%   x 1.02
fmt::write_vec_macro1       17,144        17,121                 -23   -0.13%   x 1.00
fmt::write_vec_macro2       29,845        26,703              -3,142  -10.53%   x 1.12
fmt::write_vec_macro_debug  248,840       242,117             -6,723   -2.70%   x 1.03
fmt::write_vec_ref          5,954         6,438                  484    8.13%   x 0.92
fmt::write_vec_value        5,959         6,439                  480    8.06%   x 0.93
This shouldn't break compatibility for crates that do not use
`feature(optin_builtin_traits)`, because as the test shows, it is
only possible to impl a marker trait for a trait object in the crate the
marker trait is defined in, which must define
`feature(optin_builtin_traits)`.

Fixes rust-lang#56934
`TokenStream::Stream` can represent a token stream containing any number
of token trees. `TokenStream::Tree` is the special case representing a
single token tree. The latter doesn't occur all that often dynamically,
so this commit removes it, which simplifies the code quite a bit.

This change has mixed performance effects.

- The size of `TokenStream` drops from 32 bytes to 8 bytes, and there
  is one less case for all the match statements.

- The conversion of a `TokenTree` to a `TokenStream` now requires two
  allocations, for the creation of a single element Lrc<Vec<_>>. (But a
  subsequent commit in this PR will reduce the main source of such
  conversions.)
`TokenStream` is now almost identical to `ThinTokenStream`. This commit
removes the latter, replacing it with the former.
Because that's the more typical way of representing an all-or-nothing
type.
This ensures that the test passes, regardless of what the user has set
RUST_BACKTRACE to.
Make privacy checking, intrinsic checking and liveness checking incremental

Blocked on rust-lang#51487

r? @michaelwoerister
…tsakis

forbid manually impl'ing one of an object type's marker traits

This shouldn't break compatibility for crates that do not use
`feature(optin_builtin_traits)`, because as the test shows, it is
only possible to impl a marker trait for a trait object in the crate the
marker trait is defined in, which must define
`feature(optin_builtin_traits)`.

Fixes rust-lang#56934.

r? @nikomatsakis
…re, r=petrochenkov

Simplify `TokenStream` some more

These commits simplify `TokenStream`, remove `ThinTokenStream`, and avoid some clones. The end result is simpler code and a slight perf win on some benchmarks.

r? @petrochenkov
Small perf improvement for fmt

Added benchmark is based on rust-lang#10761
Add core::iter::once_with()

Functions `iter::once()` and `iter::repeat()` construct iterators from values. The latter has the lazy variant `iter::repeat_with()`, but the former doesn't. This PR therefore adds `iter::once_with()`.

Another way to think of `iter::once_with()` is that it's a function that converts `FnOnce() -> T` into `Iterator<Item = T>`.

If this seems like a reasonable addition, I'll open a tracking issue and update the `#[feature(...)]` attributes.
…crichton

Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test

This ensures that the test passes, regardless of what the user has set
RUST_BACKTRACE to.
Simplify 'product' factorial example

This simplifies the [`factorial(n: 32)`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#examples-46) implementation as example for the `Iterator::product()` function.
It currently uses unnecessary additional complexity.

Although very minimal, I do not want to include it in some other irrelevant PR.
… r=QuietMisdreavus

[rustdoc] Fix crates filtering box not being filled

Currently, the filter crate box (at the left of the search input) is always empty. To get the number of keys of dictionary in JS, you need to call `Object.keys()` on it.

r? @QuietMisdreavus
@Centril
Copy link
Contributor Author

Centril commented Jan 15, 2019

@bors r+ p=8

@bors
Copy link
Contributor

bors commented Jan 15, 2019

📌 Commit f14a882 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 15, 2019
@bors
Copy link
Contributor

bors commented Jan 15, 2019

⌛ Testing commit f14a882 with merge 2e10d6aa037422bc104ed2192bfcdd6ff697b15b...

@bors
Copy link
Contributor

bors commented Jan 15, 2019

💔 Test failed - checks-travis

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[01:22:06]    Compiling cargo_metadata v0.6.2
[01:22:26]    Compiling clippy_lints v0.0.212 (/checkout/src/tools/clippy/clippy_lints)
[01:22:26] [RUSTC-TIMING] toml test:false 20.014
[01:22:28] [RUSTC-TIMING] cargo_metadata test:false 22.053
[01:22:29] error[E0432]: unresolved import `syntax::tokenstream::ThinTokenStream`
[01:22:29]    |
[01:22:29]    |
[01:22:29] 17 | use syntax::tokenstream::{ThinTokenStream, TokenStream};
[01:22:29]    |                           ^^^^^^^^^^^^^^^ no `ThinTokenStream` in `tokenstream`. Did you mean to use `TokenStream`?
[01:22:29] 
[01:22:31] error[E0432]: unresolved import `syntax::tokenstream::ThinTokenStream`
[01:22:31]    |
[01:22:31]    |
[01:22:31] 17 | use syntax::tokenstream::{ThinTokenStream, TokenStream};
[01:22:31]    |                           ^^^^^^^^^^^^^^^ no `ThinTokenStream` in `tokenstream`. Did you mean to use `TokenStream`?
[01:22:33] error: aborting due to previous error
[01:22:33] 
[01:22:33] For more information about this error, try `rustc --explain E0432`.
[01:22:33] error: Could not compile `clippy_lints`.
---
[01:26:53]    Compiling curl v0.4.19
[01:26:58] [RUSTC-TIMING] rustc_data_structures test:false 6.076
[01:26:59] [RUSTC-TIMING] rustfix test:false 6.674
[01:26:59]    Compiling clippy_lints v0.0.212 (/checkout/src/tools/clippy/clippy_lints)
[01:27:04] error[E0432]: unresolved import `syntax::tokenstream::ThinTokenStream`
[01:27:04]    |
[01:27:04]    |
[01:27:04] 17 | use syntax::tokenstream::{ThinTokenStream, TokenStream};
[01:27:04]    |                           ^^^^^^^^^^^^^^^ no `ThinTokenStream` in `tokenstream`. Did you mean to use `TokenStream`?
[01:27:04]    Compiling rand_chacha v0.1.0
[01:27:05] [RUSTC-TIMING] ignore test:false 32.632
[01:27:06]    Compiling rand_pcg v0.1.1
[01:27:06]    Compiling rand v0.6.1
---
travis_time:end:21960ca1:start=1547541927863218265,finish=1547541927870996669,duration=7778404
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0db14231
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:013c8f7e
travis_time:start:013c8f7e
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:2212edc5
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 15, 2019
@Centril Centril closed this Jan 15, 2019
@Centril Centril deleted the rollup branch January 15, 2019 09:01
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants