summary refs log tree commit diff
path: root/src/libstd/unstable
AgeCommit message (Collapse)AuthorLines
2014-03-29auto merge of #13183 : erickt/rust/remove-list, r=alexcrichtonbors-1/+1
`collections::list::List` was decided in a [team meeting](https://github.com/mozilla/rust/wiki/Meeting-weekly-2014-03-25) that it was unnecessary, so this PR removes it. Additionally, it removes an old and redundant purity test and fixes some warnings.
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-3/+3
Closes #2569
2014-03-28std and green: fix some warningsErick Tryzelaar-1/+1
2014-03-27Fix fallout of removing default boundsAlex Crichton-1/+1
This is all purely fallout of getting the previous commit to compile.
2014-03-24comm: Implement synchronous channelsAlex Crichton-2/+2
This commit contains an implementation of synchronous, bounded channels for Rust. This is an implementation of the proposal made last January [1]. These channels are built on mutexes, and currently focus on a working implementation rather than speed. Receivers for sync channels have select() implemented for them, but there is currently no implementation of select() for sync senders. Rust will continue to provide both synchronous and asynchronous channels as part of the standard distribution, there is no intent to remove asynchronous channels. This flavor of channels is meant to provide an alternative to asynchronous channels because like green tasks, asynchronous channels are not appropriate for all situations. [1] - https://mail.mozilla.org/pipermail/rust-dev/2014-January/007924.html
2014-03-23std: Move NativeMutex from &mut self to &selfAlex Crichton-47/+56
The proper usage of shared types is now sharing through `&self` rather than `&mut self` because the mutable version will provide stronger guarantees (no aliasing on *any* thread).
2014-03-14fix MIPS targetJyun-Yan You-0/+4
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure.
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-3/+3
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-02-27std: Small cleanup and test improvementAlex Crichton-3/+1
This weeds out a bunch of warnings building stdtest on windows, and it also adds a check! macro to the io::fs tests to help diagnose errors that are cropping up on windows platforms as well. cc #12516
2014-02-23std: Move unstable::stack to rt::stackBrian Anderson-277/+0
2014-02-23std: Remove unstable::langBrian Anderson-54/+0
Put the lonely lang items here closer to the code they are calling.
2014-02-23std: Move raw to std::rawBrian Anderson-96/+0
Issue #1457
2014-02-23std: Move intrinsics to std::intrinsics.Brian Anderson-459/+1
Issue #1457
2014-02-17Made fail_bounds_check more careful with strings.chromatic-2/+12
Fixes GH #11976.
2014-02-15auto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfacklerbors-4/+10
It's too easy to forget the `rust` tag to test something. Closes #11698
2014-02-16std::unstable::mutex: streamline & clarify documentation.Huon Wilson-26/+37
2014-02-16std: add a NativeMutex type as a wrapper to destroy StaticNativeMutex.Huon Wilson-65/+107
This obsoletes LittleLock, and so it is removed.
2014-02-16std: Rename unstable::mutex::Mutex to StaticNativeMutex.Huon Wilson-38/+42
This better reflects its purpose and design.
2014-02-16std: add tests for the _noguard lock/signal/wait methods on Mutex.Huon Wilson-2/+28
2014-02-16std: add an RAII unlocker to Mutex.Huon Wilson-36/+96
This automatically unlocks its lock when it goes out of scope, and provides a safe(ish) method to call .wait.
2014-02-14Fix all code examplesAlex Crichton-4/+10
2014-02-13Remove two allocations from spawning a green taskAlex Crichton-0/+6
Two unfortunate allocations were wrapping a proc() in a proc() with GreenTask::build_start_wrapper, and then boxing this proc in a ~proc() inside of Context::new(). Both of these allocations were a direct result from two conditions: 1. The Context::new() function has a nice api of taking a procedure argument to start up a new context with. This inherently required an allocation by build_start_wrapper because extra code needed to be run around the edges of a user-provided proc() for a new task. 2. The initial bootstrap code only understood how to pass one argument to the next function. By modifying the assembly and entry points to understand more than one argument, more information is passed through in registers instead of allocating a pointer-sized context. This is sadly where I end up throwing mips under a bus because I have no idea what's going on in the mips context switching code and don't know how to modify it. Closes #7767 cc #11389
2014-02-13Register new snapshotsAlex Crichton-25/+0
2014-02-12Removed ty_type (previously used to represent *tydesc).Eduard Burtescu-0/+3
2014-02-11std -- replaces uses where const borrows would be requiredNiko Matsakis-35/+79
2014-02-09std: Move byteswap functions to memBrian Anderson-27/+0
2014-02-09std: Add init and uninit to mem. Replace direct intrinsic usageBrian Anderson-5/+4
2014-02-08auto merge of #12096 : brson/rust/morestack-addr, r=thestingerbors-3/+0
2014-02-07rm out-of-date comment from std::unstable::rawDaniel Micay-3/+0
2014-02-07remove type descriptors from proc and @TDaniel Micay-0/+20
This also drops support for the managed pointer POISON_ON_FREE feature as it's not worth adding back the support for it. After a snapshot, the leftovers can be removed.
2014-02-07rustc: Remove 'morestack_addr' intrinsic. UnusedBrian Anderson-3/+0
2014-02-05libstd: Add missing constants for arm/linux.Luqman Aden-1/+5
2014-02-05Implement clone() for TCP/UDP/Unix socketsAlex Crichton-1/+0
This is part of the overall strategy I would like to take when approaching issue #11165. The only two I/O objects that reasonably want to be "split" are the network stream objects. Everything else can be "split" by just creating another version. The initial idea I had was the literally split the object into a reader and a writer half, but that would just introduce lots of clutter with extra interfaces that were a little unnnecssary, or it would return a ~Reader and a ~Writer which means you couldn't access things like the remote peer name or local socket name. The solution I found to be nicer was to just clone the stream itself. The clone is just a clone of the handle, nothing fancy going on at the kernel level. Conceptually I found this very easy to wrap my head around (everything else supports clone()), and it solved the "split" problem at the same time. The cloning support is pretty specific per platform/lib combination: * native/win32 - uses some specific WSA apis to clone the SOCKET handle * native/unix - uses dup() to get another file descriptor * green/all - This is where things get interesting. When we support full clones of a handle, this implies that we're allowing simultaneous writes and reads to happen. It turns out that libuv doesn't support two simultaneous reads or writes of the same object. It does support *one* read and *one* write at the same time, however. Some extra infrastructure was added to just block concurrent writers/readers until the previous read/write operation was completed. I've added tests to the tcp/unix modules to make sure that this functionality is supported everywhere.
2014-02-04Register new snapshotsAlex Crichton-120/+0
2014-02-03std: Hardcode pthread constants and structuresAlex Crichton-300/+217
This allows for easier static initialization of a pthread mutex, although the windows mutexes still sadly suffer. Note that this commit removes the clone() method from a mutex because it no longer makes sense for pthreads mutexes. This also removes the Once type for now, but it'll get added back shortly.
2014-02-03Add an AtomicU64 type to std::sync::atomicsAlex Crichton-9/+101
This also generalizes all atomic intrinsics over T so we'll be able to add u8 atomics if we really feel the need to (do we really want to?)
2014-02-03std: Fix tests with io_error usageAlex Crichton-1/+1
2014-02-02std,extra: remove use of & support for @[].Huon Wilson-1/+0
2014-02-02libextra: Remove `@str` from all the librariesPatrick Walton-1/+0
2014-01-31Retry on EINVAL from pthread_attr_setstacksize()Ben Noordhuis-1/+1
Enforce that the stack size is > RED_ZONE + PTHREAD_STACK_MIN. If the call to pthread_attr_setstacksize() subsequently fails with EINVAL, it means that the platform requires the stack size to be a multiple of the page size. In that case, round up to the nearest page and retry. Fixes #11694.
2014-01-29Removing do keyword from libstd and librustcScott Lawrence-12/+12
2014-01-28Feature gate #[simd]David Manescu-0/+10
Fixes #11721
2014-01-27Removed take_glue from tydesc, inlining the equivalent refcount increment ↵Eduard Burtescu-0/+2
code instead.
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-1/+3
Fixes #10667 and closes #10259.
2014-01-25Uppercase numeric constantsChris Wong-4/+4
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-22libc: switch `free` to the proper signatureDaniel Micay-20/+20
This does not attempt to fully propagate the mutability everywhere, but gives new code a hint to avoid the same issues.
2014-01-22Replace C types with Rust types in libstd, closes #7313Florian Hahn-56/+52
2014-01-21Purge borrowck from libstdAlex Crichton-40/+0
This hasn't been in use since `@mut` was removed
2014-01-17handle zero-size allocations correctlyDaniel Micay-8/+5
The `malloc` family of functions may return a null pointer for a zero-size allocation, which should not be interpreted as an out-of-memory error. If the implementation does not return a null pointer, then handling this will result in memory savings for zero-size types. This also switches some code to `malloc_raw` in order to maintain a centralized point for handling out-of-memory in `rt::global_heap`. Closes #11634
2014-01-17auto merge of #11585 : nikomatsakis/rust/issue-3511-rvalue-lifetimes, r=pcwaltonbors-6/+0
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way. r? @pcwalton