about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-01-05std: remove remaining boxed closuresJorge Aparicio-12/+15
2015-01-05register snapshotJorge Aparicio-26/+0
2015-01-05Stabilize collection modulesAaron Turon-1/+3
The earlier collections stabilization did not cover the modules themselves. This commit marks as stable those modules whose types have been stabilized.
2015-01-05removing whitespaceFakeKane-3/+3
2015-01-05examples added for element accessFakeKane-1/+12
2015-01-05Rename macro_escape to macro_useKeegan McAllister-9/+20
In the future we want to support #[macro_use(foo, bar)] mod macros; but it's not an essential part of macro reform. Reserve the syntax for now.
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-18/+26
In preparation for the rename.
2015-01-05Use $crate and macro reexport to reduce duplicated codeKeegan McAllister-221/+677
Many of libstd's macros are now re-exported from libcore and libcollections. Their libstd definitions have moved to a macros_stage0 module and can disappear after the next snapshot. Where the two crates had already diverged, I took the libstd versions as they're generally newer and better-tested. See e.g. d3c831b, which was a fix to libstd's assert_eq!() that didn't make it into libcore's. Fixes #16806.
2015-01-05remove unused `Sized` importsJorge Aparicio-1/+0
2015-01-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-3/+3
2015-01-05remove unnecessary `Default` bound from `Hash{Map,Set}`'s `Extend` implAndrew Paseltiner-2/+2
2015-01-05std: Redesign c_str and c_vecAlex Crichton-1379/+463
This commit is an implementation of [RFC 494][rfc] which removes the entire `std::c_vec` module and redesigns the `std::c_str` module as `std::ffi`. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0494-c_str-and-c_vec-stability.md The interface of the new `CString` is outlined in the linked RFC, the primary changes being: * The `ToCStr` trait is gone, meaning the `with_c_str` and `to_c_str` methods are now gone. These two methods are replaced with a `CString::from_slice` method. * The `CString` type is now just a wrapper around `Vec<u8>` with a static guarantee that there is a trailing nul byte with no internal nul bytes. This means that `CString` now implements `Deref<Target = [c_char]>`, which is where it gains most of its methods from. A few helper methods are added to acquire a slice of `u8` instead of `c_char`, as well as including a slice with the trailing nul byte if necessary. * All usage of non-owned `CString` values is now done via two functions inside of `std::ffi`, called `c_str_to_bytes` and `c_str_to_bytes_with_nul`. These functions are now the one method used to convert a `*const c_char` to a Rust slice of `u8`. Many more details, including newly deprecated methods, can be found linked in the RFC. This is a: [breaking-change] Closes #20444
2015-01-05reverting other changesFakeKane-10/+4
2015-01-05Implement Clone for PRNGsSimonas Kazlauskas-1/+2
2015-01-05Make temporary directory names non-deterministic.Laurence Tratt-30/+44
The previous scheme made it possible for another user/attacker to cause the temporary directory creation scheme to panic. All you needed to know was the pid of the process you wanted to target ('other_pid') and the suffix it was using (let's pretend it's 'sfx') and then code such as this would, in essence, DOS it: for i in range(0u, 1001) { let tp = &Path::new(format!("/tmp/rs-{}-{}-sfx", other_pid, i)); match fs::mkdir(tp, io::USER_RWX) { _ => () } } Since the scheme retried only 1000 times to create a temporary directory before dying, the next time the attacked process called TempDir::new("sfx") after that would typically cause a panic. Of course, you don't necessarily need an attacker to cause such a DOS: creating 1000 temporary directories without closing any of the previous would be enough to DOS yourself. This patch broadly follows the OpenBSD implementation of mkstemp. It uses the operating system's random number generator to produce random directory names that are impractical to guess (and, just in case someone manages to do that, it retries creating the directory for a long time before giving up; OpenBSD retries INT_MAX times, although 1<<31 seems enough to thwart even the most patient attacker). As a small additional change, this patch also makes the argument that TempDir::new takes a prefix rather than a suffix. This is because 1) it more closely matches what mkstemp and friends do 2) if you're going to have a deterministic part of a filename, you really want it at the beginning so that shell completion is useful.
2015-01-05Fix misleading name in AsciiExt docsZbigniew Siciarz-1/+1
2015-01-04std: Fix missing stability on preludeAlex Crichton-0/+2
The module itself is stable (the name)
2015-01-04std: Fix missing stability in syncAlex Crichton-5/+4
* The `sync` module is stable * The `sync::mpsc` module is stable * The `Sender::send` method is stable. * The `Once::doit` method is now removed. * Deprecated atomic initializers are removed. * Renamed atomic initializers are now stable.
2015-01-05auto merge of #20395 : huonw/rust/char-stab-2, r=aturonbors-5/+4
cc #19260 The casing transformations are left unstable (it is highly likely to be better to adopt the proper non-1-to-1 case mappings, per #20333) as are `is_xid_*`. I've got a little todo list in the last commit of things I thought about/was told about that I haven't yet handled (I'd also like some feedback).
2015-01-05Merge `UnicodeChar` and `CharExt`.Huon Wilson-4/+3
This "reexports" all the functionality of `core::char::CharExt` as methods on `unicode::u_char::UnicodeChar` (renamed to `CharExt`). Imports may need to be updated (one now just imports `unicode::CharExt`, or `std::char::CharExt` rather than two traits from either), so this is a [breaking-change]
2015-01-05Rename `core::char::Char` to `CharExt` to match prelude guidelines.Huon Wilson-2/+2
Imports may need to be updated so this is a [breaking-change]
2015-01-05auto merge of #20163 : bfops/rust/master, r=Gankrobors-33/+61
TODOs: - ~~Entry is still `<'a, K, V>` instead of `<'a, O, V>`~~ - ~~BTreeMap is still outstanding~~. - ~~Transform appropriate things into `.entry(...).get().or_else(|e| ...)`~~ Things that make me frowny face: - I'm not happy about the fact that this `clone`s the key even when it's already owned. - With small keys (e.g. `int`s), taking a reference seems wasteful. r? @Gankro cc: @cgaebel
2015-01-04Merge pull request #20510 from tshepang/patch-6bors-1/+1
doc: remove incomplete sentence Reviewed-by: steveklabnik, steveklabnik
2015-01-04Merge pull request #20464 from ranma42/improve-make-hashbors-8/+6
Improve `make_hash` function Reviewed-by: Gankro, Gankro
2015-01-04[breaking change] Update entry API as part of RFC 509.Ben Foppa-33/+61
2015-01-04fix comment referencing RwLockville-h-1/+1
2015-01-04fix code referencing RwLockWriteGuardville-h-9/+9
2015-01-04auto merge of #20393 : japaric/rust/impl-any, r=aturonbors-2/+2
Needs a snapshot that contains PR #20385 r? @aturon
2015-01-04rename std::sync::RWLockWriteGuard to RwLockWriteGuardville-h-7/+7
2015-01-04fix code referencing RwLockReadGuardville-h-9/+9
2015-01-04rename std::sync::RWLockReadGuard to RwLockReadGuardville-h-6/+6
2015-01-04fix code and comments referencing RW_LOCK_INITville-h-7/+7
2015-01-03Remove deprecated functionalityAlex Crichton-1027/+242
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-04rename std::sync::RWLOCK_INIT to RW_LOCK_INITville-h-1/+1
2015-01-04fix code and comments referencing StaticRwLockville-h-12/+12
2015-01-04doc: remove incomplete sentenceTshepang Lekhonkhobe-1/+1
2015-01-03remove `Any[Mut]RefExt` traits in favor of `impl Any`Jorge Aparicio-2/+2
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-73/+73
2015-01-03sed -i -s 's/\bmod}/self}/g' **/*.rsJorge Aparicio-1/+1
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-62/+62
2015-01-04auto merge of #20490 : japaric/rust/assoc-types, r=aturonbors-83/+168
closes #20486 closes #20474 closes #20441 [breaking-change] The `Index[Mut]` traits now have one less input parameter, as the return type of the indexing operation is an associated type. This breaks all existing implementations. --- binop traits (`Add`, `Sub`, etc) now have an associated type for their return type. Also, the RHS input parameter now defaults to `Self` (except for the `Shl` and `Shr` traits). For example, the `Add` trait now looks like this: ``` rust trait Add<Rhs=Self> { type Output; fn add(self, Rhs) -> Self::Output; } ``` The `Neg` and `Not` traits now also have an associated type for their return type. This breaks all existing implementations of these traits. --- Affected traits: - `Iterator { type Item }` - `IteratorExt` no input/output types, uses `<Self as Iterator>::Item` in its methods - `DoubleEndedIterator` no input/output types, uses `<Self as Iterator>::Item` in its methods - `DoubleEndedIteratorExt` no input/output types, uses `<Self as Iterator>::Item` in its methods - `RandomAccessIterator` no input/output types - `ExactSizeIterator` no input/output types, uses `<Self as Iterator>::Item` in its methods This breaks all the implementations of these traits.
2015-01-04rename std::sync::StaticRWLock to StaticRwLockville-h-4/+4
2015-01-04fix code and comments referencing RwLockville-h-32/+32
2015-01-03std: fix falloutJorge Aparicio-0/+30
2015-01-03use assoc types in unop traitsJorge Aparicio-2/+6
2015-01-03use assoc types in binop traitsJorge Aparicio-15/+39
2015-01-03rename std::sync::RWLock to RwLockville-h-7/+7
2015-01-03Initial version of AArch64 support.Akos Kiss-30/+79
Adds AArch64 knowledge to: * configure, * make files, * sources, * tests, and * documentation.
2015-01-03core: merge IteratorPairExt into IteratorExtJorge Aparicio-1/+0
2015-01-03Register new snapshotsJorge Aparicio-27/+0