about summary refs log tree commit diff
path: root/src/libcoretest
AgeCommit message (Collapse)AuthorLines
2014-11-21core: Add Char::len_utf16Brian Anderson-0/+8
Missing method to pair with len_utf8.
2014-11-21unicode: Rename UnicodeChar::is_digit to is_numericBrian Anderson-6/+6
'Numeric' is the proper name of the unicode character class, and this frees up the word 'digit' for ascii use in libcore. Since I'm going to rename `Char::is_digit_radix` to `is_digit`, I am not leaving a deprecated method in place, because that would just cause name clashes, as both `Char` and `UnicodeChar` are in the prelude. [breaking-change]
2014-11-20Add Utf16Encoder. Generalize Utf16CodeUnits for any Iterator<char>.Simon Sapin-0/+7
This allows encoding to UTF-16 something that is not in UTF-8, e.g. a `[char]` UTF-32 string. This might help with https://github.com/servo/servo/issues/4023
2014-11-18std: Stabilize std::fmtAlex Crichton-44/+37
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-11-18add Cloned iterator adaptorAlexis Beingessner-0/+17
2014-11-18make cloned generic over deref... and have its tests actually runAlexis Beingessner-9/+24
2014-11-17auto merge of #19027 : nick29581/rust/coercions-4, r=alexcrichtonbors-11/+11
The forwards compatible parts of #18645, rebased. Converts implicit coercions from `[T, ..n]` to `&[T]` into explicit references.
2014-11-17Fix fallout from coercion removalNick Cameron-11/+11
2014-11-16implement cloned for OptionAlexis Beingessner-0/+13
2014-11-16rollup merge of #18976: bjz/rfc369-numericsJakub Bukaj-1/+122
2014-11-16Move FromStr to core::strBrendan Zabarauskas-1/+122
2014-11-14impl Default for Cell and RefCellStepan Koltsov-0/+13
It is necessary to have #[deriving(Default)] for struct containing cells like Cell<u32>.
2014-11-14Revert the need for initial values with arithmetic iteratorsBrendan Zabarauskas-6/+6
2014-11-13Remove Signed trait and add SignedInt traitBrendan Zabarauskas-1/+4
The methods have been moved into Float and SignedInt
2014-11-13Remove lots of numeric traits from the preludesBrendan Zabarauskas-48/+12
Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
2014-11-13Deprecate Num, Unsigned and PrimitiveBrendan Zabarauskas-1/+1
2014-11-13Deprecate Zero and One traitsBrendan Zabarauskas-6/+6
2014-11-13Move checked arithmetic operators into Int traitBrendan Zabarauskas-7/+5
2014-11-13Move abs_sub to FloatMathBrendan Zabarauskas-8/+0
This removes the need for libcore to depend on libm. `abs_sub` is not as useful for integers.
2014-11-13Take parameters by-value in Signed traitBrendan Zabarauskas-4/+4
2014-11-05Repair various cases where values of distinct types were being operatedNiko Matsakis-4/+4
upon (e.g., `&int` added to `int`).
2014-11-04libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` inPatrick Walton-4/+4
Unicode characters and strings. Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected. This PR introduces a new function, `escape_default`, into the ASCII module. This was necessary for the pretty printer to continue to function. RFC #326. Closes #18062. [breaking-change]
2014-11-03auto merge of #18468 : jakub-/rust/iter-repeat, r=alexcrichtonbors-0/+8
Implements a part of RFC 235. [breaking-change]
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-1/+1
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-30rollup merge of #18443 : alexcrichton/deref-vec-and-stringAlex Crichton-0/+69
2014-10-30Add a `repeat` function to the preludeJakub Bukaj-0/+8
Implements a part of RFC 235. [breaking-change]
2014-10-29collections: impl Deref for Vec/StringAlex Crichton-0/+69
This commit adds the following impls: impl<T> Deref<[T]> for Vec<T> impl<T> DerefMut<[T]> for Vec<T> impl Deref<str> for String This commit also removes all duplicated inherent methods from vectors and strings as implementations will now silently call through to the slice implementation. Some breakage occurred at std and beneath due to inherent methods removed in favor of those in the slice traits and std doesn't use its own prelude, cc #18424
2014-10-29Rename fail! to panic!Steve Klabnik-22/+22
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Update code with new lint namesAaron Turon-1/+1
2014-10-24Add as_unsafe_cell() for Cell and RefCellKeegan McAllister-0/+19
Fixes #18131.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-211/+25
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-13Clean up rustc warnings.NODA, Kai-4/+5
compiletest: compact "linux" "macos" etc.as "unix". liballoc: remove a superfluous "use". libcollections: remove invocations of deprecated methods in favor of their suggested replacements and use "_" for a loop counter. libcoretest: remove invocations of deprecated methods; also add "allow(deprecated)" for testing a deprecated method itself. libglob: use "cfg_attr". libgraphviz: add a test for one of data constructors. libgreen: remove a superfluous "use". libnum: "allow(type_overflow)" for type cast into u8 in a test code. librustc: names of static variables should be in upper case. libserialize: v[i] instead of get(). libstd/ascii: to_lowercase() instead of to_lower(). libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend. It will serve better for testing various aspects of bitflags!. libstd/collections: "allow(deprecated)" for testing a deprecated method itself. libstd/io: remove invocations of deprecated methods and superfluous "use". Also add #[test] where it was missing. libstd/num: introduce a helper function to effectively remove invocations of a deprecated method. libstd/path and rand: remove invocations of deprecated methods and superfluous "use". libstd/task and libsync/comm: "allow(deprecated)" for testing a deprecated method itself. libsync/deque: remove superfluous "unsafe". libsync/mutex and once: names of static variables should be in upper case. libterm: introduce a helper function to effectively remove invocations of a deprecated method. We still see a few warnings about using obsoleted native::task::spawn() in the test modules for libsync. I'm not sure how I should replace them with std::task::TaksBuilder and native::task::NativeTaskBuilder (dependency to libstd?) Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-10-11Fix cfg warnings in libcoretestMichael Gehring-8/+8
2014-10-10Register new snapshotsAlex Crichton-8/+6
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
2014-10-07Rename slicing methodsNick Cameron-2/+2
2014-10-07Put slicing syntax behind a feature gate.Nick Cameron-1/+1
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-27/+28
2014-10-02rollup merge of #17666 : eddyb/take-garbage-outAlex Crichton-3/+2
Conflicts: src/libcollections/lib.rs src/libcore/lib.rs src/librustdoc/lib.rs src/librustrt/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/test/run-pass/issue-8898.rs
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-28/+27
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Remove the `_` suffix from slice methods."Aaron Turon-2/+2
This reverts commit df2f1fa7680a86ba228f004e7de731e91a1df1fe.
2014-10-02Revert "Put slicing syntax behind a feature gate."Aaron Turon-1/+1
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2014-10-02tests: remove uses of Gc.Eduard Burtescu-3/+2
2014-10-02Put slicing syntax behind a feature gate.Nick Cameron-1/+1
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02Remove the `_` suffix from slice methods.Nick Cameron-2/+2
Deprecates slicing methods from ImmutableSlice/MutableSlice in favour of slicing syntax or the methods in Slice/SliceMut. Closes #17273.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-27/+28
2014-09-25Add partial_min/max to libcore/cmpTill Hoeppner-0/+67
Add partial_min/max to libcore/cmp Match against None and mark as experimental Shortened documentation. Removed whitespace
2014-09-22Update calls of deprecated functions in macros.Victor Berger-0/+2
Fallout of #17185.
2014-09-17rollup merge of #16936 : nham/two_way_makeoverAlex Crichton-0/+6
2014-09-16Fallout from renamingAaron Turon-5/+5
2014-09-09auto merge of #16662 : pczarn/rust/format-fmtstr-opt, r=brsonbors-0/+7
Based on an observation that strings and arguments are always interleaved, thanks to #15832. Additionally optimize invocations where formatting parameters are unspecified for all arguments, e.g. `"{} {:?} {:x}"`, by emptying the `__STATIC_FMTARGS` array. Next, `Arguments::new` replaces an empty slice with `None` so that passing empty `__STATIC_FMTARGS` generates slightly less machine code when `Arguments::new` is inlined. Furthermore, formatting itself treats these cases separately without making redundant copies of formatting parameters. All in all, this adds a single mov instruction per `write!` in most cases. That's why code size has increased.