summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-03-22auto merge of #13076 : FlaPer87/rust/remove-freeze, r=alexcrichtonbors-31/+11
This PR removes the `Freeze` kind and the `NoFreeze` marker completely. Fixes #12577 cc @nikomatsakis r?
2014-03-22auto merge of #12995 : Kroisse/rust/vec_ng_mut_slices, r=alexcrichtonbors-0/+122
These functions are implemented for &mut [T], but std::vec_ng::Vec has not yet.
2014-03-23Add Vec::mut_slice_from(), mut_slice_to(), and mut_split_at()Eunchong Yu-0/+122
2014-03-22auto merge of #13053 : alexcrichton/rust/removing-ref-cell-get, r=huonwbors-43/+20
This commit removes the `get()` method from `Ref` and `RefMut` in favor of the `*` operator, and removes all usage of the `deref()` function manually from rustc, favoring using `*` instead. Some of the code is a little wacky, but that's due to either #13044 or #13042
2014-03-22std: Add an I/O reader method to fill a bufferAlex Crichton-7/+38
I've found a common use case being to fill a slice (not an owned vector) completely with bytes. It's posible for short reads to happen, and if you're trying to get an exact number of bytes then this helper will be useful.
2014-03-22rustc: Remove all usage of manual deref()Alex Crichton-17/+15
Favor using '*' instead
2014-03-22std: Remove the get() method from RefCell wrappersAlex Crichton-27/+6
This method has been entirely obsoleted by autoderef, so there's no reason for its existence.
2014-03-22std::os: Handle FormatMessage failureklutzy-3/+8
`FormatMessageW()` is called by `std::os::last_os_error()` to convert errno into string, but the function may fail on non-english locale. I don't know why it fails, but anyway it's better to return errno than to `fail!()` in the case. Fixes #13075 Fixes #13073
2014-03-22std: Remove the Freeze kind and the NoFreeze markerFlavio Percoco-15/+1
2014-03-22cell: Remove Freeze / NoFreezeFlavio Percoco-10/+6
2014-03-22std::comm: Remove Freeze / NoFreezeFlavio Percoco-6/+4
2014-03-22auto merge of #13052 : sfackler/rust/clean-refcell, r=alexcrichtonbors-83/+16
These are superfluous now that we have fixed rvalue lifetimes and Deref. I'd also like to kill off `get` and `set`, but that'll be a large change so I want to make sure that we actually want to do that first.
2014-03-22auto merge of #12907 : alexcrichton/rust/issue-12892, r=brsonbors-18/+19
These methods can be mistaken for general "read some bytes" utilities when they're actually only meant for reading an exact number of bytes. By renaming them it's much clearer about what they're doing without having to read the documentation. Closes #12892
2014-03-21auto merge of #13051 : alexcrichton/rust/issue-13047, r=thestingerbors-1/+2
It's useful for structures which use deriving(Clone), even though it's implicitly copyable. Closes #13047
2014-03-21auto merge of #13036 : alexcrichton/rust/atomics, r=alexcrichtonbors-137/+1110
Closes #11583, rebasing of #12430 now that we've got `Share` and better analysis with statics.
2014-03-21auto merge of #13016 : huonw/rust/new-opt-vec, r=cmrbors-0/+13
Replace syntax::opt_vec with syntax::owned_slice The `owned_slice::OwnedSlice` is `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`). This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-0/+13
syntax::opt_vec is now entirely unused, and so can go.
2014-03-21rustc: Switch defaults from libgreen to libnativeAlex Crichton-0/+10
The compiler will no longer inject libgreen as the default runtime for rust programs, this commit switches it over to libnative by default. Now that libnative has baked for some time, it is ready enough to start getting more serious usage as the default runtime for rustc generated binaries. We've found that there isn't really a correct decision in choosing a 1:1 or M:N runtime as a default for all applications, but it seems that a larger number of programs today would work more reasonable with a native default rather than a green default. With this commit come a number of bugfixes: * The main native task is now named "<main>" * The main native task has the stack bounds set up properly * #[no_uv] was renamed to #[no_start] * The core-run-destroy test was rewritten for both libnative and libgreen and one of the tests was modified to be more robust. * The process-detach test was locked to libgreen because it uses signal handling
2014-03-21auto merge of #13056 : huonw/rust/devecing-tests, r=pnkfelixbors-18/+21
test: Remove all `~[T]` from tests, libgetopts, compiletest, librustdoc, and libnum And most from libtest, libflate, and adds `deny(deprecated_owned_vector)`s to the smaller modules with that have zero (or nearly zero) uses of `~[T]`. Revival of #12837
2014-03-21Rewrite rc::Rc using cell::CellEdward Wang-34/+65
Since `Arc` has been using `Atomic`, this closes 12625. Closes #12625.
2014-03-21libstd: Add some methods to `Vec<T>`.Patrick Walton-18/+21
2014-03-20Clean up marker types and Unsafe initializationSteven Fackler-16/+12
2014-03-20std: Implement Clone/TotalEq for ProcessExitAlex Crichton-1/+2
It's useful for structures which use deriving(Clone, TotalEq), even though it's implicitly copyable. Closes #13047
2014-03-20Remove RefCell::{with, with_mut}Steven Fackler-67/+4
These are superfluous now that we have fixed rvalue lifetimes and Deref.
2014-03-20std: Rename {push,read}_bytes to {push,read}_exactAlex Crichton-18/+19
These methods can be mistaken for general "read some bytes" utilities when they're actually only meant for reading an exact number of bytes. By renaming them it's much clearer about what they're doing without having to read the documentation. Closes #12892
2014-03-20std: Update atomic documentation to remove 'mut'Alex Crichton-23/+23
It's all no longer necessary
2014-03-20std: Remove AtomicU64Brian Anderson-52/+0
Support for this is less universal than for word-size things; it has no users; i'd rather play it safe.
2014-03-20std: Make the generic atomics in `sync::atomics` privateBrian Anderson-10/+10
I'm not comfortable exposing public functions that purport to do atomic operations on arbitrary T.
2014-03-20std: Make the generic atomics take unsafe pointersBrian Anderson-124/+127
These mutate values behind references that are Freeze, which is not allowed.
2014-03-20Register new snapshotsAlex Crichton-95/+4
2014-03-20std: Make atomics immutable. #11583Brian Anderson-42/+1064
In Rust, the strongest guarantee that `&mut` provides is that the memory pointed to is *not aliased*, whereas `&`'s guarantees are much weaker: that the value can be aliased, and may be mutated under proper precautions (interior mutability). Our atomics though use `&mut` for mutation even while creating multiple aliases, so this changes them to use 'interior mutability', mutating through immutable references.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20std: Add Vec to the preludeAlex Crichton-0/+1
This is an incredibly common type, and it is expected to be used in many many places. This type should be in the prelude.
2014-03-20auto merge of #13015 : tbu-/rust/pr_remove_immut, r=alexcrichtonbors-6/+0
Remove std::cast::transmute_immut_unsafe. It can be done in safe code using `as *T`.
2014-03-20auto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakisbors-76/+210
`Share` implies that all *reachable* content is *threadsafe*. Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)... Fixes #11781 cc #12577 What this PR will do ================ - [x] Add Share kind and - [x] Replace usages of Freeze with Share in bounds. - [x] Add Unsafe<T> #12577 - [x] Forbid taking the address of a immutable static item with `Unsafe<T>` interior What's left to do in a separate PR (after the snapshot)? =========================================== - Remove `Freeze` completely
2014-03-20auto merge of #12980 : cmr/rust/overhaul-stdio, r=thestingerbors-1/+7
this comes from a discussion on IRC where the split between stdin and stdout seemed unnatural, and the fact that reading on stdin won't flush stdout, which is unlike every other language (including C's stdio).
2014-03-20A couple of fixes to vec_ng docsSteven Fackler-14/+24
2014-03-20Make atomics interior Unsafe<T>Flavio Percoco-50/+60
2014-03-20Let ArcData use Unsafe<T>Flavio Percoco-5/+8
2014-03-20Make Cell and RefCell use Unsafe<T>Flavio Percoco-14/+19
2014-03-20Add Unsafe<T> typeFlavio Percoco-0/+82
2014-03-20Make `Rc`, `Cell` and `RefCell` NoShareFlavio Percoco-7/+18
2014-03-20Add a Share kindFlavio Percoco-1/+24
Fixes #11781
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-19/+22
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-154/+152
Closes #12702
2014-03-19std: io: flush stdout on stdin read from ttyCorey Richardson-1/+7
2014-03-19Remove std::cast::transmute_immut_unsafeTobias Bucher-6/+0
It can be done in safe code using `as *T`.
2014-03-19auto merge of #12982 : brson/rust/optiondocs, r=alexcrichtonbors-20/+170
Various improvements. There's a lot more that can be done.
2014-03-19auto merge of #12955 : sfackler/rust/vec_ng-doc, r=alexcrichtonbors-30/+608
I also removed a couple of methods that were silly and added sort.
2014-03-18Docify std::vec_ngSteven Fackler-30/+608
I also removed a couple of methods that were silly and added sort.