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 16 pull requests #54457

Merged
merged 37 commits into from
Sep 22, 2018
Merged

Rollup of 16 pull requests #54457

merged 37 commits into from
Sep 22, 2018

Conversation

pietroalbini
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

japaric and others added 30 commits September 16, 2018 23:04
Let cargo handle that for us

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Currently, `BitSet` doesn't actually know its own domain size; it just
knows how many words it contains. To improve things, this commit makes
the following changes.

- It changes `BitSet` and `SparseBitSet` to store their own domain size,
  and do more precise bounds and same-size checks with it. It also
  changes the signature of `BitSet::to_string()` (and puts it within
  `impl ToString`) now that the domain size need not be passed in from
  outside.

- It uses `derive(RustcDecodable, RustcEncodable)` for `BitSet`. This
  required adding code to handle `PhantomData` in `libserialize`.

- As a result, it removes the domain size from `HybridBitSet`, making a
  lot of that code nicer.

- Both set_up_to() and clear_above() were overly general, working with
  arbitrary sizes when they are only needed for the domain size. The
  commit removes the former, degeneralizes the latter, and removes the
  (overly general) tests.

- Changes `GrowableBitSet::grow()` to `ensure()`, fixing a bug where a
  (1-based) domain size was confused with a (0-based) element index.

- Changes `BitMatrix` to store its row count, and do more precise bounds
  checks with it.

- Changes `ty_params` in `select.rs` from a `BitSet` to a
  `GrowableBitSet` because it repeatedly failed the new, more precise
  bounds checks. (Changing the type was simpler than computing an
  accurate domain size.)

- Various other minor improvements.
This is a safe wrapper around ptr::copy, for regions within a single
slice. Previously, safe in-place copying was only available as a side
effect of Vec::drain.
The no_default_libraries was introduced in rust-lang#28578 because the
NetBSD-based rumprun needed to disable the link flag.
This moves the definition to be used by all NetBSD linker flavors to
close rust-lang#49627.

A different solution would be adding -lc but as there is no platform
with explicit -lc, this approach is used.
Profiling shows that the `(reader, writer, used)` triples used by
liveness analysis almost always have invalid `reader` and `writer`
fields. We can take advantage of this knowledge to use a compressed
representation for them, falling back to a secondary table for the
uncommon cases.

This change reduces instruction counts on numerous benchmarks, the best
by 16%. It also reduces max-rss on numerous benchmarks, the best by 38%.

The patch also renames these triples from `Users` to `RWU`, because it's
confusing having a type whose name is plural and then used within
vectors whose names are also plural.
…chton

define copy_within on slices

This is a safe wrapper around `ptr::copy`, for regions within a single slice. Previously, safe in-place copying was only available as a side effect of `Vec::drain`.

I've wanted this API a couple times in the past, and I figured I'd just whip up a PR to help discuss it. It's possible something like this exists elsewhere and I just missed it. It might also be a big enough addition to warrant an RFC, I'm not sure.
…nkov

Make `dyn` a keyword in the 2018 edition

Proposed in rust-lang#44662 (comment).
…richton

remove (more) CAS API from Atomic* types where not natively supported

closes rust-lang#54276

In PR rust-lang#51953 I made the Atomic* types available on targets like thumbv6m and
msp430 with the intention of *only* exposing the load and store API on those
types -- the rest of the API doesn't work on those targets because the are no
native instructions to implement CAS loops.

Unfortunately, it seems I didn't properly cfg away all the CAS API on those
targets, as evidenced in rust-lang#54276. This PR amends the issue by removing the rest
of the CAS API.

This is technically a breaking change because *libraries* that were using this
API and were being compiled for e.g. thumbv6m-none-eabi will stop compiling.
However, using those libraries (before this change) in programs (binaries) would
lead to linking errors when compiled for e.g. thumbv6m so this change
effectively shifts a linker error in binaries to a compiler error in libraries.

