about summary refs log tree commit diff
path: root/src/libserialize/serialize.rs
AgeCommit message (Collapse)AuthorLines
2020-06-02Rename directories for some compiler crates from `libx` to `librustc_x`Vadim Petrochenkov-1015/+0
libarena -> librustc_arena libfmt_macros -> librustc_parse_format libgraphviz -> librustc_graphviz libserialize -> librustc_serialize
2020-04-02Add hash of source files in debug infoArlo Siemsen-0/+24
* Adds either an MD5 or SHA1 hash to the debug info. * Adds new unstable option `-Z src-hash-algorithm` to control the hashing algorithm.
2020-02-18Inline various simple `emit_*` and `read_*` methods in `Decoder`.Nicholas Nethercote-0/+19
Mostly, these are the ones whose body just contains `f(self)`.
2019-12-22Format the worldMark Rousskov-113/+157
2019-07-24Stabilize the type_name intrinsic in core::anySteven Fackler-3/+3
Closes rust-lang/rfcs#1428
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-9/+9
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-10Rollup merge of #59600 - tobia:master, r=pnkfelixMazdak Farrokhzad-5/+12
Replaced linear token counting macros with optimized implementation There are currently two distinct token-counting macros in the source. Both implement the trivial algorithm, with linear complexity. They may or may not be adequate for their use case, but considering that other people are probably going to copy and paste them whenever they need a token-counting macro, I replaced them with an optimized implementation with logarithmic complexity.
2019-05-07serialize: add missing Encodable impl for Path.Eduard-Mihai Burtescu-1/+7
2019-04-13Replaced linear token counting macros with optimized implementationTobia-5/+12
2019-04-10Remove useless ?Sized boundJohn Kåre Alsaker-2/+2
2019-04-05Impl UseSpecializedDecodable for &TJohn Kåre Alsaker-0/+1
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-1/+1
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-1/+1
2019-02-07Transition libserialize to 2018 editionHirokazu Hata-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
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-11renamed emit_nil to emit_unitkenta7777-2/+2
2018-09-11Revert "renamed emit_nil to emit_unit"kenta7777-2/+2
This reverts commit d02a5ffaed9c395ae62ee12d0f4e04946c62edb1.
2018-09-11Revert "renamed read_nil to read_unit"kenta7777-2/+2
This reverts commit 37d0600c23ba1890346078bd7f310e15915417b2.
2018-09-10renamed read_nil to read_unitkenta7777-2/+2
2018-09-10renamed emit_nil to emit_unitkenta7777-2/+2
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-17Remove inline attribute on generic functionsBurntPizza-105/+3
2018-08-15Mark libserialize functions as inlineBurntPizza-0/+103
2018-07-27Improve readability of serialize.rsljedrz-83/+116
2018-03-02Fix Decodable impl for ArcJohn Kåre Alsaker-1/+1
2017-12-20Implement Encodable and Decodable for Result.Michael Woerister-0/+48
2017-07-23Fix some doc/comment typos.Bruce Mitchener-2/+2
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-5/+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-30Such large. Very 128. Much bits.Simonas Kazlauskas-0/+33
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-10Avoid allocations in `Decoder::read_str`.Nicholas Nethercote-2/+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-20serialize: allow specifying the default behavior for specializations.Eduard Burtescu-17/+19
2016-09-20Remove librbml and the RBML-tagged auto-encoder/decoder.Eduard Burtescu-63/+131
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-44/+0
2016-09-20serialize: extend with specialization-based encoding/decoding multi-dispatch.Eduard Burtescu-0/+95
2016-09-11Use question_mark feature in libserialize.Ahmed Charles-4/+4
2016-08-25Rename {uint,int} methods to {usize,isize}.Corey Farwell-8/+8
2016-03-22try! -> ?Jorge Aparicio-14/+14
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2015-09-08some more clippy-based improvementsAndre Bogus-1/+1
2015-08-12Fallout in libs -- misc missing bounds uncovered by WF checks.Niko Matsakis-1/+1
2015-04-14std: Remove old_io/old_path/rand modulesAlex Crichton-32/+0
This commit entirely removes the old I/O, path, and rand modules. All functionality has been deprecated and unstable for quite some time now!
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-43/+43
Now that support has been removed, all lingering use cases are renamed.
2015-03-23Add generic conversion traitsAaron Turon-1/+1
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-1/+1
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-12Stabilize std::pathAaron Turon-0/+5
This commit stabilizes essentially all of the new `std::path` API. The API itself is changed in a couple of ways (which brings it in closer alignment with the RFC): * `.` components are now normalized away, unless they appear at the start of a path. This in turn effects the semantics of e.g. asking for the file name of `foo/` or `foo/.`, both of which yield `Some("foo")` now. This semantics is what the original RFC specified, and is also desirable given early experience rolling out the new API. * The `parent` function now succeeds if, and only if, the path has at least one non-root/prefix component. This change affects `pop` as well. * The `Prefix` component now involves a separate `PrefixComponent` struct, to better allow for keeping both parsed and unparsed prefix data. In addition, the `old_path` module is now deprecated. Closes #23264 [breaking-change]
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-0/+14
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-1/+1
2015-02-03Rename std::path to std::old_pathAaron Turon-9/+9
As part of [RFC 474](https://github.com/rust-lang/rfcs/pull/474), this commit renames `std::path` to `std::old_path`, leaving the existing path API in place to ease migration to the new one. Updating should be as simple as adjusting imports, and the prelude still maps to the old path APIs for now. [breaking-change]