about summary refs log tree commit diff
path: root/src/libserialize
AgeCommit message (Collapse)AuthorLines
2019-04-05Introduce an arena type which may be used to allocate a list of types with ↵John Kåre Alsaker-1/+1
destructors
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-37/+37
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12Rollup merge of #58318 - taiki-e:libserialize-2018, r=CentrilMazdak Farrokhzad-1609/+1607
libserialize => 2018 Transitions `libserialize` to Rust 2018; cc #58099 This includes a commit from #58252 (thanks @h-michael!) r? @Centril
2019-02-10rustc: doc commentsAlexander Regueiro-37/+37
2019-02-09Cleanup importsTaiki Endo-3/+2
2019-02-09Move some tests into the tests directoryTaiki Endo-1570/+1568
This moves tests in opaque.rs and tests other than tests that require private items in json.rs into tests/opaque.rs and tests/json.rs.
2019-02-07Remove images' url to make it work even without internet connectionGuillaume Gomez-3/+1
2019-02-07Transition libserialize to 2018 editionHirokazu Hata-41/+42
2019-01-13Cosmetic improvementsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-70/+0
2018-12-21Inline tweaksJohn Kåre Alsaker-0/+1
2018-12-12Bump to 1.33.0Alex Crichton-1/+1
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-10Upgrade `smallvec` to 0.6.7 and use the new `may_dangle` feature.Nicholas Nethercote-1/+1
2018-11-21serialize: preallocate VecDeque in Decodable::decodeljedrz-1/+1
2018-11-13A few tweaks to iterations/collectingljedrz-1/+1
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-20Improve handling of type bounds in `bit_set.rs`.Nicholas Nethercote-0/+14
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-14Rollup merge of #54095 - kenta7777:kenta7777#53719, r=davidtwcokennytm-8/+8
Rename all mentions of `nil` to `unit` Fixes #53719. Renamed keywords nil to unit.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-11renamed emit_nil to emit_unitkenta7777-8/+8
2018-09-11Revert "renamed emit_nil to emit_unit"kenta7777-8/+8
This reverts commit d02a5ffaed9c395ae62ee12d0f4e04946c62edb1.
2018-09-11Revert "renamed read_nil to read_unit"kenta7777-4/+4
This reverts commit 37d0600c23ba1890346078bd7f310e15915417b2.
2018-09-10renamed read_nil to read_unitkenta7777-4/+4
2018-09-10renamed emit_nil to emit_unitkenta7777-8/+8
2018-09-07rewrite constants to use NewType::MAX instead of u32::MAXNiko Matsakis-0/+13
Also, adjust the MAX to be `u32::MAX - 1`, leaving room for `u32::MAX` to become a sentinel value in the future.
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23Use optimized SmallVec implementationIgor Gutorov-0/+37
2018-08-21Rollup merge of #53393 - BurntPizza:serialize-inlines, r=alexcrichtonkennytm-20/+23
Mark libserialize functions as inline Got to thinking: "what if that big pile of tiny functions isn't inlining as it should?" So a few `replace-regex` later the local perf run says this: <details> ![](https://i.imgur.com/gvdJEgG.png) </details> Not huge, but still a win, which is interesting. Want to verify with the real perf run, but I understand there's a backlog. I didn't notice any increase in compile time or binary sizes for rustc/libs.
2018-08-17Remove inline attribute on generic functionsBurntPizza-138/+18
2018-08-17Rollup merge of #53313 - llogiq:two-small-improvements, r=estebankkennytm-4/+3
Two small improvements In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to simplify the code. In `libserialize/json.rs`, make use of the fact that `Vec.last` on an empty `Vec` returns `None` to simplify the code to a single match.
2018-08-17Rollup merge of #52946 - Ajacmac:doc-impl-from, r=GuillaumeGomezkennytm-0/+3
Documented impl From on line 367 of libserialize/json.rs This is for the impl From mentioned in #51430 assigned to @skade . Hopefully I didn't miss anything/get anything wrong. I looked over another PR for another part of this same issue to see what the proper formatting was, etc. Thanks!
2018-08-15Mark libserialize functions as inlineBurntPizza-0/+123
2018-08-15Two small improvementsAndre Bogus-4/+3
In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to simplify the code. In `libserialize/json.rs`, make use of the fact that `Vec.last` on an empty `Vec` returns `None` to simplify the code to a single match.
2018-08-14Corrected typing description in docJacob-1/+1
2018-08-14Rollup merge of #53246 - ljedrz:cleanup_various, r=kennytmkennytm-33/+31
A few cleanups - change `skip(1).next()` to `nth(1)` - collapse some `if-else` expressions - remove a few explicit `return`s - remove an unnecessary field name - dereference once instead of matching on multiple references - prefer `iter().enumerate()` to indexing with `for` - remove some unnecessary lifetime annotations - use `writeln!()` instead of `write!()`+`\n` - remove redundant parentheses - shorten some enum variant names - a few other cleanups suggested by `clippy`
2018-08-11A few cleanups for fmt_macros, graphviz, apfloat, target, serialize and termljedrz-33/+31
2018-08-09[nll] libserialize: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-01Documented impl From on line 367 of libserialize/json.rsStrategic Technologies-0/+3
2018-08-01Rollup merge of #52778 - ljedrz:readable_serialize, r=kennytmPietro Albini-83/+116
Improve readability of serialize.rs
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-9/+3
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-9/+3
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-15/+15
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-27Improve readability of serialize.rsljedrz-83/+116
2018-07-27Prefer to_string() to format!()ljedrz-15/+15
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-2/+2
2018-07-12Deny bare trait objects in src/libserializeljedrz-8/+10
2018-06-27Make opaque::Encoder append-only and make it infallibleJohn Kåre Alsaker-55/+34
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-14/+14
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517