On a side note: extending the Atomic API is a bit error prone because of these
non-cas targets. Unless the author of the change is aware of these targets and
properly uses `#[cfg(atomic = "cas")]` they could end up exposing new CAS API on
these targets. I can't think of a test to check that an API is not present on
some target, but we could extend the `tidy` tool to check that *all* newly added
atomic API has the `#[cfg(atomic = "cas")]` attribute unless it's whitelisted in
`tidy` then the author of the change would have to verify if the API can be used
on non-cas targets.

In any case, I'd like to plug this hole ASAP. We can revisit testing in a
follow-up issue / PR.

r? @alexcrichton
cc @mvirkkunen
rustbuild: drop color handling

Let cargo handle that for us

Fixes rust-lang#54322

Needs a beta backport
…est, r=steveklabnik

Support specifying edition in doc test

Fixes rust-lang#52623

r? @QuietMisdreavus
…ikomatsakis

Improve handling of type bounds in `bit_set.rs`.

Currently, `BitSet` doesn't actually know its own domain size; it just
knows how many words it contains. We can make it better.
… r=GuillaumeGomez

add -Zui-testing to rustdoc

Before we depend on the `rustdoc-ui` tests some more, let's make rustdoc act the same as the compiler when they're actually being executed.
…crichton

Make 'proc_macro::MultiSpan' public.

Oversight from rust-lang#52896.
Use no_default_libraries for all NetBSD flavors

The no_default_libraries was introduced in rust-lang#28578 because the
NetBSD-based rumprun needed to disable the link flag.
This moves the definition to be used by all NetBSD linker flavors to
close rust-lang#49627.

A different solution would be adding -lc but as there is no platform
with explicit -lc, this approach is used.
Detect `for _ in in bar {}` typo

Fix rust-lang#36611, rust-lang#52964, without modifying the parsing of emplacement `in` to avoid further problems like rust-lang#50832.
…tebank

add applicability to span_suggestion call

Found another `span_suggestion` call. Issue rust-lang#50723

r? @estebank
…tebank

Add UI test for deref recursion limit printing twice

Closes rust-lang#38940

Does ``NOTE`` in the test need to be changed to ``HELP`` if its in the stderr?
``help: consider adding a `#![recursion_limit="20"]` attribute to your crate``

It doesn't appear to complaining locally that the line isn't set to ``HELP`` in the test, and the guide says
 > HELP and SUGGESTION*
> * Note: SUGGESTION must follow immediately after HELP.

yet there's no concrete suggestion emitted.

r? @estebank
parser: Tweak function parameter parsing to avoid rollback on succesfull path

Since rollback is not perfect and may e.g. leave non-fatal errors after it, we need to make sure compilation fails if it happens.
So in particular case of `fn parse_arg_general` we need to parse the "good" `TYPE` first and only then rollback and recover erroneous `PAT: TYPE` if necessary.
Found when working on rust-lang/rfcs#2544 (comment).

r? @ghost
…tsakis

Compress `Liveness` data some more.

Profiling shows that the `(reader, writer, used)` triples used by
liveness analysis almost always have invalid `reader` and `writer`
fields. We can take advantage of this knowledge to use a compressed
representation for them, falling back to a secondary table for the
uncommon cases.

This change reduces instruction counts on numerous benchmarks, the best
by 16%. It also reduces max-rss on numerous benchmarks, the best by 38%.

The patch also renames these triples from `Users` to `RWU`, because it's
confusing having a type whose name is plural and then used within
vectors whose names are also plural.

r? @nikomatsakis
…Simulacrum

Simplify slice's first(_mut) and last(_mut) with get

This change makes these functions easier to read and interpret. I haven't detected any difference in performance locally.

r? @Mark-Simulacrum
@pietroalbini
Copy link
Member Author

@bors r+ p=16

@bors
Copy link
Contributor

bors commented Sep 22, 2018

📌 Commit 48ec53c has been approved by pietroalbini

@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 Sep 22, 2018
@bors
Copy link
Contributor

bors commented Sep 22, 2018

⌛ Testing commit 48ec53c with merge 5929185...

bors added a commit that referenced this pull request Sep 22, 2018
Rollup of 16 pull requests

