about summary refs log tree commit diff
path: root/src/libcore/util.rs
AgeCommit message (Collapse)AuthorLines
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-1/+1
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-12auto merge of #6348 : sstewartgallus/rust/incoming, r=brsonbors-1/+15
In this commit I added a useful utility type, named Void, that encapsulates the doable but annoying job of creating an uninhabited type. As well, a function on that type, named absurd, was created which is useful for ignoring the result of matching on that type. No unit tests were created because it is not possible to create an instance of this type to test the usage of. This type is useful because it is like NonCopyable in that it can be used to create a type with special characteristics without special bloat. For instance, instead of typing pub struct PhantomType { priv contents : () } for each void type one may want to use one can simply type pub struct PhantomType (Void);. This type make such special cases much easier to write.
2013-05-10Stop using the '<->' operatorAlex Crichton-3/+3
2013-05-10Implement util::swap without the '<->' operatorAlex Crichton-5/+63
2013-05-08Created utility uninhabited typeSteven Stewart-Gallus-1/+15
In this commit I added a useful utility type, named Void, that encapsulates the doable but annoying job of creating an uninhabited type. As well, a function on that type, named absurd, was created which is useful for ignoring the result of matching on that type. No unit tests were created because it is not possible to create an instance of this type to test the usage of. This type is useful because it is like NonCopyable in that it can be used to create a type with special characteristics without special bloat. For instance, instead of typing pub struct PhantomType { priv contents : () } for each void type one may want to use one can simply type pub struct PhantomType (Void);. This type make such special cases much easier to write.
2013-05-02fix numerous dynamic borrow failuresNiko Matsakis-9/+10
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-7/+7
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-2/+2
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-7/+7
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-0/+1
2013-03-04Remove unused imports throughout src/Alex Crichton-2/+1
2013-02-27Turn old `drop` blocks into `Drop` traitsBen Striegel-1/+4
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-1/+1
2013-02-15libcore: Get rid of `move`.Luqman Aden-7/+7
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-1/+1
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-4/+0
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
2013-01-31Replace most invocations of fail keyword with die! macroNick Desaulniers-1/+1
2013-01-29libcore: De-export libcore. rs=deexportingPatrick Walton-5/+3
2013-01-24remove remaining is_not_empty functions/methodsDaniel Micay-1/+1
2013-01-08librustc: Make unqualified identifier searches terminate at the nearest ↵Patrick Walton-0/+5
module scope. r=tjc
2013-01-08Revert "librustc: Make unqualified identifier searches terminate at the ↵Patrick Walton-5/+0
nearest module scope. r=tjc" This reverts commit a8d37af2473da79be704c9ce2374f278c47177b6.
2013-01-08librustc: Make unqualified identifier searches terminate at the nearest ↵Patrick Walton-0/+5
module scope. r=tjc
2012-12-03Update license, add license boilerplate to most files. Remainder will follow.Graydon Hoare-0/+10
2012-10-23Remove uses of binary move - <- - from tests and librariesTim Chevalier-1/+1
2012-10-12Make moves explicit in core testsTim Chevalier-1/+1
2012-10-04Forbid deprecated modes again in coreTim Chevalier-1/+1
Sadly, there's only one file that requires deprecated modes (stackwalk)... So, forbid them everywhere else.
2012-10-02Removing explicit uses of + modeTim Chevalier-5/+5
This removes most explicit uses of the + argument mode. Pending a snapshot, I had to remove the forbid(deprecated_modes) pragma from a bunch of files. I'll put it back! + mode still has to be used in a few places for functions that get moved (see task.rs) The changes outside core and std are due to the to_bytes trait and making the compiler (with legacy modes on) agree with the libraries (with legacy modes off) about modes.
2012-09-28De-export logging, to_str, to_bytes, from_str, util. Part of #3583.Graydon Hoare-8/+8
2012-09-21Install new pub/priv/export rules as defaults, old rules accessible under ↵Graydon Hoare-0/+1
#[legacy_exports];
2012-09-20core: Move 'unreachable' to util. Improve docsBrian Anderson-0/+28
2012-09-20rustc: De-mode all overloaded operatorsPatrick Walton-1/+1
2012-09-19core: Clean up crate docs and give all mods a brief descriptionBrian Anderson-4/+6
2012-09-12Add a bunch of inline hints.Graydon Hoare-0/+2
2012-09-10Make more moves explicit in libcoreTim Chevalier-3/+3
2012-09-07Convert all kind bounds to camel case. Remove send, owned keywords.Brian Anderson-1/+1
2012-09-07Convert field terminators to commas. Stop parsing semis.Brian Anderson-1/+1
2012-09-06Refactor trans to replace lvalue and friends with Datum.Niko Matsakis-1/+3
Also: - report illegal move/ref combos whether or not ref comes first - commented out fix for #3387, too restrictive and causes an ICE
2012-09-04core: Remove struct ctorsBrian Anderson-1/+2
2012-08-30libstd: More test fixesPatrick Walton-1/+3
2012-08-29rustc: Make `<` and `=` into traitsPatrick Walton-1/+1
2012-08-26Camel case the option typeBrian Anderson-2/+2
2012-08-21implement a map testing benchmarkNiko Matsakis-0/+18
This involved some other changes: - add a managed<T> wrapper that makes send_map usable from @-data - implement map<K,V> for managed<send_map> Unit tests are coming.
2012-08-17Remove the class keywordBrian Anderson-1/+1
2012-08-14De-mode more pieces of core.Graydon Hoare-0/+4
2012-08-13core: Camel case some lesser-used modulesBrian Anderson-2/+2
2012-08-07Add util::ignoreBen Blum-0/+3
2012-08-02option::swap_unwrap, the ubiquitous 'option dance'.Ben Blum-0/+2
2012-08-02Remove std::utilBen Blum-0/+9
2012-08-01Add core::util, with swap, replace, and noncopyableBen Blum-0/+46