about summary refs log tree commit diff
path: root/src/libserialize
AgeCommit message (Collapse)AuthorLines
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
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-1/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-02Fix Decodable impl for ArcJohn Kåre Alsaker-1/+1
2018-01-20Auto merge of #46919 - michaelwoerister:new-leb128, r=sfacklerbors-81/+144
Speed up leb128 encoding and decoding for unsigned values. Make the implementation for some leb128 functions potentially faster. @Mark-Simulacrum, could you please trigger a perf.rlo run?
2018-01-09[incremental] Specialize encoding and decoding of FingerprintsWesley Wiser-3/+4
This saves the storage space used by about 32 bits per `Fingerprint`. On average, this reduces the size of the `/target/{mode}/incremental` folder by roughly 5%. Fixes #45875
2018-01-09Make leb128 coding a bit faster.Michael Woerister-81/+144
2018-01-06Add raw bytes functionsWesley Wiser-0/+14
Part of #45875
2017-12-30Add trailing newlines to files which have no trailing newlines.kennytm-1/+1
2017-12-23Auto merge of #46881 - michaelwoerister:ensure-coherence, r=nikomatsakisbors-0/+48
incr.comp.: Cache check_match and use ensure() for coherence-related queries. Some minor optimizations. r? @nikomatsakis
2017-12-21Add Encodable and Decodable impls for Arc<[T]>John Kåre Alsaker-0/+24
2017-12-20Implement Encodable and Decodable for Result.Michael Woerister-0/+48
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-12-01incr.comp.: Load diagnostics from previous session lazily and clean up ↵Michael Woerister-0/+4
on-disk-cache persistence code.
2017-11-28incr.comp.: Make a bunch of query results encodable.Michael Woerister-0/+24
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-3/+0
Fixes #41701.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-4/+4
Like #43008 (f668999), but _much more aggressive_.
2017-07-23Fix some doc/comment typos.Bruce Mitchener-2/+2
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-06-19Bump version and stage0 compilerAlex Crichton-4/+0
2017-06-13Merge crate `collections` into `alloc`Murarth-4/+1
2017-05-11rustc: Remove #![unstable] annotationAlex Crichton-3/+3
These are now no longer necessary with `-Z force-unstable-if-unmarked`
2017-02-10Only SwitchInt over integers, not all constsSimonas Kazlauskas-0/+28
Also use a Cow to avoid full Vec for all SwitchInts
2017-02-03Bump version, upgrade bootstrapAlex Crichton-16/+1
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.
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-30/+0
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-22Remove unused `extern crate`s.Jeffrey Seyfried-8/+0
2017-01-22Warn on unused `#[macro_use]` imports.Jeffrey Seyfried-1/+1
2017-01-08Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrcbors-1/+1
Remove not(stage0) from deny(warnings) Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-30Fix rebase fallout and compilation fixesest31-2/+2
2016-12-30Implement emit_iu128 for json serialiserSimonas Kazlauskas-4/+4
Causes ICEs otherwise while trying to dump AST
2016-12-30impl Step for iu128Simonas Kazlauskas-10/+1
Also fix the leb128 tests
2016-12-30Fix LEB128 to work with the stage1Simonas Kazlauskas-24/+24
Stage 1 can’t really handle negative 128-bit literals, but an equivalent bit-not is fine
2016-12-30Such large. Very 128. Much bits.Simonas Kazlauskas-32/+97
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-12-29Remove not(stage0) from deny(warnings)Alex Crichton-1/+1
Historically this was done to accommodate bugs in lints, but there hasn't been a bug in a lint since this feature was added which the warnings affected. Let's completely purge warnings from all our stages by denying warnings in all stages. This will also assist in tracking down `stage0` code to be removed whenever we're updating the bootstrap compiler.
2016-12-15Use StableHasher everywhereAriel Ben-Yehuda-14/+40
The standard implementations of Hasher have architecture-dependent results when hashing integers. This causes problems when the hashes are stored within metadata - metadata written by one host architecture can't be read by another. To fix that, implement an architecture-independent StableHasher and use it in all places an architecture-independent hasher is needed. Fixes #38177.
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-1/+1
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-1/+1
Fixes #26554.
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.