Successful merges:

 - #53652 (define copy_within on slices)
 - #54261 (Make `dyn` a keyword in the 2018 edition)
 - #54280 (remove (more) CAS API from Atomic* types where not natively supported)
 - #54323 (rustbuild: drop color handling)
 - #54350 (Support specifying edition in doc test)
 - #54370 (Improve handling of type bounds in `bit_set.rs`.)
 - #54371 (add -Zui-testing to rustdoc)
 - #54374 (Make 'proc_macro::MultiSpan' public.)
 - #54402 (Use no_default_libraries for all NetBSD flavors)
 - #54409 (Detect `for _ in in bar {}` typo)
 - #54412 (add applicability to span_suggestion call)
 - #54413 (Add UI test for deref recursion limit printing twice)
 - #54415 (parser: Tweak function parameter parsing to avoid rollback on succesfull path)
 - #54420 (Compress `Liveness` data some more.)
 - #54422 (Simplify slice's first(_mut) and last(_mut) with get)
 - #54446 (Unify christianpoveda's emails)

Failed merges:

 - #54058 (Introduce the partition_dedup/by/by_key methods for slices)

r? @ghost
@bors
Copy link
Contributor

bors commented Sep 22, 2018

💔 Test failed - status-travis

@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 Sep 22, 2018
@rust-highfive
Copy link
Collaborator

The job arm-android 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:10:17] test [ui] ui/parser/expected-comma-found-token.rs ... ok
[01:10:17] test [ui] ui/parser-recovery-1.rs ... ok
[01:10:17] test [ui] ui/parser-recovery-2.rs ... ok
[01:10:17] test [ui] ui/panic-runtime/transitive-link-a-bunch.rs ... ok
[01:10:17] test [ui] ui/parser/if-in-in.rs ... ok
[01:10:17] test [ui] ui/partialeq_help.rs ... ok
[01:10:17] test [ui] ui/pattern/pat-shadow-in-nested-binding.rs ... ok
[01:10:17] test [ui] ui/pattern/pat-tuple-bad-type.rs ... ok
[01:10:17] test [ui] ui/pattern/pat-tuple-overfield.rs ... ok
---
[01:17:45] test [ui] ui/rust-2018/async-ident.rs ... ok
[01:17:45] test [ui] ui/run-pass/zero-sized/zero-sized-vec-push.rs ... ok
[01:17:46] test [ui] ui/run-pass/zero-sized/zero-sized-btreemap-insert.rs ... ok
[01:17:46] test [ui] ui/run-pass/zero-sized/zero-sized-vec-deque-push.rs ... ok
[01:17:46] test [ui] ui/rust-2018/dyn-trait-compatibility.rs ... ok
[01:17:46] test [ui] ui/rust-2018/dyn-keyword.rs ... ok
[01:17:46] test [ui] ui/rust-2018/edition-lint-nested-empty-paths.rs ... ok
[01:17:46] test [ui] ui/rust-2018/edition-lint-nested-paths.rs ... ok
[01:17:46] test [ui] ui/rust-2018/edition-lint-paths.rs ... ok
[01:17:46] test [ui] ui/rust-2018/extern-crate-idiomatic-in-2018.rs ... ok
---
[01:20:04] test [ui (nll)] ui/panic-runtime/transitive-link-a-bunch.rs ... ok
[01:20:04] test [ui (nll)] ui/parser/expected-comma-found-token.rs ... ok
[01:20:05] test [ui (nll)] ui/parser-recovery-2.rs ... ok
[01:20:05] test [ui (nll)] ui/parser/unclosed-braces.rs ... ok
[01:20:05] test [ui (nll)] ui/parser/if-in-in.rs ... ok
[01:20:05] test [ui (nll)] ui/pattern/pat-shadow-in-nested-binding.rs ... ok
[01:20:05] test [ui (nll)] ui/pattern/pat-tuple-bad-type.rs ... ok
[01:20:05] test [ui (nll)] ui/pattern/pat-tuple-overfield.rs ... ok
[01:20:05] test [ui (nll)] ui/pattern/patkind-litrange-no-expr.rs ... ok
---
[01:27:46] test [ui (nll)] ui/run-pass/zero-sized/zero-sized-tuple-struct.rs ... ok
[01:27:46] test [ui (nll)] ui/run-pass/zero-sized/zero-sized-linkedlist-push.rs ... ok
[01:27:46] test [ui (nll)] ui/rust-2018/async-ident-allowed.rs ... ok
[01:27:46] test [ui (nll)] ui/rust-2018/async-ident.rs ... ok
[01:27:47] test [ui (nll)] ui/rust-2018/dyn-keyword.rs ... ok
[01:27:47] test [ui (nll)] ui/rust-2018/dyn-trait-compatibility.rs ... ok
[01:27:47] test [ui (nll)] ui/run-pass/zero-sized/zero-sized-btreemap-insert.rs ... ok
[01:27:47] test [ui (nll)] ui/rust-2018/edition-lint-fully-qualified-paths.rs ... ok
[01:27:47] test [ui (nll)] ui/rust-2018/edition-lint-nested-empty-paths.rs ... ok
---
[01:41:50] test slice::test_chunks_mut_nth ... ok
[01:41:50] test slice::test_chunks_mut_zip ... ok
[01:41:50] test slice::test_chunks_nth ... ok
[01:41:50] test slice::test_chunks_zip ... ok
[01:41:50] test slice::test_copy_within ... ok
[01:41:50] test slice::test_copy_within_panics_dest_too_long ... ok
[01:41:50] test slice::test_copy_within_panics_src_inverted ... ok
[01:41:50] test slice::test_copy_within_panics_src_too_long ... ok
[01:41:50] test slice::test_exact_chunks_last ... ok
[01:41:50] test slice::test_exact_chunks_mut_count ... ok
[01:41:50] test slice::test_exact_chunks_mut_last ... ok
[01:41:50] test slice::test_exact_chunks_mut_nth ... ok
---
[01:43:44] test time::tests::system_time_elapsed ... ok
[01:43:44] test time::tests::system_time_math ... ok
[01:43:49] test sync::mpsc::tests::stress_recv_timeout_two_threads ... ok
[01:43:50] test collections::hash::map::test_map::test_lots_of_insertions ... ok
[01:44:24] test process::tests::test_process_output_fail_to_start ... test process::tests::test_process_output_fail_to_start has been running for over 60 seconds
No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

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)

