rust/src/libserialize
Nicholas Nethercote 99f05e800e 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. 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.
2018-09-20 08:52:41 +10:00
..
Cargo.toml Use optimized SmallVec implementation 2018-08-23 10:45:53 +03:00
collection_impls.rs Use optimized SmallVec implementation 2018-08-23 10:45:53 +03:00
hex.rs
json.rs renamed emit_nil to emit_unit 2018-09-11 23:32:41 +09:00
leb128.rs
lib.rs stabalize infer outlives requirements (RFC 2093). 2018-09-11 11:40:04 -04:00
opaque.rs renamed emit_nil to emit_unit 2018-09-11 23:32:41 +09:00
serialize.rs Improve handling of type bounds in bit_set.rs. 2018-09-20 08:52:41 +10:00