about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2014-11-26rollup merge of #19288: steveklabnik/doc_style_cleanupAlex Crichton-584/+513
This is considered good convention. This is about half of them in total, I just don't want an impossible to land patch. :smile:
2014-11-26rollup merge of #19287: alexcrichton/issue-19272Alex Crichton-10/+8
At the same time remove the `pub use` of the variants in favor of accessing through the enum type itself. This is a breaking change as the `Found` and `NotFound` variants must now be imported through `BinarySearchResult` instead of just `std::slice`. [breaking-change] Closes #19271
2014-11-26Update docstrings for UnicodeChar::is_digit => is_numeric renameSimon Sapin-3/+3
2014-11-26Remove special casing for some meta attributesSteven Fackler-1/+0
Descriptions and licenses are handled by Cargo now, so there's no reason to keep these attributes around.
2014-11-26auto merge of #19176 : aturon/rust/stab-iter, r=alexcrichtonbors-61/+217
This is an initial pass at stabilizing the `iter` module. The module is fairly large, but is also pretty polished, so most of the stabilization leaves things as they are. Some changes: * Due to the new object safety rules, various traits needs to be split into object-safe traits and extension traits. This includes `Iterator` itself. While splitting up the traits adds some complexity, it will also increase flexbility: once we have automatic impls of `Trait` for trait objects over `Trait`, then things like the iterator adapters will all work with trait objects. * Iterator adapters that use up the entire iterator now take it by value, which makes the semantics more clear and helps catch bugs. Due to the splitting of Iterator, this does not affect trait objects. If the underlying iterator is still desired for some reason, `by_ref` can be used. (Note: this change had no fallout in the Rust distro except for the useless mut lint.) * In general, extension traits new and old are following an [in-progress convention](rust-lang/rfcs#445). As such, they are marked `unstable`. * As usual, anything involving closures is `unstable` pending unboxed closures. * A few of the more esoteric/underdeveloped iterator forms (like `RandomAccessIterator` and `MutableDoubleEndedIterator`, along with various unfolds) are left experimental for now. * The `order` submodule is left `experimental` because it will hopefully be replaced by generalized comparison traits. * "Leaf" iterators (like `Repeat` and `Counter`) are uniformly constructed by free fns at the module level. That's because the types are not otherwise of any significance (if we had `impl Trait`, you wouldn't want to define a type at all). Closes #17701 Due to renamings and splitting of traits, this is a: [breaking-change]
2014-11-26Fixup various places that were doing `&T+'a` and do `&(T+'a)`Niko Matsakis-3/+3
2014-11-25/** -> ///Steve Klabnik-584/+513
This is considered good convention.
2014-11-25Fallout from stabilizationAaron Turon-17/+18
2014-11-25libs: stabilize iter moduleAaron Turon-44/+199
This is an initial pass at stabilizing the `iter` module. The module is fairly large, but is also pretty polished, so most of the stabilization leaves things as they are. Some changes: * Due to the new object safety rules, various traits needs to be split into object-safe traits and extension traits. This includes `Iterator` itself. While splitting up the traits adds some complexity, it will also increase flexbility: once we have automatic impls of `Trait` for trait objects over `Trait`, then things like the iterator adapters will all work with trait objects. * Iterator adapters that use up the entire iterator now take it by value, which makes the semantics more clear and helps catch bugs. Due to the splitting of Iterator, this does not affect trait objects. If the underlying iterator is still desired for some reason, `by_ref` can be used. (Note: this change had no fallout in the Rust distro except for the useless mut lint.) * In general, extension traits new and old are following an [in-progress convention](https://github.com/rust-lang/rfcs/pull/445). As such, they are marked `unstable`. * As usual, anything involving closures is `unstable` pending unboxed closures. * A few of the more esoteric/underdeveloped iterator forms (like `RandomAccessIterator` and `MutableDoubleEndedIterator`, along with various unfolds) are left experimental for now. * The `order` submodule is left `experimental` because it will hopefully be replaced by generalized comparison traits. * "Leaf" iterators (like `Repeat` and `Counter`) are uniformly constructed by free fns at the module level. That's because the types are not otherwise of any significance (if we had `impl Trait`, you wouldn't want to define a type at all). Closes #17701 Due to renamings and splitting of traits, this is a: [breaking-change]
2014-11-25Deprecate MaybeOwned[Vector] in favor of CowJorge Aparicio-0/+69
2014-11-25auto merge of #19149 : alexcrichton/rust/issue-19091, r=aturonbors-4/+12
This change applies the conventions to unwrap listed in [RFC 430][rfc] to rename non-failing `unwrap` methods to `into_inner`. This is a breaking change, but all `unwrap` methods are retained as `#[deprecated]` for the near future. To update code rename `unwrap` method calls to `into_inner`. [rfc]: https://github.com/rust-lang/rfcs/pull/430 [breaking-change] cc #19091
2014-11-25auto merge of #18966 : huonw/rust/iter2slice, r=aturonbors-0/+96
A slice iterator is isomorphic to a slice, just with a slightly different form: storing start and end pointers rather than start pointer and length. This patch reflects this by making converting between them as easy as `iter.as_slice()` (or even `iter[]` if the shorter lifetime is ok). That is, `slice.iter().as_slice() == slice`. r? @aturon
2014-11-25Add methods to go from a slice iterators to a slice.Huon Wilson-0/+96
A slice iterator is isomorphic to a slice, just with a slightly different form: storing start and end pointers rather than start pointer and length. This patch reflects this by making converting between them as easy as `iter.as_slice()` (or even `iter[]` if the shorter lifetime is ok). That is, `slice.iter().as_slice() == slice`.
2014-11-24std: Export BinarySearchResultAlex Crichton-10/+8
At the same time remove the `pub use` of the variants in favor of accessing through the enum type itself. This is a breaking change as the `Found` and `NotFound` variants must now be imported through `BinarySearchResult` instead of just `std::slice`. [breaking-change] Closes #19272
2014-11-24auto merge of #19248 : japaric/rust/str, r=alexcrichtonbors-3/+8
Just like we do with AsSlice This comes in handy when dealing with iterator-centric APIs (`IntoIterator`!) and you want to receive an `Iterator<S> where S: Str` argument. Without this PR, e.g. you can't receive `&["a", "b"].iter()` instead you'll have to type `&["a", "b"].iter().map(|&x| x)` (A similar thing happens with `&[String]`). r? @aturon Full disclaimer: I haven't run `make`/`make check` yet (All my cores are busy)
2014-11-24auto merge of #19223 : reem/rust/any-typeid-unstable, r=aturonbors-1/+1
It is likely going to be removed and replaced with an associated static.
2014-11-23Rename unwrap functions to into_innerAlex Crichton-4/+12
This change applies the conventions to unwrap listed in [RFC 430][rfc] to rename non-failing `unwrap` methods to `into_inner`. This is a breaking change, but all `unwrap` methods are retained as `#[deprecated]` for the near future. To update code rename `unwrap` method calls to `into_inner`. [rfc]: https://github.com/rust-lang/rfcs/pull/430 [breaking-change] Closes #13159 cc #19091
2014-11-23rollup merge of #19232: nicholasbishop/bishop_fix_result_typoJakub Bukaj-1/+1
2014-11-23rollup merge of #19225: reem/any-unnecessary-transmute-copyJakub Bukaj-3/+3
transmute_copy is no longer needed and is just slow.
2014-11-23rollup merge of #19184: Gekkio/fix-binary-format-charJakub Bukaj-1/+1
This small piece of documentation was missed in the format character change in 4af3494bb02e80badc978faa65e59625ade0c675.
2014-11-23DSTify Str + impl Str for &S where S: StrJorge Aparicio-3/+8
2014-11-23auto merge of #19150 : Manishearth/rust/find-doc, r=Gankrobors-1/+3
It's useful to know this (opens up a bunch of other opportunities especially whilst parsing)
2014-11-23auto merge of #19157 : aturon/rust/cow-doc, r=alexcrichtonbors-7/+23
This commit makes `Cow` more usable by allowing it to be applied to unsized types (as was intended) and providing some basic `ToOwned` implementations on slice types. It also corrects the documentation for `Cow` to no longer mention `DerefMut`, and adds an example. Closes #19123
2014-11-23auto merge of #19152 : alexcrichton/rust/issue-17863, r=aturonbors-30/+123
This commit is an implementation of [RFC 240][rfc] when applied to the standard library. It primarily deprecates the entirety of `string::raw`, `vec::raw`, `slice::raw`, and `str::raw` in favor of associated functions, methods, and other free functions. The detailed renaming is: * slice::raw::buf_as_slice => slice::from_raw_buf * slice::raw::mut_buf_as_slice => slice::from_raw_mut_buf * slice::shift_ptr => deprecated with no replacement * slice::pop_ptr => deprecated with no replacement * str::raw::from_utf8 => str::from_utf8_unchecked * str::raw::c_str_to_static_slice => str::from_c_str * str::raw::slice_bytes => deprecated for slice_unchecked (slight semantic diff) * str::raw::slice_unchecked => str.slice_unchecked * string::raw::from_parts => String::from_raw_parts * string::raw::from_buf_len => String::from_raw_buf_len * string::raw::from_buf => String::from_raw_buf * string::raw::from_utf8 => String::from_utf8_unchecked * vec::raw::from_buf => Vec::from_raw_buf All previous functions exist in their `#[deprecated]` form, and the deprecation messages indicate how to migrate to the newer variants. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0240-unsafe-api-location.md [breaking-change] Closes #17863
2014-11-22Fix typo in Result documentationNicholas Bishop-1/+1
2014-11-23auto merge of #19146 : gereeter/rust/reference-borrow, r=aturonbors-2/+10
This should be a more general version of #19131.
2014-11-23auto merge of #19137 : tbu-/rust/pr_refcell_unsafety, r=huonwbors-0/+3
2014-11-22Any: use plain transmute instead of transmute_copy for downcasting.Jonathan Reem-3/+3
transmute_copy is no longer needed and is just slow.
2014-11-22Mark Any::get_type_id as experimentalJonathan Reem-1/+1
It is likely going to be removed and replaced with an associated static. Fixes #19222
2014-11-22auto merge of #19134 : sinistersnare/rust/patch-2, r=alexcrichtonbors-1/+0
Vec<T> can index now so its a useless conversion.
2014-11-22std: Align `raw` modules with unsafe conventionsAlex Crichton-30/+123
This commit is an implementation of [RFC 240][rfc] when applied to the standard library. It primarily deprecates the entirety of `string::raw`, `vec::raw`, `slice::raw`, and `str::raw` in favor of associated functions, methods, and other free functions. The detailed renaming is: * slice::raw::buf_as_slice => slice::with_raw_buf * slice::raw::mut_buf_as_slice => slice::with_raw_mut_buf * slice::shift_ptr => deprecated with no replacement * slice::pop_ptr => deprecated with no replacement * str::raw::from_utf8 => str::from_utf8_unchecked * str::raw::c_str_to_static_slice => str::from_c_str * str::raw::slice_bytes => deprecated for slice_unchecked (slight semantic diff) * str::raw::slice_unchecked => str.slice_unchecked * string::raw::from_parts => String::from_raw_parts * string::raw::from_buf_len => String::from_raw_buf_len * string::raw::from_buf => String::from_raw_buf * string::raw::from_utf8 => String::from_utf8_unchecked * vec::raw::from_buf => Vec::from_raw_buf All previous functions exist in their `#[deprecated]` form, and the deprecation messages indicate how to migrate to the newer variants. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0240-unsafe-api-location.md [breaking-change] Closes #17863
2014-11-21core: Convert a 'failure' to 'panic' in docsBrian Anderson-2/+2
2014-11-21core: Update docs for escape_unicode, escape_defaultBrian Anderson-3/+4
2014-11-21core: Convert Char::escape_default, escape_unicode to iteratorsBrian Anderson-34/+95
[breaking-change]
2014-11-21core: Convert Char methods to by-val selfBrian Anderson-27/+27
Methods on primitmive Copy types generally should take `self`. [breaking-change]
2014-11-21Fix various deprecation warnings from char changesBrian Anderson-57/+68
2014-11-21core: Mark remaining Char methods unstableBrian Anderson-0/+16
The `Char` trait itself may go away in favor of primitive inherent methods. Still some questions about whether the preconditions are following the final error handling conventions.
2014-11-21core: Deprecated remaining free functions in `char`Brian Anderson-0/+5
Prefer the methods.
2014-11-21core: Add stability attributes to char::from_digit and from_u32Brian Anderson-0/+6
For now we are preferring free functions for primitive ctors, so they are marked 'unstable' pending final decision. The methods on `Char` are 'deprecated'.
2014-11-21core: Add Char::len_utf16Brian Anderson-0/+10
Missing method to pair with len_utf8.
2014-11-21core: Rename Char::len_utf8_bytes to Char::len_utf8Brian Anderson-0/+9
"bytes" is redundant. Deprecate the old.
2014-11-21core: Rename Char::is_digit_radix to is_digitBrian Anderson-0/+19
This fits the naming of `to_digit` and `from_digit`. Leave the old name deprecated.
2014-11-21unicode: Rename UnicodeChar::is_digit to is_numericBrian Anderson-7/+7
'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-21char: Mark the MAX constant stableBrian Anderson-0/+1
2014-11-21core: Mark Char trait experimentalBrian Anderson-0/+2
2014-11-21core: Add from_u32 to the Char traitBrian Anderson-0/+6
This is the only free function not part of the trait.
2014-11-21Fix std::fmt::Binary format char in docsJoonas Javanainen-1/+1
This small piece of documentation was missed in the format character change in 4af3494bb02e80badc978faa65e59625ade0c675.
2014-11-21auto merge of #19042 : SimonSapin/rust/generic-utf16-encoder, r=alexcrichtonbors-3/+25
This allows encoding to UTF-16 something that is not in UTF-8, e.g. a `[char]` UTF-32 string. This might help with servo/servo#4023
2014-11-20libs: make Cow usable, improve documentationAaron Turon-7/+23
This commit makes `Cow` more usable by allowing it to be applied to unsized types (as was intended) and providing some basic `ToOwned` implementations on slice types. It also corrects the documentation for `Cow` to no longer mention `DerefMut`, and adds an example.
2014-11-21Mention that find() doesn't consume the full iteratorManish Goregaokar-1/+3