Skip to content

deprecate BitSet and BitVec #26034

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 2 commits into from
Jul 1, 2015
Merged

deprecate BitSet and BitVec #26034

merged 2 commits into from
Jul 1, 2015

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Jun 5, 2015

I've mirrored them out to crates (bit-vec and bit-set) that build on stable.

(not sure if this actually correctly deprecates them in std)

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

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

@Gankra
Copy link
Contributor Author

Gankra commented Jun 5, 2015

cc @rust-lang/libs

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned nikomatsakis Jun 5, 2015
@Gankra
Copy link
Contributor Author

Gankra commented Jun 5, 2015

.. it appears to not have.

throws up hands in disgust

@BurntSushi
Copy link
Member

👍

@Gankra
Copy link
Contributor Author

Gankra commented Jun 5, 2015

Oh yeah, I meant to write up the motivation for this. I guess I woke up this morning and was just like "well obviously everyone knows why we should do this".

BitVec and BitSet are marked unstable still because they have several outstanding design problems:

  • Indexing is a hack based on defining TRUE and FALSE statics
  • BitVec and BitSet are highly tangled because BitSet requires more low-level access to do effecient bulk
    manipulation of the raw blocks. This suggests we should expose the blocks as an interface. However that would "lock in" the representation of the structure to Vec<u32>. Marshalling through bits and bytes is a lot of work.
  • Misc uncertainties over panic semantics
  • Misc uncertainties over naming

None of these are a real problem in a crate where we can expose janky interfaces and rename whimsically.

While I agree that a collection of bits is a very useful datastructure, I'd argue the standard collections library should be small, focusing on The Big Dogs of datastructuring. Vec, HashMap, SortedMap, RingBuf, LinkedList.

@alexcrichton
Copy link
Member

I'm all for this!

.. it appears to not have.

You'll need to put the #[deprecated] annotations on the source instead of the reexport (e.g. in libcollections)

@aturon
Copy link
Member

aturon commented Jun 8, 2015

(Note for those following at home: this is blocked on #26040, which @gankro has a PR for that will be reviewed shortly.)

@@ -81,12 +81,11 @@
return;
}

if (e.which === 191) { // question mark
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a rebase gone wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, whoops!

@aturon
Copy link
Member

aturon commented Jun 30, 2015

Is this ready to go now that the stability lint has been fixed? Probably worth testing a fresh/rebased build to make sure it's working properly.

@Gankra Gankra force-pushed the deprecate-bits branch 2 times, most recently from 0b43e2a to 5d8a756 Compare July 1, 2015 00:06
@Gankra
Copy link
Contributor Author

Gankra commented Jul 1, 2015

updated

@Gankra
Copy link
Contributor Author

Gankra commented Jul 1, 2015

cc @jroesch for where we still use these

@jroesch
Copy link
Member

jroesch commented Jul 1, 2015

@gankro the only remaining place is the one we talked about on IRC earlier for attributes. I think if we just move a copy of the implementation into librustc_data_structures we can allow the deprecation then removal of them from the standard library. Then I can take care of them on our end in a separate pass.

@Gankra
Copy link
Contributor Author

Gankra commented Jul 1, 2015

@jroesch I also found it in librustc_lint. I missed it before as the compile error'd out on the first one and stopped.

@Gankra
Copy link
Contributor Author

Gankra commented Jul 1, 2015

@bors r=alexcrichton

@bors
Copy link
Collaborator

bors commented Jul 1, 2015

📌 Commit 7850c8d has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Jul 1, 2015

⌛ Testing commit 7850c8d with merge 8a599c8...

bors added a commit that referenced this pull request Jul 1, 2015
I've mirrored them out to crates (bit-vec and bit-set) that build on stable.

(not sure if this actually correctly deprecates them in std)
@bors bors merged commit 7850c8d into rust-lang:master Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants