Skip to content

Remove bitslice.rs #54177

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

Merged
merged 3 commits into from
Sep 15, 2018
Merged

Remove bitslice.rs #54177

merged 3 commits into from
Sep 15, 2018

Conversation

nnethercote
Copy link
Contributor

As the comment in bitslice.rs says:

FIXME: merge with bitvec

So that the `BitArray` code is all together and before the `BitVector`
code, instead of being awkwardly interleaved.
This requires the following changes.

- It moves parts of bitslice.rs into bitvec.rs: `bitwise()`,
  `BitwiseOperator`, `bits_to_string()`.

- It changes `IdxSet` to just be a wrapper around `BitArray`.

- It changes `BitArray` and `BitVec` to use `usize` words instead of
  `u128` words. (`BitSlice` and `IdxSet` already use `usize`.) Local
  profiling showed `usize` was better.

- It moves some operations from `IdxSet` into `BitArray`:
  `new_filled()`, `clear()`, `set_up_to()`, `trim_to()` (renamed
  `clear_above()`), `words()` and `words_mut()`, `encode()` and
  `decode(). The `IdxSet` operations now just call the `BitArray`
  operations.

- It replaces `BitArray`'s iterator implementation with `IdxSet`'s,
  because the latter is more concise. It also removes the buggy
  `size_hint` function from `BitArray`'s iterator, which counted the
  number of *words* rather than the number of *bits*. `IdxSet`'s
  iterator is now just a thin wrapper around `BitArray`'s iterator.

- It moves some unit tests from `indexed_set.rs` to `bitvec.rs`.
@rust-highfive
Copy link
Contributor

r? @zackmdavis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 13, 2018
@nnethercote
Copy link
Contributor Author

Local benchmarking runs showed that this change had no effect on performance.

@nnethercote
Copy link
Contributor Author

r? @Mark-Simulacrum on the updated changes.

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 13, 2018

📌 Commit e38b31eb6e6e4b564ecb36956a29d05e6921ce24 has been approved by Mark-Simulacrum

@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 13, 2018
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-5.0 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.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/e3/12/92bd3655f436aa009688e7ccb8b7581554fb64278d111f5845e79da8e618/awscli-1.16.14-py2.py3-none-any.whl (1.3MB)
    0% |▎                               | 10kB 11.8MB/s eta 0:00:01
    1% |▌                               | 20kB 1.9MB/s eta 0:00:01
    2% |▊                               | 30kB 2.2MB/s eta 0:00:01
    3% |█                               | 40kB 2.0MB/s eta 0:00:01
---
[00:13:17]    Compiling rustc_traits v0.0.0 (file:///checkout/src/librustc_traits)
[00:13:18] error[E0432]: unresolved import `rustc_data_structures::indexed_set::Iter`
[00:13:18]   --> librustc_mir/borrow_check/flows.rs:18:5
[00:13:18]    |
[00:13:18] 18 | use rustc_data_structures::indexed_set::Iter;
[00:13:18]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `Iter` in `indexed_set`
[00:13:18] error[E0432]: unresolved import `rustc_data_structures::indexed_set::Iter`
[00:13:18] error[E0432]: unresolved import `rustc_data_structures::indexed_set::Iter`
[00:13:18]   --> librustc_mir/dataflow/at_location.rs:15:64
[00:13:18]    |
[00:13:18] 15 | use rustc_data_structures::indexed_set::{HybridIdxSet, IdxSet, Iter};
[00:13:18]    |                                                                ^^^^ no `Iter` in `indexed_set`
[00:13:28] error: aborting due to 2 previous errors
[00:13:28] 
[00:13:28] For more information about this error, try `rustc --explain E0432`.
[00:13:28] error: Could not compile `rustc_mir`.
[00:13:28] error: Could not compile `rustc_mir`.
[00:13:28] 
[00:13:28] Caused by:
[00:13:28]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_mir librustc_mir/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=9389ef21a7981207 -C extra-filename=-9389ef21a7981207 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern arena=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libarena-93ff3b002b18b7ed.so --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-5a39798fe03e47f4.rlib --extern byteorder=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbyteorder-8246be02936c9b1b.rlib --extern either=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libeither-0a515e87c8afea9e.rlib --extern graphviz=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libgraphviz-45ae4394366d07fd.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-c55d6c95192e4906.rlib --extern log_settings=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog_settings-87ec950697a15ed0.rlib --extern polonius_engine=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libpolonius_engine-218f3033f29f5493.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-09c0f3a89ad0d6b5.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-96aac12abd62414d.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-05301c67193a930e.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-f4ac364f854372fe.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-4a08b81d2b6640c1.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8d84add221c0f710.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-8d84add221c0f710.rlib --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-cb741677cd0e0351.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-0651ffc5a9129db1.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-47b99ffec2efbd05.so -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-ee16f6821aef40e9/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-52504d5ed57fefc2/out` (exit code: 1)
[00:14:37] error: build failed
[00:14:37] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:14:37] expected success, got: exit code: 101
[00:14:37] expected success, got: exit code: 101
[00:14:37] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1155:9
[00:14:37] travis_fold:end:stage0-rustc

[00:14:37] travis_time:end:stage0-rustc:start=1536876960878904047,finish=1536877496822500782,duration=535943596735


[00:14:37] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:14:37] Build completed unsuccessfully in 0:09:49
[00:14:37] make: *** [all] Error 1
[00:14:37] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2177207e
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

Because they're just thin wrappers around `BitIter` and `slice::Iter`.
@nnethercote
Copy link
Contributor Author

@Mark-Simulacrum: I fixed the compile errors.

@Mark-Simulacrum
Copy link
Member

@bors r+ delegate+

@bors
Copy link
Collaborator

bors commented Sep 13, 2018

✌️ @nnethercote can now approve this pull request

@bors
Copy link
Collaborator

bors commented Sep 13, 2018

📌 Commit 56be2af has been approved by Mark-Simulacrum

@nnethercote
Copy link
Contributor Author

r=Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Sep 15, 2018

⌛ Testing commit 56be2af with merge 7896af9...

bors added a commit that referenced this pull request Sep 15, 2018
…acrum

Remove bitslice.rs

As the comment in `bitslice.rs` says:

> FIXME: merge with `bitvec`
@bors
Copy link
Collaborator

bors commented Sep 15, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Mark-Simulacrum
Pushing 7896af9 to master...

@bors bors merged commit 56be2af into rust-lang:master Sep 15, 2018
@nnethercote nnethercote deleted the streamline-bit-stuff branch September 16, 2018 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants