about summary refs log tree commit diff
path: root/src/libserialize
AgeCommit message (Collapse)AuthorLines
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-2/+2
2015-03-31rollup merge of #23879: seanmonstar/del-from-errorAlex Crichton-2/+2
Conflicts: src/libcore/error.rs
2015-03-31rollup merge of #23875: aturon/revise-convert-2Alex Crichton-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change] r? @alexcrichton
2015-03-31rollup merge of #23886: demelev/remove_as_slice_usageAlex Crichton-1/+1
2015-03-31Stabilize `std::convert` and related codeAaron Turon-1/+0
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]
2015-03-31Stabilize std::numAaron Turon-0/+3
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-30convert: remove FromError, use From<E> insteadSean McArthur-2/+2
This removes the FromError trait, since it can now be expressed using the new convert::Into trait. All implementations of FromError<E> where changed to From<E>, and `try!` was changed to use From::from instead. Because this removes FromError, it is a breaking change, but fixing it simply requires changing the words `FromError` to `From`, and `from_error` to `from`. [breaking-change]
2015-03-31replace deprecated as_slice()Emeliov Dmitrii-1/+1
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-1/+1
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-145/+144
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23738: alexcrichton/snapshotsAlex Crichton-23/+0
Conflicts: src/libcollections/vec.rs
2015-03-27Change the trivial cast lints to allow by defaultNick Cameron-2/+0
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-148/+147
Now that support has been removed, all lingering use cases are renamed.
2015-03-26Register new snapshotsAlex Crichton-23/+0
2015-03-25Change lint names to pluralsNick Cameron-2/+2
2015-03-25Add trivial cast lints.Nick Cameron-2/+8
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-23rollup merge of #23598: brson/gateAlex Crichton-1/+3
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23rollup merge of #23601: nikomatsakis/by-value-indexAlex Crichton-0/+23
This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`. r? @japaric cc @aturon @Gankro
2015-03-23Add generic conversion traitsAaron Turon-1/+2
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-23Add #![feature] attributes to doctestsBrian Anderson-0/+2
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-1/+1
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-0/+23
references. For collections whose keys are integers, we take both references and by-value.
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-1/+2
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-19std: Stablize io::ErrorKindAlex Crichton-1/+0
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`.
2015-03-18Register new snapshotsAlex Crichton-2/+0
2015-03-17std: Tweak some unstable features of `str`Alex Crichton-0/+1
This commit clarifies some of the unstable features in the `str` module by moving them out of the blanket `core` and `collections` features. The following methods were moved to the `str_char` feature which generally encompasses decoding specific characters from a `str` and dealing with the result. It is unclear if any of these methods need to be stabilized for 1.0 and the most conservative route for now is to continue providing them but to leave them as unstable under a more specific name. * `is_char_boundary` * `char_at` * `char_range_at` * `char_at_reverse` * `char_range_at_reverse` * `slice_shift_char` The following methods were moved into the generic `unicode` feature as they are specifically enabled by the `unicode` crate itself. * `nfd_chars` * `nfkd_chars` * `nfc_chars` * `graphemes` * `grapheme_indices` * `width`
2015-03-17Rollup merge of #23329 - jbcrail:rm-syntax-highlight, r=sanxiynManish Goregaokar-2/+2
As suggested by @steveklabnik in #23254, I removed the redundant Rust syntax highlighting from the documentation.
2015-03-16impl f{32,64}Jorge Aparicio-1/+1
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-2/+2
2015-03-13Fallout of std::old_io deprecationAlex Crichton-14/+17
2015-03-13Auto merge of #23229 - aturon:stab-path, r=alexcrichtonbors-1/+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` method is now `without_file` and succeeds if, and only if, `file_name` is `Some(_)`. That means, in particular, that it fails for a path like `foo/../`. This change affects `pop` as well. In addition, the `old_path` module is now deprecated. [breaking-change] r? @alexcrichton
2015-03-12Stabilize std::pathAaron Turon-1/+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-11Example -> ExamplesSteve Klabnik-2/+2
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-09doc: Fix extraneous as_slice()'s in docstringsRicho Healey-1/+1
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-2/+2
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-0/+15
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-03-03Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddybbors-2/+2
Rebase and follow-through on work done by @cmr and @aatch. Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed. The checks for division, remainder and bit-shifting have not been implemented yet. See also PR #20795 cc @Aatch ; cc @nikomatsakis
2015-03-03Accommodate arith-overflow in serialize::json numeric parsing.Felix S. Klock II-2/+2
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-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-02-26remove some compiler warningsTshepang Lekhonkhobe-2/+0
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-5/+5
2015-02-20Register new snapshotsAlex Crichton-78/+0
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-7/+7
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-7/+7
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-11/+11
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18rollup merge of #22491: Gankro/into_iterAlex Crichton-9/+9
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
2015-02-18Implement RFC 580Aaron Turon-9/+9
This commit implements RFC 580 by renaming: * DList -> LinkedList * Bitv -> BitVec * BitvSet -> BitSet * RingBuf -> VecDeque More details are in [the RFC](https://github.com/rust-lang/rfcs/pull/580) [breaking-change]