Commit Graph

394 Commits

Author SHA1 Message Date
bors-servo 305ada1bdc Auto merge of #239 - mbrubeck:bump, r=jdm
Version 1.5.0

Change log:

* Add the `append` method (#237).
* Add support for more array sizes between 17 and 31 (#234).
* Don't panic on deserialization errors (#238).
2020-11-16 20:39:46 -05:00
Matt Brubeck 26f0d922a6 Version 1.5.0
Change log:

* Add the `append` method (#237).
* Add support for more array sizes between 17 and 31 (#234).
* Don't panic on deserialization errors (#238).
2020-11-16 10:25:41 -08:00
bors-servo 2abcb42939 Auto merge of #238 - epilys:master, r=mbrubeck
Return allocation error in deserialize instead of panicking

There's no way to catch allocation errors since out of memory errors
cause an abort. Fail gracefully by returning the error instead of
panicking.

I happened upon this error when deserializing untrusted data with bincode. Bincode provides a byte limit bound but for sequences it's not possible to enforce this through serde since collection types like smallvec handle their own allocation.
2020-11-08 18:59:27 -05:00
Manos Pitsidianakis 29941ba95c Return allocation error in deserialize instead of panicking
There's no way to catch allocation errors since out of memory errors
cause an abort. Fail gracefully by returning the error instead of
panicking.
2020-11-08 20:10:44 +02:00
bors-servo 271e8d082c Auto merge of #237 - mbrubeck:append, r=jdm
Add SmallVec::append method

Fixes #236.
2020-10-22 10:22:06 -04:00
Matt Brubeck 42b4e91e0f Add SmallVec::append method
Fixes #236.
2020-10-21 09:40:26 -07:00
bors-servo 3a085b52e8 Auto merge of #234 - thomcc:len_at_most_32, r=mbrubeck
Implement Array for all sizes <= 32

Most traits supported by arrays are fully supported for arrays in the Rust stdlib as for all sizes <= 32. I was surprised to find that `SmallVec<[T; 18]>` (I happen to know that 18 the maximum outside of obscure cases) isn't possible because smallvec::Array is not consistent with this pattern.

Of course, I don't actually need this — I can just choose another size, but it seems like it would be good/unsurprising to be a superset of libstd's choices here.
2020-09-08 16:28:14 -04:00
Matt Brubeck 9def79eaa8 Revert "Add cargo fmt to travis build config"
This reverts commit eed65addf8.
2020-09-08 13:26:40 -07:00
Thom Chiovoloni f8558b7b65 Implement Array for all sizes <= 32 2020-09-08 11:59:24 -07:00
bors-servo 31ac026bd5 Auto merge of #233 - mbrubeck:bump, r=jdm
Version 1.4.2

Changelog:

* `insert_many` no longer leaks elements if the provided iterator panics (#213).
* The unstable `const_generics` and `specialization` features are updated to work with the most recent nightly Rust toolchain (#232).
* Internal code cleanup (#229, #231).

This PR also changes the `author` field in `Cargo.toml` to "The Servo Project Developers".
2020-08-11 19:04:05 -04:00
Matt Brubeck cd32126e72 Version 1.4.2
* `insert_many` no longer leaks elements if the provided iterator panics (#213).
* The unstable `const_generics` and `specialization` features are
  updated to work with the most recent nightly Rust toolchain (#232).
* Internal code cleanup (#229, #231).
2020-08-11 15:27:07 -07:00
bors-servo 8f2005bea0 Auto merge of #232 - c410-f3r:patch-1, r=mbrubeck
Use min_const_generics
2020-08-11 12:08:53 -04:00
Caio 04373d11f1 Use min_const_generics 2020-08-08 21:47:30 -03:00
bors-servo 8db9f2daba Auto merge of #230 - Atul9:add-cargo-fmt-to-travis-config, r=mbrubeck
Add cargo fmt to travis build config

The build failure is fixed in this PR https://github.com/servo/rust-smallvec/pull/231 hence #231 should be merged first.
2020-07-13 13:31:06 -04:00
bors-servo 0edaaa0915 Auto merge of #231 - Atul9:cargo-fmt, r=mbrubeck
Format code using 'cargo fmt'
2020-07-13 13:11:24 -04:00
Atul Bhosale 149260d230 Format code using 'cargo fmt' 2020-07-11 22:22:56 +05:30
Atul Bhosale eed65addf8 Add cargo fmt to travis build config 2020-07-10 23:22:36 +05:30
bors-servo dbe12424ea Auto merge of #213 - mbrubeck:leak, r=jdm
Fix leak on panic in `insert_many`.

Fixes #208 and reverts the workaround added in #209. CC @RalfJung.
2020-07-08 17:20:56 -04:00
Matt Brubeck 13c568817c Fix leak on panic in insert_many.
Fixes #208.
2020-07-07 14:32:16 -07:00
bors-servo 0d9f9348c9 Auto merge of #229 - mbrubeck:src, r=jdm
Move source files into src directory

This moves the `tests` module into a separate file, and moves all source files into a `src` directory, to conform with the default layout for Rust projects.
2020-07-07 15:57:14 -04:00
Matt Brubeck 117987f93e Move source files into src directory 2020-07-07 11:39:58 -07:00
bors-servo edd131c468 Auto merge of #228 - servo:zero, r=jdm
Don’t heap-allocate for zero-size items

Allocating zero bytes is Undefined Behavior.
CC https://github.com/servo/servo/pull/26304#issuecomment-653626058
2020-07-06 10:09:08 -04:00
Simon Sapin f15edfcd6e Don’t heap-allocate for zero-size items
Allocating zero bytes is Undefined Behavior.
CC https://github.com/servo/servo/pull/26304#issuecomment-653626058
2020-07-06 16:06:13 +02:00
bors-servo 90728d3a6b Auto merge of #227 - SamuelMarks:rustfmt, r=mbrubeck
[*.rs] rustfmt
2020-06-29 14:55:08 -04:00
Samuel Marks 3f40777228 [*.rs] rustfmt 2020-06-29 11:50:38 +10:00
bors-servo 65663fd560 Auto merge of #225 - mbrubeck:docs, r=emilio
Update and document serde support

* Document the optional 'serde' feature. Fixes #224.
* Disable unused serde features. This makes serde support compatible with `no_std`.
2020-06-07 00:53:29 -04:00
Matt Brubeck 3d9cc9a950 Document the optional 'serde' feature 2020-06-05 15:34:36 -07:00
Matt Brubeck 94872b71fd Disable unused serde features
This makes serde support compatible with no_std.
2020-06-05 13:18:40 -07:00
bors-servo 9bc08d6f1d Auto merge of #223 - Luro02:docs, r=emilio
Link to tracking issues for unstable features
2020-05-22 08:06:20 -04:00
Luro02 3987866a58 Link to tracking issues for unstable features 2020-05-22 09:53:22 +02:00
bors-servo a0581061a5 Auto merge of #222 - mbrubeck:unused_mut, r=emilio
Silence unused_mut warning on smallvec! macro with no args

None
2020-05-17 06:17:27 -04:00
Matt Brubeck a42ad0541f Silence unused_mut warning on smallvec! macro with no args 2020-05-16 10:20:28 -07:00
bors-servo 30bf0ae4e5 Auto merge of #221 - cuviper:crate-macro, r=mbrubeck
Make sure smallvec! is usable without being in scope

Macro recursion should use a `$crate` prefix to reliably find itself.
2020-05-06 19:29:49 -04:00
Josh Stone df6fb60f84 Make sure smallvec! is usable without being in scope
Macro recursion should use a `$crate` prefix to reliably find itself.
2020-05-06 15:20:57 -07:00
bors-servo cc63b0b1b6 Auto merge of #218 - l0calh05t:resize_with, r=mbrubeck
Add resize_with

`std::vec::Vec` added `resize_with` in Rust 1.33. This patch adds the equivalent to `SmallVec`.
2020-04-30 17:04:06 -04:00
l0calh05t 6fa922f81f Add resize_with 2020-04-30 16:31:27 +02:00
bors-servo 2a4f9a78cd Auto merge of #216 - Alexendoo:clone-slice-from, r=mbrubeck
Implement Clone using From

This allows using the specialization in clones when it's enabled
2020-04-25 13:01:44 -04:00
Alex Macleod 32c535a06d Implement Clone using From
This allows using the specialization in clones when it's enabled
2020-04-25 16:08:27 +01:00
bors-servo 50f66f8285 Auto merge of #211 - mbrubeck:deprecate, r=jdm
Deprecate and hide ExtendFromSlice trait

This trait is only needed for internal benchmarking and should not have been public.  It will be removed in version 2.0.
2020-04-23 13:00:19 -04:00
bors-servo c23471683e Auto merge of #214 - servo:try_reserve, r=nox
Add `try_reserve` and friends

This more cleanly replaces this hack adding fallible allocation from outside the crate:

https://github.com/servo/servo/blob/faa9dccfe8/components/fallible/lib.rs#L101-L163
2020-04-23 07:59:21 -04:00
Simon Sapin 62e90c9251 Early returns 2020-04-23 13:58:43 +02:00
Simon Sapin 125580a76d Use realloc when possible 2020-04-23 01:22:54 +02:00
Simon Sapin d9313a4ad6 Add try_reserve and friends 2020-04-23 01:22:54 +02:00
Simon Sapin 1d115c2463 Stop using Vec as an allocator 2020-04-23 01:22:54 +02:00
Matt Brubeck c76756b473 Deprecate and hide ExtendFromSlice trait
This trait is only needed for internal benchmarking and should not have
been public.  It will be removed in version 2.0.
2020-04-22 13:50:48 -07:00
bors-servo 3183a5d7da Auto merge of #212 - mbrubeck:fuzz, r=jdm
Fuzzing fixes for CI

None
2020-04-22 16:19:20 -04:00
Matt Brubeck e64617e2c2 Ignore fuzz target directory 2020-04-22 12:44:08 -07:00
Matt Brubeck c128efd31f Pin honggfuzz to 0.5.47 2020-04-22 12:42:04 -07:00
bors-servo d32ed9cf32 Auto merge of #209 - RalfJung:miri, r=mbrubeck
enable Miri leak checker

Works around https://github.com/servo/rust-smallvec/issues/208
2020-04-11 14:07:45 -04:00
Ralf Jung 4420fc3cc5 note the leak in insert_many docs 2020-04-11 09:11:35 +02:00