Commit Graph

369 Commits

Author SHA1 Message Date
Marvin Löbel
a7d296f24c renamed str::view -> slice_DBG_BRWD
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method  -> slice_V_DBG_BRWD
2013-03-21 01:50:32 +01:00
Erick Tryzelaar
fe74a1c9a2 core: rename vec::rev_each{,i} to vec::each{,i}_reverse
I'm making this change because the _reverse suffix is more commonly
used in libcore/libstd.
2013-03-19 20:24:04 -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
Ben Striegel
748c2c9ebc impl Clone for ~T, ~[T], ~str 2013-03-15 18:26:59 -04:00
bors
c3fe0b97de auto merge of #5369 : thestinger/rust/iter, r=z0w0
This can eventually be implemented on other sequence containers like `deque` (it's missing `each` too at the moment).
2013-03-14 19:06:47 -07:00
Daniel Micay
c64a5d2d37 add a trait for mutable iterators 2013-03-13 21:29:48 -04:00
ILyoan
ef0364e9e4 Remove unused import in core 2013-03-14 09:52:51 +09:00
Jeff Olson
a04ba76f8e core: fix broken tests on windows 2013-03-11 15:38:55 -07:00
Brian Anderson
c88ce30c48 core: Add vec::raw::mut_buf_as_slice 2013-03-11 13:44:32 -07:00
Patrick Walton
d18f785457 librustc: Replace all uses of fn() with &fn(). rs=defun 2013-03-11 09:35:58 -07:00
Daniel Micay
788de758e3 vec: cleanup 2013-03-09 16:53:39 -05:00
Daniel Micay
06a336ae79 vec: renovate the BaseIter impl
* add 'self region to the borrowed pointer parameter
* rm workaround for #2263
* inline (wrappers)
* iter-trait is gone
2013-03-09 16:27:15 -05: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
Patrick Walton
fd271adc75 libcore: Remove extern mod { ... } from libcore. rs=deexterning 2013-03-07 22:32:51 -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
Erick Tryzelaar
743cfce703 core: convert vec::{last,last_opt} to return references 2013-03-05 19:39:18 -08:00
Erick Tryzelaar
d60747a248 core: convert vec::{init,initn} to return references 2013-03-05 19:37:04 -08:00
Erick Tryzelaar
5ae06ae9de core: convert vec::{tail,tailn} to return references 2013-03-05 19:37:04 -08:00
Erick Tryzelaar
359bb3e10b core: convert vec::{head,head_opt} to return references 2013-03-05 19:37:04 -08:00
Patrick Walton
2fa2ad5995 libcore: Implement an Equiv trait and use it on hashmaps.
7.3x speedup in string map search speed on a microbenchmark of pure hashmap
searching against a constant string, due to the lack of allocations.

I ran into a few snags.

1. The way the coherence check is set up, I can't implement `Equiv<@str>` and
   `Equiv<~str>` for `&str` simultaneously.

2. I wanted to implement `Equiv<T>` for all `T:Eq` (i.e. every type can be
   compared to itself if it implements `Eq`), but the coherence check didn't
   like that either.

3. I couldn't add this to the `Map` trait because `LinearMap` needs special
   handling for its `Q` type parameter: it must not only implement `Equiv<T>`
   but also `Hash` and `Eq`.

4. `find_equiv(&&"foo")` doesn't parse, because of the double ampersand. It has
   to be written `find_equiv(& &"foo")`. We can probably just fix this.

Nevertheless, this is a huge win; it should address a major source of
performance problems, including the one here:

http://maniagnosis.crsr.net/2013/02/creating-letterpress-cheating-program.html
2013-03-05 10:18:36 -08:00
Alex Crichton
dfb5c10dea Remove unused imports throughout src/ 2013-03-04 12:27:01 -05:00
bors
2304fe6208 auto merge of #5196 : thestinger/rust/ord, r=catamorphism
This allows `TreeMap`/`TreeSet` to fully express their requirements and reduces the comparisons from ~1.5 per level to 1 which really helps for string keys.

I also added `ReverseIter` to the prelude exports because I forgot when I originally added it.
2013-03-02 05:15:39 -08:00
Daniel Micay
ca1ceb15b1 add a TotalOrd trait 2013-03-02 14:10:16 -05:00
Brian Anderson
bcf626812b Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08: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
573a31dfa7 libsyntax: Forbid mutable vectors. rs=demuting 2013-02-27 09:40:16 -08:00
Graydon Hoare
0309af458c Put unique allocs in managed heap when they might contain managed boxes. 2013-02-21 23:01:17 -08:00
bors
a02da4ecde auto merge of #5063 : pcwalton/rust/plussing, r=pcwalton 2013-02-20 21:22:30 -08:00
Patrick Walton
bf2a225c0b librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
Matthijs 'Thiez' Hofstra
9776c38731 Changed a test to use intrinsics.rs and changed a few lines that were too long, had bad whitespace, etc. 2013-02-20 20:45:17 +01:00
Matthijs 'Thiez' Hofstra
675bdcf341 Created libcore/private/intrinsics.rs, which aims to contain every
rustc intrinsic. Several files in libcore have been changed to use
these intrinsics.
As of yet, none of the intrinsics are documented.
2013-02-20 20:39:49 +01:00
Daniel Micay
6956e81c9b vec: grow_fn doesn't require Copy 2013-02-17 14:09:09 -05:00
bors
566bcf2225 auto merge of #4969 : nickdesaulniers/rust/issue3869, r=brson
Issue #3869
review? @nikomatsakis 

Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
Fix windows build error.  `buf` is borrowed by the call to
`as_mut_buf()` and so we must invoke `slice()` outside of that
call.
2013-02-15 13:54:49 -08:00
Luqman Aden
5912b1448c libcore: Get rid of move. 2013-02-15 02:49:54 -08:00
Nick Desaulniers
5d62a4a52e Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
2013-02-14 16:14:32 -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
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
Ben Striegel
e6c82c0375 RIMOV core::vec
Also remove as many uses as possible of vec::cast_to_mut and
cast_from_mut
2013-02-13 12:48:24 -05: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
Niko Matsakis
a32498d846 Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
correct handling of moves for struct-record update.

Part of #3678.  Fixes #2828, #3904, #4719.
2013-02-07 05:53:30 -08:00
Nick Desaulniers
aee7929469 Replace most invocations of fail keyword with die! macro 2013-01-31 20:12:49 -08:00
Seo Sanghyeon
7b268e8316 Cleanup FIXMEs (#3488) 2013-01-31 19:23:18 +09:00
Patrick Walton
28ed9dc09e librustc: Long lines. rs=burning 2013-01-29 22:40:13 -08:00
Patrick Walton
0c1d9befb3 librustc: Speed up byte copy operations. r=nmatsakis 2013-01-29 22:15:06 -08:00
Daniel Micay
e4337a9def remove remaining is_not_empty functions/methods 2013-01-24 23:24:57 -05:00
Daniel Micay
ec3f6e1932 implement Mutable trait for vec 2013-01-24 23:10:14 -05:00
Daniel Micay
d95c9cbe38 replace ConstVector trait with the Container trait 2013-01-24 23:02:44 -05:00
Erick Tryzelaar
e4d4a1499b convert most of libcore records into structs 2013-01-24 16:24:30 -08:00