From 3e9d3d917a988973d9c657a257029a9bd850f6dc Mon Sep 17 00:00:00 2001 From: DrMeepster <19316085+DrMeepster@users.noreply.github.com> Date: Fri, 13 May 2022 21:52:22 -0700 Subject: [PATCH] add From impls for BitSet and GrowableBitSet --- compiler/rustc_index/src/bit_set.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index 059755a743b..fb3df9f41ea 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -340,6 +340,12 @@ impl BitRelations> for BitSet { } } +impl From> for BitSet { + fn from(bit_set: GrowableBitSet) -> Self { + bit_set.bit_set + } +} + /// A fixed-size bitset type with a partially dense, partially sparse /// representation. The bitset is broken into chunks, and chunks that are all /// zeros or all ones are represented and handled very efficiently. @@ -1469,6 +1475,12 @@ impl GrowableBitSet { } } +impl From> for GrowableBitSet { + fn from(bit_set: BitSet) -> Self { + Self { bit_set } + } +} + /// A fixed-size 2D bit matrix type with a dense representation. /// /// `R` and `C` are index types used to identify rows and columns respectively;