Björn Steinbrink
bdc182cc41
Use static string with fail!() and remove fail!(fmt!())
...
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-14 16:36:23 +02:00
Alex Crichton
998fececd6
Stop using the '<->' operator
2013-05-10 22:51:06 -04:00
Alex Crichton
b05aae2d41
test: Use the new for
protocol
2013-05-10 19:20:20 -04:00
Alex Crichton
3ce9dba677
std: Use the new for
protocol
2013-05-10 02:46:18 -04:00
Patrick Walton
16a0125e41
libcore: Fix tests.
2013-05-08 17:04:01 -07:00
Alex Crichton
393a409b5d
Add pop() and swap() to the Map trait
2013-05-07 01:16:04 -04:00
Daniel Micay
f792baba42
only use #[no_core] in libcore
2013-04-27 21:34:24 -04:00
Huon Wilson
4a24f10ac6
libcore: unify gen_<type>
methods on rand::RngUtil
into the generic gen
.
...
This moves all the basic random value generation into the Rand instances for
each type and then removes the `gen_int`, `gen_char` (etc) methods on RngUtil,
leaving only the generic `gen` and the more specialised methods.
Also, removes some imports that are redundant due to a `use core::prelude::*`
statement.
2013-04-24 22:34:19 +10:00
Huon Wilson
6c0a7c7b7d
libcore: remove @Rng from rand, and use traits instead.
...
Also, rename RandRes -> IsaacRng, and make the constructors static
methods.
2013-04-24 22:34:10 +10:00
Daniel Micay
f82c96446f
iterator: use an IteratorUtil trait
2013-04-15 21:35:41 -04:00
Daniel Micay
8bf9fc52f4
initial iterator object library
2013-04-13 05:51:14 -04:00
Niko Matsakis
03396473b8
libstd: changes to in response to #5656
2013-04-10 17:32:03 -07:00
Niko Matsakis
5606fc0c90
Revert map.each to something which takes two parameters
...
rather than a tuple. The current setup iterates over
`BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared
*in the each method*. You can't place such a type in
the impl declaration. The compiler currently allows it,
but this will not be legal under #5656 and I'm pretty sure
it's not sound now.
2013-04-10 07:51:48 -07:00
Patrick Walton
1e91595520
librustc: Remove fail_unless!
2013-03-29 16:39:08 -07:00
Patrick Walton
8b56a8380b
librustc: Modify all code to use new lifetime binder syntax
2013-03-26 21:30:17 -07:00
Daniel Micay
38f39ac540
expose find_mut in the Map trait
2013-03-24 21:40:16 -04:00
Daniel Micay
7948149456
treemap: add a find_mut method
2013-03-24 16:58:52 -04:00
Patrick Walton
6d81307a9b
librustc: Add explicit lifetime binders and new lifetime notation in core/std/syntax/rustc
2013-03-22 22:24:35 -07:00
Daniel Micay
705c796ffa
remove obsolete purity workarounds
2013-03-22 18:08:56 -04:00
Patrick Walton
c1084091d4
libstd: Remove all uses of pure
from libstd. rs=depure
2013-03-22 10:29:17 -07:00
Patrick Walton
4634f7edae
librustc: Remove all uses of static
from functions. rs=destatic
2013-03-22 10:27:39 -07:00
Patrick Walton
e78f2e2ac5
librustc: Make the compiler ignore purity.
...
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.
There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
2013-03-18 17:21:16 -07:00
Patrick Walton
352c070365
librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming
2013-03-18 17:21:14 -07:00
Daniel Micay
2b6614f2e6
treemap: use each_mut instead of mutate
2013-03-15 14:14:03 -04:00
Daniel Micay
88278f9c35
treemap: rm old FIXME
2013-03-15 14:12:45 -04:00
Daniel Micay
a49ccee68e
MutableIter impl for Option + use it in treemap
2013-03-14 23:44:25 -04:00
bors
0c7aeddb5f
auto merge of #5365 : thestinger/rust/map, r=catamorphism
2013-03-14 15:06:49 -07:00
Patrick Walton
b1c699815d
librustc: Don't accept as Trait
anymore; fix all occurrences of it.
2013-03-13 20:07:09 -07:00
Daniel Micay
becad9bb07
add the mutate_values method to the Map trait
2013-03-13 19:33:10 -04:00
Daniel Micay
9b1a9ec4ea
treemap: fix a bug in the union implementation
2013-03-11 22:36:23 -04:00
Daniel Micay
2889a8a4e5
treemap: add more set tests
2013-03-11 22:36:23 -04:00
Daniel Micay
66afa5d17a
treemap: refactor the set operation tests
2013-03-11 22:36:19 -04:00
Daniel Micay
d55225f04a
treemap: add more tests for set difference
2013-03-11 15:02:55 -04:00
Daniel Micay
ad16fecc33
treemap: inline the TreeSet wrappers
2013-03-11 15:02:50 -04:00
Daniel Micay
a5c88366f8
treemap: indentation fixes
2013-03-11 15:02:18 -04:00
Daniel Micay
58cec70127
treemap: make set_advance public
2013-03-11 15:02:15 -04:00
Patrick Walton
bd2d17e4a1
libsyntax: Stop parsing bare functions in preparation for switching them over
2013-03-11 09:35:58 -07:00
Patrick Walton
d18f785457
librustc: Replace all uses of fn()
with &fn()
. rs=defun
2013-03-11 09:35:58 -07:00
Patrick Walton
d661711cc2
test: Fix tests.
2013-03-07 22:37:58 -08:00
Patrick Walton
d7e74b5e91
librustc: Convert all uses of assert
over to fail_unless!
2013-03-07 22:37:57 -08:00
Niko Matsakis
3168fe06ff
Add manual &self/ and &static/ and /&self declarations that
...
are currently inferred. New rules are coming that will require
them to be explicit. All add some explicit self declarations.
2013-03-06 15:12:57 -05:00
Daniel Micay
af645e8487
replace option::iter with a BaseIter impl
2013-03-03 11:01:17 -05:00
Daniel Micay
035233a259
treemap: reimplement using TotalOrd
2013-03-02 14:10:19 -05:00
Alex Crichton
2df07ddc25
Fix implicit leaks of imports throughout libraries
...
Also touch up use of 'pub' and move some tests around so the tested functions
don't have to be 'pub'
2013-02-28 18:00:34 -05:00
Patrick Walton
107bf96ff0
librustc: Mark all type implementations public. rs=impl-publicity
2013-02-28 11:32:24 -08:00
Daniel Micay
5b0a2d1fc0
treemap: improve the lazy iterator
...
* replace the dual next() and get() calls with a single next() function
* drop one of the pointer members from the struct
* add a method for using the lazy iterator with a for loop
2013-02-27 05:30:15 -05:00
Patrick Walton
bf2a225c0b
librustc: Separate most trait bounds with '+'. rs=plussing
2013-02-20 21:14:20 -08:00
Graydon Hoare
acc147769e
std: update rand-using tests, r=burningtree
2013-02-19 07:38:18 -08:00
Patrick Walton
9143688197
librustc: Replace impl Type : Trait
with impl Trait for Type
. rs=implflipping
2013-02-14 14:44:12 -08:00
Niko Matsakis
ab2534974c
Adjust borrow checker algorithm to address #4856 unsoundness,
...
and then adjust code to match. rs=unsound (will review post-landing)
2013-02-12 20:10:50 -08:00