Commit Graph

1886 Commits

Author SHA1 Message Date
bors
3e97cce27d auto merge of #4957 : Kimundi/rust/incoming, r=catamorphism
Moved them into own module and made them not depend on an Round trait impl for integers and generic math functions that can fail on integers any more.
2013-02-15 17:29:57 -08:00
Graydon Hoare
1b87dedc0e attempt to fix BSD breakage 2013-02-15 17:28:51 -08:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08: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
bors
0528329a4f auto merge of #4964 : luqmana/rust/demove, r=graydon
As per #4339/#3676 this pull removes all uses `move` and gets rid of parsing it in libsyntax.
So that's one more thing to cross off #4707
2013-02-15 12:09:15 -08:00
bors
690d038d0b auto merge of #4959 : thestinger/rust/map, r=graydon 2013-02-15 11:26:41 -08:00
bors
0a1fcadc90 auto merge of #4958 : cpeterso/rust/reseed-rng, r=graydon
For Issue #4709:

**c531506 rt: rand.rs expects `rust_next()` to return `uint32_t`, not `size_t`**

rand.rs expects `rustrt::rand_next()` to return `u32`, but the `rand_next()` C function returns `size_t`: ca71c6ec5b/src/libcore/rand.rs (L34)

**f4320b6 move isaac RNG utility functions to new rust_rng.cpp file**
**665e900 encapsulate isaac RNG in `rust_rng` struct**

Move isaac's `randctx` into a `rust_rng` struct to make names similar to `rand::Rng` function names and prepare for auto-reseeding in the next commit.

**9a78dc9 reseed `rust_rng` after generating 32KB**

Precedents from other languages:
* Haskell's `GenAutoReseed` generator reseeds itself after generating 32KB: http://hackage.haskell.org/packages/archive/DRBG/0.1.2/doc/html/Crypto-Random-DRBG.html#t:GenAutoReseed

* Go's RNG reseeds itself after generating 1MB: https://code.google.com/p/go/source/browse/src/pkg/crypto/rand/rand_unix.go?name=go1.0.3#94

**9a76d71 don't deplete RNG entropy when there is only one runnable task**

`rust_sched_loop::schedule_task()` unnecessarily calls `isaac_rand()` for the common case when there is only 1 runnable task, thus depleting RNG entropy and incurring unnecessary overhead.
2013-02-15 10:06:12 -08:00
Niko Matsakis
91af52784a 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 09:25:16 -08:00
Marvin Löbel
46736868df Removed has_* predicates from NumStrConv trait
Moved `is_*` predicates into standalone functions
2013-02-15 13:39:51 +01:00
Luqman Aden
5912b1448c libcore: Get rid of move. 2013-02-15 02:49:54 -08:00
Daniel Micay
1561661db8 add reserve_at_least method to LinearMap/LinearSet 2013-02-15 02:39:20 -05:00
bors
9727008ed0 auto merge of #4944 : catamorphism/rust/xxx-to-fixme, r=catamorphism 2013-02-14 23:11:13 -08:00
Chris Peterson
665e900ede encapsulate isaac RNG in rust_rng struct 2013-02-14 22:31:08 -08:00
Daniel Micay
1e809aad3a rm FIXME from LinearMap's to_bucket
There are no more poor hash functions left in the codebase, and it makes
sense to rely on there being a good hash function thanks to the
inclusion of SipHash and the ease of using it with custom types.

Closes #3041
2013-02-15 00:55:46 -05:00
Marvin Löbel
a0846d4f6a tidy 2013-02-15 06:11:06 +01:00
Marvin Löbel
3edc7c0b9c Removed generic infinity, NaN and negative zero functions
Removed Round impl for integers
2013-02-15 05:46:07 +01:00
Marvin Löbel
df36a8dfc9 Long lines, proper FIXME, inlining 2013-02-15 05:40:01 +01:00
Marvin Löbel
bd93a36d73 Made num <-> str conversion functions use NumStrConv trait
Removed hacky dependency on Round trait and generic infinity functions
Removed generic-runtime-failure-depending-on-type behavior
2013-02-15 05:20:36 +01:00
Marvin Löbel
26e0aafb88 Added NumStrConv trait and impls for the string conversion functions 2013-02-15 04:40:32 +01:00
bors
5a9da65dc9 auto merge of #4937 : luqmana/rust/remove-mut-addr-of, r=catamorphism 2013-02-14 19:16:07 -08:00
Luqman Aden
206757f868 libcore: replace mut_addr_of properly on mac 2013-02-14 18:36:10 -08:00
Luqman Aden
cc89029942 libcore: Remove ptr::mut_addr_of since &mut is coerced to *mut 2013-02-14 18:36:10 -08:00
Marvin Löbel
adac6cb5c6 Moved numeric string conversion functions into own module 2013-02-15 03:29:36 +01:00
bors
20fd0c53ed auto merge of #4938 : thestinger/rust/no_zero, r=brson
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these.

