about summary refs log tree commit diff
path: root/src/libstd/util.rs
AgeCommit message (Collapse)AuthorLines
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-160/+0
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-09std: Clean up the swap function a littleBrian Anderson-8/+5
2014-02-09std: Stop parameterizing some memcpy functions over RawPtrBrian Anderson-3/+3
It unsafe assumptions that any impl of RawPtr is for actual pointers, that they can be copied by memcpy. Removing it is easy, so I don't think it's solving a real problem.
2014-02-09std: Add init and uninit to mem. Replace direct intrinsic usageBrian Anderson-2/+2
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-04Replace NonCopyable usage with NoPodFlavio Percoco-37/+1
cc #10834
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-4/+1
2014-01-03Remove std::eitherAlex Crichton-10/+0
2013-12-27std: uniform modules titles for docLuca Bruno-1/+1
This commit uniforms the short title of modules provided by libstd, in order to make their roles more explicit when glancing at the index. Signed-off-by: Luca Bruno <lucab@debian.org>
2013-12-03Move std::util::ignore to std::prelude::dropSteven Fackler-4/+0
It's a more fitting name for the most common use case of this function.
2013-11-28Register new snapshotsAlex Crichton-1/+1
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-8/+8
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-19Remove NonCopyable::newSteven Fackler-6/+0
The issue that required it has been fixed.
2013-10-17std: Move size/align functions to std::mem. #2240Brian Anderson-1/+1
2013-10-07Fix existing privacy/visibility violationsAlex Crichton-1/+1
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
2013-09-21auto merge of #9354 : thestinger/rust/cleanup, r=alexcrichtonbors-19/+0
I don't see the point of this function, and there are no users.
2013-09-20util: remove unused `with` functionDaniel Micay-19/+0
2013-09-19Replace unreachable() calls with unreachable!().Chris Morgan-28/+0
This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-16switch Drop to `&mut self`Daniel Micay-2/+2
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-2/+4
They are still present as part of the borrow check.
2013-08-02(cleanup) Use more do...finally in extra::sync.Ben Blum-0/+6
2013-07-22std: various additional language benchmarks in util.Graydon Hoare-0/+65
2013-07-22new snapshotDaniel Micay-8/+5
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-2/+4
2013-06-28fix stage0 buildDaniel Micay-5/+8
2013-06-27Rename #[no_drop_flag] to #[unsafe_no_drop_flag]Birunthan Mohanathas-2/+2
2013-06-27util: make NonCopyable 0 size (instead of 1 byte)Daniel Micay-12/+39
this also adds a derived Eq, TotalEq, Ord and TotalOrd along with removing the useless constructor
2013-06-25Change finalize -> drop.Luqman Aden-1/+1
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-5/+5
2013-06-12make util::NonCopyable a unit struct instead of a struct with a unitBen Blum-4/+2
2013-06-04std::util: fix missed old constructorPhilipp Brüschweiler-1/+1
2013-06-04std::util: Modernize NonCopyable constructorPhilipp Brüschweiler-3/+5
part of #3853
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-2/+2
2013-05-31mv the raw pointer {swap,replace}_ptr to std::ptrDaniel Micay-30/+0
2013-05-30Remove unnecessary 'use' formsDaniel Farina-1/+0
Fix a laundry list of warnings involving unused imports that glutted up compilation output. There are more, but there seems to be some false positives (where 'remedy' appears to break the build), but this particular set of fixes seems safe.
2013-05-30Require documentation by default for libstdAlex Crichton-1/+2
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-5/+4
2013-05-27syntax highlight code examples in docstringsDaniel Micay-1/+1
2013-05-23optimize util::swap, &mut pointers never aliasDaniel Micay-2/+13
2013-05-23swap_ptr: rm equality checkDaniel Micay-3/+1
This isn't needed semantically, and it's the wrong case to optimize for.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+190
This only changes the directory names; it does not change the "real" metadata names.
2012-08-02Remove std::utilBen Blum-21/+0
2012-07-04convert doc-attributes to doc-comments using ↵Gareth Daniel Smith-2/+2
./src/etc/sugarise-doc-comments.py (and manually tweaking) - for issue #2498
2012-03-09std: Convert to rustdocBrian Anderson-17/+2
2012-03-08Change util::unreachable to core::unreachableTim Chevalier-11/+0
Closes #1931
2012-01-14libstd: Remove util::voidBrian Anderson-5/+0
2012-01-14libstd: Remove util::orb. Redundant with core::boolBrian Anderson-5/+0
2012-01-05Switch to new param kind bound syntaxMarijn Haverbeke-1/+1
And remove support for the old syntax
2012-01-02Add 'copy' bounds to functions that were faultily accepted withoutMarijn Haverbeke-1/+1
Issue #1390
2011-12-06Establish 'core' library separate from 'std'.Graydon Hoare-0/+57