about summary refs log tree commit diff
path: root/src/librbml
AgeCommit message (Collapse)AuthorLines
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-23/+28
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-2/+2
2015-03-31Test fixes and rebase conflicts, round 3Alex Crichton-1/+0
2015-03-31std: Stabilize last bits of io::ErrorAlex Crichton-7/+7
This commit stabilizes a few remaining bits of the `io::Error` type: * The `Error::new` method is now stable. The last `detail` parameter was removed and the second `desc` parameter was generalized to `E: Into<Box<Error>>` to allow creating an I/O error from any form of error. Currently there is no form of downcasting, but this will be added in time. * An implementation of `From<&str> for Box<Error>` was added to liballoc to allow construction of errors from raw strings. * The `Error::raw_os_error` method was stabilized as-is. * Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it is not possible to use them with trait objects. This is a breaking change due to the modification of the `new` method as well as the removal of the trait implementations for the `Error` type. [breaking-change]
2015-03-31Auto merge of #23549 - aturon:stab-num, r=alexcrichtonbors-3/+1
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change] r? @alexcrichton
2015-03-31Stabilize std::numAaron Turon-3/+1
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-30std: Standardize (input, output) param orderingsAlex Crichton-4/+4
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes #22890 [breaking-change]
2015-03-28Fix some typosVadim Petrochenkov-1/+1
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-140/+139
Now that support has been removed, all lingering use cases are renamed.
2015-03-24Test fixes and rebase conflicts, round 2Alex Crichton-1/+1
2015-03-25Add trivial cast lints.Nick Cameron-2/+2
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-19Fix spelling errors in comments.Joseph Crail-1/+1
I corrected misspelled comments in several crates.
2015-03-13Fallout of std::old_io deprecationAlex Crichton-288/+32
2015-03-11Example -> ExamplesSteve Klabnik-1/+1
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-06Rollup merge of #23056 - awlnx:master, r=nrcManish Goregaokar-0/+2
2015-03-05fix for new attributes failing. issue #22964awlnx-0/+2
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-23/+23
2015-03-04Auto merge of #22920 - tshepang:remove-some-warnings, r=huonwbors-9/+9
2015-03-03Rollup merge of #22876 - Florob:const, r=nikomatsakisManish Goregaokar-1/+1
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-03-03metadata: Reordered integral tags in the ascending order.Kang Seonghoon-51/+55
Also clarified the mysterious `_next_int` method.
2015-03-03metadata: Bump the metadata encoding version.Kang Seonghoon-5/+101
We have changed the encoding enough to bump that. Also added some notes about metadata encoding to librbml/lib.rs.
2015-03-03metadata: Compact integer encoding.Kang Seonghoon-93/+114
Previously every auto-serialized tags are strongly typed. However this is not strictly required, and instead it can be exploited to provide the optimal encoding for smaller integers. This commit repurposes `EsI8`/`EsU8` through `EsI64`/`EsU64` tags to represent *any* integers with given ranges: It is now possible to encode `42u64` as two bytes `EsU8 0x2a`, for example. There are some limitations: * It does not apply to non-auto-serialized tags for obvious reasons. Fortunately, we have already eliminated the biggest source of such tag in favor of auto-serialized tags: `tag_table_id`. * Bigger tags cannot be used to represent smaller types. * Signed tags and unsigned tags do not mix.
2015-03-03metadata: Space-optimize empty vectors and maps.Kang Seonghoon-0/+17
So that `EsVec 82 EsSub8 00` becomes `EsVec 80` now.
2015-03-03metadata: Implement relaxation of short RBML lengths.Kang Seonghoon-32/+62
We try to move the data when the length can be encoded in the much smaller number of bytes. This interferes with indices and type abbreviations however, so this commit introduces a public interface to get and mark a "stable" (i.e. not affected by relaxation) position of the current pointer. The relaxation logic only moves a small data, currently at most 256 bytes, as moving the data can be costly. There might be further opportunities to allow more relaxation by moving fields around, which I didn't seriously try.
2015-03-03metadata: Introduce `EsSub8` and `EsSub32` tags.Kang Seonghoon-35/+77
They replace the existing `EsEnumVid`, `EsVecLen` and `EsMapLen` tags altogether; the meaning of them can be easily inferred from the enclosing tag. It also has an added benefit of encodings for smaller variant ids or lengths being more compact (5 bytes to 2 bytes).
2015-03-03metadata: Bye bye `EsLabel`. No regrets.Kang Seonghoon-47/+4
For the reference, while it is designed to be selectively enabled, it was essentially enabled throughout every snapshot and nightly as far as I can tell. This makes the usefulness of `EsLabel` itself questionable, as it was quite rare that `EsLabel` broke the build. It had consumed about 20~30% of metadata (!) and so this should be a huge win.
2015-03-03metadata: Eliminate the `EsEnumBody` tag.Kang Seonghoon-35/+12
It doesn't serve any useful purpose. It *might* be useful when there are some tags that are generated by `Encodable` and not delimited by any tags, but IIUC it's not the case. Previous: <-------------------- len1 -------------------> EsEnum <len1> EsEnumVid <vid> EsEnumBody <len2> <arg1> <arg2> <--- len2 --> Now: <----------- len1 ----------> EsEnum <len1> EsEnumVid <vid> <arg1> <arg2>
2015-03-03metadata: Introduce implicit lengths for auto-serialization.Kang Seonghoon-52/+121
Many auto-serialization tags are fixed-size (note: many ordinary tags are also fixed-size but for now this commit ignores them), so having an explicit length is a waste. This moves any auto-serialization tags with an implicit length before other tags, so a test for them is easy. A preliminary experiment shows this has at least 1% gain over the status quo.
2015-03-03metadata: New tag encoding scheme.Kang Seonghoon-8/+35
EBML tags are encoded in a variable-length unsigned int (vuint), which is clever but causes some tags to be encoded in two bytes while there are really about 180 tags or so. Assuming that there wouldn't be, say, over 1,000 tags in the future, we can use much more efficient encoding scheme. The new scheme should support at most 4,096 tags anyway. This also flattens a scattered tag namespace (did you know that 0xa9 is followed by 0xb0?) and makes a room for autoserialized tags in 0x00 through 0x1f.
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-3/+3
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-03-01remove some compiler warningsTshepang Lekhonkhobe-9/+9
2015-02-27std: Deprecated the `old_io::extensions` moduleAlex Crichton-39/+37
The `u64_from_be_bytes` and `u64_to_be_bytes` functions are being deprecated with no replacement for now. [breaking-change]
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-1/+1
2015-02-20try to reduce bajillion warningsAlexis-0/+2
2015-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-4/+4
2015-02-17std: Rename io/path features with old_ prefixAlex Crichton-1/+1
This commit renames the features for the `std::old_io` and `std::old_path` modules to `old_io` and `old_path` to help facilitate migration to the new APIs. This is a breaking change as crates which mention the old feature names now need to be renamed to use the new feature names. [breaking-change]
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-1/+0
2015-02-11rollup merge of #22161: steveklabnik/close_2741Alex Crichton-1/+0
Given that this is entirely internal, this enhancement isn't going to be needed. And if it is, we'll add it. Closes #2741.
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-3/+3
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-02-10Remove FIXME in librbmlSteve Klabnik-1/+0
Given that this is entirely internal, this enhancement isn't going to be needed. And if it is, we'll add it. Closes #2741.
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-6/+6
2015-02-02More deprecating of i/u suffixesAlfie John-41/+41
2015-01-30Test fixes and rebase conflictsAlex Crichton-4/+4
Also some tidying up of a bunch of crate attributes
2015-01-29s/Show/Debug/gJorge Aparicio-2/+2
2015-01-29fix inference falloutJorge Aparicio-4/+4
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-1/+1
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-4/+4
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-27Merge remote-tracking branch 'rust-lang/master'Brian Anderson-35/+35
Conflicts: src/libcore/cell.rs src/librustc_driver/test.rs src/libstd/old_io/net/tcp.rs src/libstd/old_io/process.rs
2015-01-26std: Rename Writer::write to Writer::write_allAlex Crichton-9/+9
In preparation for upcoming changes to the `Writer` trait (soon to be called `Write`) this commit renames the current `write` method to `write_all` to match the semantics of the upcoming `write_all` method. The `write` method will be repurposed to return a `usize` indicating how much data was written which differs from the current `write` semantics. In order to head off as much unintended breakage as possible, the method is being deprecated now in favor of a new name. [breaking-change]
2015-01-26Fallout of io => old_ioAlex Crichton-26/+26