This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
2013-02-14 18:27:54 -08:00
Tim Chevalier
dcb98f4097 core: Clean up XXXes 2013-02-14 18:17:56 -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
bors
3c07d037cd auto merge of #4934 : nickdesaulniers/rust/issue4524cleanup, r=brson
review? @brson
Issue #4524
2013-02-14 15:37:48 -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
4699ac67c6 Remove all final references to die! 2013-02-14 13:09:09 -08:00
Daniel Micay
22e88d510f stop zeroing all exchange allocations 2013-02-14 15:59:15 -05:00
Patrick Walton
216e85fadf libcore: Move the numeric operations out of Num. r=brson
Sadly I could not use trait inheritance due to a type parameter substitution
bug.
2013-02-14 08:14:01 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
bors
d5bf3b85d1 auto merge of #4908 : bstrie/rust/rimov3, r=pcwalton
This patch finishes removing inner vector mutability from the vast majority of the compiler. Exceptions:

* core::dvec: ideally this entire type will be able to be replaced by `~[]`, but Niko asked me to hold off on removing Dvecs until he makes some fixes to borrowed pointers. 
* liveness: liveness.rs is an impenetrable neutron star of deprecated semantics.
* compile-fail: I'm not sure if a lot of these tests are testing inner mutability or mutability in general. I figure that RIMOVing this folder should wait until this syntax is removed from the parser.

I also took this chance to remove many of the inner-mutability-related functions from core::vec, or as many uses of those functions as possible where still necessary. consume_mut and append_mut have been axed. cast_to_mut and cast_from_mut are still needed in a few places.
2013-02-13 15:09:07 -08:00
Graydon Hoare
e5aa399e0d rustc and std: teach about #[bench], modernize to use quote_expr! some. 2013-02-13 11:46:25 -08:00
Graydon Hoare
73280b0472 core: add abs to num. 2013-02-13 11:46:25 -08:00
Graydon Hoare
389125aeb8 core: add min and max to cmp, re-export various places. 2013-02-13 11:46:25 -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
Ben Striegel
4de76aeb14 RIMOV core::hash 2013-02-13 12:47:44 -05:00
Ben Striegel
808ccd3349 RIMOV core::io 2013-02-13 12:47:44 -05:00
Ben Striegel
3a3f7b8e55 RIMOV core::rand 2013-02-13 12:47:44 -05:00
Ben Striegel
2d2ed075e3 RIMOV core::run 2013-02-13 12:47:43 -05:00
bors
6016214101 auto merge of #4900 : luqmana/rust/core_os_errors, r=graydon
Rewrote the last pull request (#4859) to not require on llvm for core.

Also fixes #2269.
2013-02-12 21:27:22 -08:00
bors
27b3e01377 auto merge of #4914 : nikomatsakis/rust/issue-4856, r=nikomatsakis
and then adjust code to match. rs=unsound (will review post-landing)

rs=unsound
2013-02-12 20:40:19 -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
bors
6727c6fb56 auto merge of #4881 : bjz/rust/incoming, r=catamorphism 2013-02-12 16:22:58 -08:00
bors
91c59f5c9a auto merge of #4880 : erickt/rust/hashmap-cleanup, r=catamorphism 2013-02-12 15:24:42 -08:00
bors
bc2d147847 auto merge of #4858 : z0w0/rust/rm_weak_task_count, r=graydon 2013-02-12 14:36:33 -08:00
bors
210fa2d017 auto merge of #4874 : thestinger/rust/option, r=catamorphism 2013-02-12 10:35:12 -08:00
Luqman Aden
44b80ed0d6 Long lines. 2013-02-11 23:49:49 -05:00
Luqman Aden
70185fdcc2 rt: remove last_os_error and adjust tests. 2013-02-11 23:49:49 -05:00