about summary refs log tree commit diff
path: root/src/libserialize/json.rs
AgeCommit message (Collapse)AuthorLines
2020-06-02Rename directories for some compiler crates from `libx` to `librustc_x`Vadim Petrochenkov-2796/+0
libarena -> librustc_arena libfmt_macros -> librustc_parse_format libgraphviz -> librustc_graphviz libserialize -> librustc_serialize
2020-05-14linker: More systematic handling of CRT objectsVadim Petrochenkov-2/+2
2020-05-02Update src/libserialize/json.rsTshepang Lekhonkhobe-1/+1
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-05-01doc: make Stack and StackElement a little prettyTshepang Lekhonkhobe-4/+6
Also, fix rustdoc warnings.
2020-04-25Bump rustfmt to most recently shippedMark Rousskov-1/+1
2020-04-06Stop importing float module in libserializeLinus Färnstrand-1/+1
2019-12-24Deprecate Error::description for realDavid Tolnay-10/+2
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-22Format the worldMark Rousskov-347/+565
2019-10-01Fix clippy warningsYuki Okushi-11/+10
2019-07-07Address review comments + Fix rebaseVadim Petrochenkov-9/+7
2019-07-07syntax: Migrate built-in macros to the regular stability checkingVadim Petrochenkov-0/+2
2019-07-01Remove needless lifetimesJeremy Stucki-2/+2
2019-06-26Fix clippy::cast_loslessIgor Matuszewski-6/+6
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-1/+1
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-1/+1
2019-06-16Separate libserialize modulechansuke-136/+1
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-35/+35
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-10rustc: doc commentsAlexander Regueiro-35/+35
2019-02-09Cleanup importsTaiki Endo-1/+0
2019-02-09Move some tests into the tests directoryTaiki Endo-1281/+4
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-07Transition libserialize to 2018 editionHirokazu Hata-30/+30
2019-01-13Cosmetic improvementsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
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-09-11renamed emit_nil to emit_unitkenta7777-5/+5
2018-09-11Revert "renamed emit_nil to emit_unit"kenta7777-5/+5
This reverts commit d02a5ffaed9c395ae62ee12d0f4e04946c62edb1.
2018-09-11Revert "renamed read_nil to read_unit"kenta7777-1/+1
This reverts commit 37d0600c23ba1890346078bd7f310e15915417b2.
2018-09-10renamed read_nil to read_unitkenta7777-1/+1
2018-09-10renamed emit_nil to emit_unitkenta7777-5/+5
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-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-11A few cleanups for fmt_macros, graphviz, apfloat, target, serialize and termljedrz-30/+28
2018-08-01Documented impl From on line 367 of libserialize/json.rsStrategic Technologies-0/+3
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-27Prefer to_string() to format!()ljedrz-15/+15
2018-07-12Deny bare trait objects in src/libserializeljedrz-8/+8
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-11/+11
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-06-23Removed as many "```ignore" as possible.kennytm-1/+1
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-02-03Bump version, upgrade bootstrapAlex Crichton-2/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2016-12-30Implement emit_iu128 for json serialiserSimonas Kazlauskas-4/+4
Causes ICEs otherwise while trying to dump AST
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-0/+8
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
2016-10-31Changed most vec! invocations to use square bracesiirelu-3/+3
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-10Avoid allocations in `Decoder::read_str`.Nicholas Nethercote-4/+3
`opaque::Decoder::read_str` is very hot within `rustc` due to its use in the reading of crate metadata, and it currently returns a `String`. This commit changes it to instead return a `Cow<str>`, which avoids a heap allocation. This change reduces the number of calls to `malloc` by almost 10% in some benchmarks. This is a [breaking-change] to libserialize.
2016-09-28[breaking-change] std: change `encode_utf{8,16}()` to take a buffer and ↵tormol-3/+1
return a slice They panic if the buffer is too small.
2016-09-11Use question_mark feature in libserialize.Ahmed Charles-6/+5