Commit Graph

23619 Commits

Author SHA1 Message Date
Daniel Micay
ce54c34f02 drop unused frame_address intrinsic
Closes #10001
2013-10-24 00:42:29 -04:00
Daniel Micay
a3ae48cb36 mark some functions as returning !
Closes #10023
2013-10-23 22:23:28 -04:00
bors
e2428b791c auto merge of #10032 : thestinger/rust/snapshot, r=huonw 2013-10-23 15:11:07 -07:00
Daniel Micay
142672dca4 register snapshots 2013-10-23 18:06:12 -04:00
bors
860cb81b59 auto merge of #10022 : hatahet/rust/master, r=alexcrichton
Fixes #9958
2013-10-23 11:36:13 -07:00
Ziad Hatahet
dabf377438 Made uv_stat_t.{st_dev, st_ino} public, #9958 2013-10-23 11:16:35 -07:00
Ziad Hatahet
7d69837bd2 Merge remote-tracking branch 'upstream/master' 2013-10-23 10:09:06 -07:00
bors
f09959361b auto merge of #10034 : sfackler/rust/time, r=alexcrichton
These are supposed to be raw C-like structs mirroring time.h's struct tm
and struct timespec.
2013-10-23 09:41:14 -07:00
Steven Fackler
870f3bc341 Re-make time struct fields public
These are supposed to be raw C-like structs mirroring time.h's struct tm
and struct timespec.
2013-10-23 09:06:31 -07:00
bors
a4ec8af4c5 auto merge of #9810 : huonw/rust/rand3, r=alexcrichton
- Adds the `Sample` and `IndependentSample` traits for generating numbers where there are parameters (e.g. a list of elements to draw from, or the mean/variance of a normal distribution). The former takes `&mut self` and the latter takes `&self` (this is the only difference).
- Adds proper `Normal` and `Exp`-onential distributions
- Adds `Range` which generates `[lo, hi)` generically & properly (via a new trait) replacing the incorrect behaviour of `Rng.gen_integer_range` (this has become `Rng.gen_range` for convenience, it's far more efficient to use `Range` itself)
- Move the `Weighted` struct from `std::rand` to `std::rand::distributions` & improve it
- optimisations and docs
2013-10-23 08:31:21 -07:00
bors
5de50a3f71 auto merge of #10027 : catamorphism/rust/testcases-2013-10-22, r=catamorphism 2013-10-23 02:06:12 -07:00
bors
8c97c5ebfd auto merge of #10021 : alexcrichton/rust/asm-now-analyzed-correctly, r=luqmana
We got a snapshot, taking care of a note to myself.
2013-10-23 00:01:23 -07:00
bors
c1ef1ce947 auto merge of #10015 : huonw/rust/minor-fixes, r=alexcrichton
- Use ["nothing up my sleeve numbers"](http://en.wikipedia.org/wiki/Nothing_up_my_sleeve_number) for the ISAAC tests.
- Replace the default implementation of `Rng.fill_bytes` with something that doesn't try to do bad things with `transmute` and vectors just for the sake of a little speed.
- Replace the transmutes used to seed the ISAAC RNGs with calls into `vec::raw`.
2013-10-22 22:51:10 -07:00
Tim Chevalier
567a03d19b testsuite: Test cases, all except issue-5216 xfailed 2013-10-22 21:04:15 -07:00
bors
4cbc8ad397 auto merge of #9654 : catamorphism/rust/rustpkg-c-dependencies, r=brson
r? @brson api::install_pkg now accepts an argument that's a list of
(kind, path) dependency pairs. This allows custom package scripts to
declare C dependencies, as is demonstrated in
rustpkg::tests::test_c_dependency_ok.

Closes #6403
2013-10-22 20:56:05 -07:00
Tim Chevalier
c97957588b rustpkg: Support arbitrary dependencies in the install API
api::install_pkg now accepts an argument that's a list of
(kind, path) dependency pairs. This allows custom package scripts to
declare C dependencies, as is demonstrated in
rustpkg::tests::test_c_dependency_ok.

Closes #6403
2013-10-22 20:41:29 -07:00
bors
78573149cb auto merge of #9989 : luqmana/rust/mut-everywhere, r=alexcrichton 2013-10-22 19:46:09 -07:00
Luqman Aden
b2b2095eaf Update the manual. 2013-10-22 21:37:42 -04:00
Ziad Hatahet
60245b9290 Remove thread-blocking call to libc::stat in Path::stat
Fixes #9958
2013-10-22 18:25:07 -07:00
Luqman Aden
03111fb83b Add tests for uniq & by-value self in mut slot. 2013-10-22 21:22:19 -04:00
Luqman Aden
af163579ed libsyntax/librustc: Allow specifying mut on ~self. 2013-10-22 21:22:19 -04:00
Luqman Aden
5754848f8c libsyntax/librustc: Allow specifying mut on by-value self. 2013-10-22 21:21:21 -04:00
Huon Wilson
6e7bbdacb9 std::rand: seed ISAAC with no transmutes.
Slice transmutes are now (and, really, always were) dangerous, so we
avoid them and do the (only?) non-(undefined behaviour in C) pointer
cast: casting to *u8.
2013-10-23 11:50:45 +11:00
Huon Wilson
b8932c6304 std::rand: use "nothing up your sleeve numbers" for ISAAC tests.
There's no value in using the "random" numbers, when nothing up your
sleeve numbers are perfectly serviceable.

http://en.wikipedia.org/wiki/Nothing_up_my_sleeve_number
2013-10-23 11:50:45 +11:00
Huon Wilson
14a6a62a74 std::rand: simplify/safe-ify the default Rng.fill_bytes.
The `&[u8]` -> `&[u64]` and `&[u32]` casts were not nice: they ignored
alignment requirements and are generally very unsafe.
2013-10-23 11:50:45 +11:00
bors
22a5ebdc6b auto merge of #10020 : mletterle/rust/documentation-fixes, r=thestinger
I'm planning on doing more updates, but the section in the tutorial stood out at me since the 'rust' tool no longer exists, this should probably be removed to lessen confusion.
2013-10-22 17:06:09 -07:00
Huon Wilson
0bba73c0d1 std::rand: move Weighted to distributions.
A user constructs the WeightedChoice distribution and then samples from
it, which allows it to use binary search internally.
2013-10-23 10:40:06 +11:00
Huon Wilson
83aa1abb19 std::rand: lengthen the RNG benchmarks.
This makes them more representative, as the `bh.iter` is a smaller
percentage of the total time.
2013-10-23 10:40:06 +11:00
Huon Wilson
ed5f2d7c7c std::rand: optimise & document ziggurat.
Before:

    test rand::distributions::bench::rand_exp ... bench: 1399 ns/iter (+/- 124) = 571 MB/s
    test rand::distributions::bench::rand_normal ... bench: 1611 ns/iter (+/- 123) = 496 MB/s

After:

    test rand::distributions::bench::rand_exp ... bench: 712 ns/iter (+/- 43) = 1123 MB/s
    test rand::distributions::bench::rand_normal ... bench: 1007 ns/iter (+/- 81) = 794 MB/s
2013-10-23 10:40:06 +11:00
Huon Wilson
e0eb128086 std::rand: documentation & references.
Most importantly, links to the papers/references for the core
algorithms (the RNG ones & the distribution ones).
2013-10-23 10:40:06 +11:00
Huon Wilson
148f737c19 std::rand: add distributions::Range for generating [lo, hi).
This reifies the computations required for uniformity done by
(the old) `Rng.gen_integer_range` (now Rng.gen_range), so that they can
be amortised over many invocations, if it is called in a loop.

Also, it makes it correct, but using a trait + impls for each type,
rather than trying to coerce `Int` + `u64` to do the right thing. This
also makes it more extensible, e.g. big integers could & should
implement SampleRange.
2013-10-23 10:40:06 +11:00
Huon Wilson
1420272ddc std::rand: full exponential & normal distributions
Complete the implementation of Exp and Normal started by Exp1 and
StandardNormal by creating types implementing Sample & IndependentSample
with the appropriate parameters.
2013-10-23 10:40:06 +11:00
Huon Wilson
5aaef138ff std::rand: Add RandSample for Sample-ing Rand types directly. 2013-10-23 10:40:06 +11:00
Huon Wilson
2cd772bdba std::rand: add the Sample and IndependentSample traits.
These are a "parameterised" Rand.
2013-10-23 10:40:06 +11:00
Alex Crichton
e6d8f06cad Tidy up asm! usage in libstd 2013-10-22 15:59:19 -07:00
bors
a7453ad0df auto merge of #9969 : reedlepee123/rust/priv_fields, r=bstrie 2013-10-22 15:31:26 -07:00
reedlepee
7e6f5bb5c9 Making ai_next field public 2013-10-23 03:25:10 +05:30
bors
b477f7a7b7 auto merge of #10013 : bdash/rust/mavericks-unwinding, r=alexcrichton
OS X 10.9's linker has a bug that results in it failing to preserve
DWARF unwind information when passed the -no_compact_unwind flag.
This flag is passed on OS X because the unwind information for
__morestack cannot be represented by the compact unwind format.

We can work around this problem by using a more targeted approach
to disabling compact unwind information. The OS X linker looks for
a particular pattern in the DWARF unwind information and will not
attempt to convert the unwind information to the compact format.
The pattern in question is the return address register being saved
twice to the same location.

Fixes #6849.
2013-10-22 13:46:25 -07:00
reedlepee
c76222f732 Removed the file src/libstd/unstable/extfmt.r 2013-10-23 01:21:03 +05:30
reedlepee
930ded404a Removed the unnecesary comments 2013-10-23 01:10:50 +05:30
reedlepee
92662a9f91 Removed unnecessary comments and white spaces as suggested 2013-10-23 01:10:50 +05:30
reedlepee
ad465441ba Removed Unnecessary comments and white spaces #4386 2013-10-23 01:10:50 +05:30
reedlepee
0ada7c7ffe Making fields in std and extra : private #4386 2013-10-23 01:10:50 +05:30
reedlepee
dadb6f0cd9 Don't Make str field private 2013-10-23 01:10:49 +05:30
bors
ae0905ab67 auto merge of #9923 : thestinger/rust/managed_boxes, r=brson
I'll flip this on after doing a snapshot. This syntax may or may not
stay around, and managed boxes are currently not very useful. They have
the same overall performance characteristics as `std::rc::Rc`, but are
significantly slower, allocate larger boxes and hold onto the memory
beyond when it is needed due to lacking move semantics.

There are currently two useful aspects of the type:

* the dereference sugar, which we should implement for `Rc`
* the annihilator freeing cycles at the end of the task
2013-10-22 11:51:23 -07:00
Michael Letterle
d83c5f7b1b Minor grammatical fixes and removed section on 'rust' tool 2013-10-22 14:30:27 -04:00
Daniel Micay
38c620e758 add feature gate for managed boxes
I'll flip this on after doing a snapshot. This syntax may or may not
stay around, and managed boxes are currently not very useful. They have
the same overall performance characteristics as `std::rc::Rc`, but are
significantly slower, allocate larger boxes and hold onto the memory
beyond when it is needed due to lacking move semantics.

There are currently two useful aspects of the type:

* the dereference sugar, which we should implement for `Rc`
* the annihilator freeing cycles at the end of the task
2013-10-22 13:47:08 -04:00
bors
fd2c0128a7 auto merge of #10006 : alexcrichton/rust/another-massive-rename, r=brson
Drop the `2` suffix on all of them, updating all code in the process of doing so. This is a completely automated change, and it's dependent on the snapshots going through.
2013-10-22 09:24:48 -07:00
bors
cd8c7cf612 auto merge of #10002 : catamorphism/rust/bug-report-docs, r=alexcrichton
r? @alexcrichton And also reference the bug report HOWTO in CONTRIBUTING.md
2013-10-22 08:11:52 -07:00
Alex Crichton
3ed18bdd42 Remove old logging from the tutorial 2013-10-22 08:10:34 -07:00