@pietroalbini
Copy link
Member Author

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 22, 2018
@bors
Copy link
Contributor

bors commented Sep 22, 2018

⌛ Testing commit 48ec53c with merge af50e38...

bors added a commit that referenced this pull request Sep 22, 2018
Rollup of 16 pull requests

Successful merges:

 - #53652 (define copy_within on slices)
 - #54261 (Make `dyn` a keyword in the 2018 edition)
 - #54280 (remove (more) CAS API from Atomic* types where not natively supported)
 - #54323 (rustbuild: drop color handling)
 - #54350 (Support specifying edition in doc test)
 - #54370 (Improve handling of type bounds in `bit_set.rs`.)
 - #54371 (add -Zui-testing to rustdoc)
 - #54374 (Make 'proc_macro::MultiSpan' public.)
 - #54402 (Use no_default_libraries for all NetBSD flavors)
 - #54409 (Detect `for _ in in bar {}` typo)
 - #54412 (add applicability to span_suggestion call)
 - #54413 (Add UI test for deref recursion limit printing twice)
 - #54415 (parser: Tweak function parameter parsing to avoid rollback on succesfull path)
 - #54420 (Compress `Liveness` data some more.)
 - #54422 (Simplify slice's first(_mut) and last(_mut) with get)
 - #54446 (Unify christianpoveda's emails)

Failed merges:

 - #54058 (Introduce the partition_dedup/by/by_key methods for slices)

r? @ghost
@bors
Copy link
Contributor

bors commented Sep 22, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: pietroalbini
Pushing af50e38 to master...

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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet