about summary refs log tree commit diff
path: root/src/libserialize
AgeCommit message (Collapse)AuthorLines
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-206/+209
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-34/+32
2014-04-15Use the unsigned integer types for bitwise intrinsics.Huon Wilson-2/+2
Exposing ctpop, ctlz, cttz and bswap as taking signed i8/i16/... is just exposing the internal LLVM names pointlessly (LLVM doesn't have "signed integers" or "unsigned integers", it just has sized integer types with (un)signed *operations*). These operations are semantically working with raw bytes, which the unsigned types model better.
2014-04-11Decode non-BMP hex escapes in JSONKeegan McAllister-25/+65
Fixes #13064.
2014-04-11libtest: rename `BenchHarness` to `Bencher`Liigo Zhuang-27/+27
Closes #12640
2014-04-10auto merge of #13440 : huonw/rust/strbuf, r=alexcrichtonbors-12/+16
libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it. Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269
2014-04-10std,serialize: remove some internal uses of ~[].Huon Wilson-3/+2
These are all private uses of ~[], so can easily & non-controversially be replaced with Vec.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-12/+16
port all code over to use it.
2014-04-06De-~[] Mem{Reader,Writer}Steven Fackler-9/+9
2014-04-06De-~[] Reader and WriterSteven Fackler-2/+2
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-04-03auto merge of #13296 : brson/rust/0.11-pre, r=alexcrichtonbors-1/+1
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13290 : alexcrichton/rust/rollup, r=alexcrichtonbors-3/+3
Closes #13285 (rustc: Stop using LLVMGetSectionName) Closes #13280 (std: override clone_from for Vec.) Closes #13277 (serialize: add a few missing pubs to base64) Closes #13275 (Add and remove some ignore-win32 flags) Closes #13273 (Removed managed boxes from libarena.) Closes #13270 (Minor copy-editing for the tutorial) Closes #13267 (fix Option<~ZeroSizeType>) Closes #13265 (Update emacs mode to support new `#![inner(attribute)]` syntax.) Closes #13263 (syntax: Remove AbiSet, use one Abi)
2014-04-03Bump version to 0.11-preBrian Anderson-1/+1
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13286 : alexcrichton/rust/release, r=brsonbors-1/+1
Merging the 0.10 release into the master branch.
2014-04-03serialize: add a few missing pubs to base64Arcterus-3/+3
2014-04-02Fix fallout of requiring uint indicesAlex Crichton-11/+11
2014-03-31serialize: Switch field privacy as necessaryAlex Crichton-19/+19
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-04-01Json doesn't need to depend on IoError to implement Encodable #13230Eunchong Yu-2/+2
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-1/+1
2014-03-29auto merge of #13188 : FlaPer87/rust/master, r=alexcrichtonbors-4727/+0
2014-03-29Register new snapshotFlavio Percoco-4727/+0
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-11/+11
Closes #2569
2014-03-27serialize: use ResultSean McArthur-1068/+5867
All of Decoder and Encoder's methods now return a Result. Encodable.encode() and Decodable.decode() return a Result as well. fixes #12292
2014-03-27Fix fallout of removing default boundsAlex Crichton-1/+1
This is all purely fallout of getting the previous commit to compile.
2014-03-23auto merge of #13095 : alexcrichton/rust/serialize-tuple, r=huonwbors-140/+30
This commit moves from {read,emit}_seq for tuples to {read,emit}_tuple, as well as providing a generalized macro for generating these implementations from one invocation. Closes #13086
2014-03-23serialize: Read/emit tuples with {read,emit}_tupleAlex Crichton-140/+30
This commit moves from {read,emit}_seq for tuples to {read,emit}_tuple, as well as providing a generalized macro for generating these implementations from one invocation. Closes #13086
2014-03-23Register new snapshotsFlavio Percoco-1/+0
2014-03-23use TotalEq for HashMapDaniel Micay-4/+4
Closes #5283
2014-03-22rustc: Remove all usage of manual deref()Alex Crichton-1/+1
Favor using '*' instead
2014-03-20Register new snapshotsAlex Crichton-6/+1
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-16/+16
Closes #12702
2014-03-18closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric typeJeff Olson-1/+84
serialize: ref #12697 minor adj. to last char check + prettyencode test
2014-03-18remove duplicate methods in implsCorey Richardson-1/+1
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-1/+3
This commit moves all logging out of the standard library into an external crate. This crate is the new crate which is responsible for all logging macros and logging implementation. A few reasons for this change are: * The crate map has always been a bit of a code smell among rust programs. It has difficulty being loaded on almost all platforms, and it's used almost exclusively for logging and only logging. Removing the crate map is one of the end goals of this movement. * The compiler has a fair bit of special support for logging. It has the __log_level() expression as well as generating a global word per module specifying the log level. This is unfairly favoring the built-in logging system, and is much better done purely in libraries instead of the compiler itself. * Initialization of logging is much easier to do if there is no reliance on a magical crate map being available to set module log levels. * If the logging library can be written outside of the standard library, there's no reason that it shouldn't be. It's likely that we're not going to build the highest quality logging library of all time, so third-party libraries should be able to provide just as high-quality logging systems as the default one provided in the rust distribution. With a migration such as this, the change does not come for free. There are some subtle changes in the behavior of liblog vs the previous logging macros: * The core change of this migration is that there is no longer a physical log-level per module. This concept is still emulated (it is quite useful), but there is now only a global log level, not a local one. This global log level is a reflection of the maximum of all log levels specified. The previously generated logging code looked like: if specified_level <= __module_log_level() { println!(...) } The newly generated code looks like: if specified_level <= ::log::LOG_LEVEL { if ::log::module_enabled(module_path!()) { println!(...) } } Notably, the first layer of checking is still intended to be "super fast" in that it's just a load of a global word and a compare. The second layer of checking is executed to determine if the current module does indeed have logging turned on. This means that if any module has a debug log level turned on, all modules with debug log levels get a little bit slower (they all do more expensive dynamic checks to determine if they're turned on or not). Semantically, this migration brings no change in this respect, but runtime-wise, this will have a perf impact on some code. * A `RUST_LOG=::help` directive will no longer print out a list of all modules that can be logged. This is because the crate map will no longer specify the log levels of all modules, so the list of modules is not known. Additionally, warnings can no longer be provided if a malformed logging directive was supplied. The new "hello world" for logging looks like: #[phase(syntax, link)] extern crate log; fn main() { debug!("Hello, world!"); }
2014-03-15Add rustdoc html crate infoSteven Fackler-0/+3
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-0/+1
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13Remove Rc's borrow method to avoid conflicts with RefCell's borrow in ↵Eduard Burtescu-1/+1
Rc<RefCell<T>>.
2014-03-12serialize: make Paths serializableErick Tryzelaar-0/+27
2014-03-12Closes #12829. Names changed for consistency, find_path optimized, method ↵zslayton-35/+24
impls refactored to reduce repitition. Fixed formatting, reworked find_path to use fewer Options. Removed stray tab.
2014-03-12Update users for the std::rand -> librand move.Huon Wilson-1/+2
2014-03-11Added convenience methods and accompanying tests to the Json class.zslayton-0/+247
Fixed some styling issues with trailing whitespace. - Removed redundant functions. - Renamed `get` to `find` - Renamed `get_path` to `find_path` - Renamed `find` to `search` - Changed as_object and as_list to return Object and List rather than the underlying implementation types of TreeMap<~str,Json> and ~[Json] - Refactored find_path to use a fold() instead of recursion Formatting fixes. Fixed spacing, deleted comment. Added convenience methods and accompanying tests to the Json class. Updated tests to expect less pointer indirection.
2014-03-06collections: Correct with_capacity_and_hasherAlex Crichton-2/+2
The arguments were accidentally swapped in the wrong order. Closes #12743
2014-03-04Rename all variables that have uppercase characters in their names to use ↵Palmer Cox-9/+9
only lowercase characters
2014-03-04Cleaned up `std::any`Marvin Löbel-0/+1
- Added `TraitObject` representation to `std::raw`. - Added doc to `std::raw`. - Removed `Any::as_void_ptr()` and `Any::as_mut_void_ptr()` methods as they are uneccessary now after the removal of headers on owned boxes. This reduces the number of virtual calls needed. - Made the `..Ext` implementations work directly with the repr of a trait object. - Removed `Any`-related traits from the prelude. - Added bench for `Any`
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-3/+3
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-27collections: allow `HashMap` to work with generic hashersErick Tryzelaar-18/+32
2014-02-24auto merge of #12453 : alexcrichton/rust/move-json, r=brsonbors-2/+2571
This also inverts the dependency between libserialize and libcollections. cc #8784