Commit Graph

27629 Commits

Author SHA1 Message Date
bors
1217cfb9e7 auto merge of #13225 : thestinger/rust/num, r=cmr
The `Float` trait methods will be usable as functions via UFCS, and
we came to a consensus to remove duplicate functions like this a long
time ago.

It does still make sense to keep the duplicate functions when the trait
methods are static, unless the decision to leave out the in-scope trait
name resolution for static methods changes.
2014-04-01 13:26:49 -07:00
bors
b71c02e512 auto merge of #13115 : huonw/rust/rand-errors, r=alexcrichton
move errno -> IoError converter into std, bubble up OSRng errors

Also adds a general errno -> `~str` converter to `std::os`, and makes the failure messages for the things using `OSRng` (e.g. (transitively) the task-local RNG, meaning hashmap initialisation failures aren't such a black box).
2014-04-01 11:11:51 -07:00
Daniel Micay
5e12e1b1a4 remove the cmath module
This is an implementation detail of the `f32` and `f64` modules and it
should not be public. It renames many functions and leaves out any
provided by LLVM intrinsics, so it is not a sensible binding to the C
standard library's math library and will never be a stable target.

This also removes the abuse of link_name so that this can be switched to
using automatically generated definitions in the future. This also
removes the `scalbn` binding as it is equivalent to `ldexp` when
`FLT_RADIX` is 2, which must always be true for Rust.
2014-04-01 06:54:26 -04:00
Huon Wilson
bc7a2d72a3 rand: bubble up IO messages futher.
The various ...Rng::new() methods can hit IO errors from the OSRng they use,
and it seems sensible to expose them at a higher level. Unfortunately, writing
e.g. `StdRng::new().unwrap()` gives a much poorer error message than if it
failed internally, but this is a problem with all `IoResult`s.
2014-04-01 20:46:10 +11:00
Huon Wilson
0e8c949786 rand: bubble up IO errors when creating an OSRng. 2014-04-01 20:46:09 +11:00
Huon Wilson
119289b0f2 std: migrate the errno -> IoError converter from libnative.
This also adds a direct `errno` -> `~str` converter, rather than only
being possible to get a string for the very last error.
2014-04-01 20:46:09 +11:00
bors
b8ef9fd9c9 auto merge of #13184 : alexcrichton/rust/priv-fields, r=brson
This is an implementation of a portion of [RFC #4](https://github.com/rust-lang/rfcs/blob/master/active/0004-private-fields.md). This PR makes named struct fields private by default (as opposed to inherited by default).

The only real meaty change is the first commit to `rustc`, all other commits are just fallout of that change.

Summary of changes made:

* Named fields are private by default *everywhere*
* The `priv` keyword is now default-deny on named fields (done in a "lint" pass in privacy)

Changes yet to be done (before the RFC is closed)

* Change tuple structs to have private fields by default
* Remove `priv` enum variants
* Make `priv` a reserved keyword
2014-03-31 15:51:33 -07:00
Alex Crichton
37a3131640 doc: Update with changes in field privacy 2014-03-31 15:47:37 -07:00
Alex Crichton
8093427195 url: Switch privacy defaults where necessary 2014-03-31 15:47:37 -07:00
Alex Crichton
9aa4a94953 compiletest: Switch field privacy where necessary 2014-03-31 15:47:37 -07:00
Alex Crichton
d0a80cca6c rpass/cfail: Update field privacy where necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
0b36e9d913 num: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
b9b0ed521d green: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
eb08e8fec2 rustdoc: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
f0ee509229 rustuv: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
fab0f47fdf workcache: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
52974bd695 glob: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
89fa141cd7 rustc: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
3c76f4ac8d syntax: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
c034d0c854 test: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
abd7dd83a7 term: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
ee7016d95f serialize: Switch field privacy as necessary 2014-03-31 15:47:36 -07:00
Alex Crichton
e5a49a2fcf log: Swith field privacy as necessary 2014-03-31 15:47:35 -07:00
Alex Crichton
c9024d2922 arena: Switch field privacy as necessary 2014-03-31 15:47:35 -07:00
Alex Crichton
a49ce7f11a sync: Switch field privacy as necessary 2014-03-31 15:47:35 -07:00
Alex Crichton
02cf3751df rand: Switch field privacy as necessary 2014-03-31 15:47:35 -07:00
Alex Crichton
14587f88ca native: Switch field privacy as necessary 2014-03-31 15:47:35 -07:00
Alex Crichton
5f33588d75 getopts: Switch field privacy as necessary 2014-03-31 15:17:13 -07:00
Alex Crichton
8ad7e5481f collections: Switch field privacy as necessary 2014-03-31 15:17:12 -07:00
Alex Crichton
9a3d04ae76 std: Switch field privacy as necessary 2014-03-31 15:17:12 -07:00
Daniel Micay
8ca5caf4d9 num: rm wrapping of Float methods as functions
The `Float` trait methods will be usable as functions via UFCS, and
we came to a consensus to remove duplicate functions like this a long
time ago.

It does still make sense to keep the duplicate functions when the trait
methods are static, unless the decision to leave out the in-scope trait
name resolution for static methods changes.
2014-03-31 17:41:52 -04:00
Alex Crichton
f2a5c7a179 rustc: Switch struct fields to private by default
This commit switches privacy's checking of fields to have *all* fields be
private by default. This does not yet change tuple structs, this only affects
structs with named fields. The fallout of this change will follow shortly.

RFC: 0004-private-fields

cc #8122
Closes #11809
2014-03-31 14:32:18 -07:00
bors
a7e057d402 auto merge of #13189 : alexcrichton/rust/relnotes, r=brson 2014-03-31 13:06:37 -07:00
bors
ba2fcc1d34 auto merge of #13230 : Kroisse/rust/encodable-json, r=erickt
The implementation of `Encodable<E, S>` for `Json` doesn't need to assume `S` to be `IoError`, only the default encoders for `Json` are depend on it. So this can be parametrize to increase flexiblity. If not, types that implement `Encoder<E>` where `E` is not `IoError` can't be worked with `Json`.
2014-03-31 11:11:40 -07:00
Eunchong Yu
2deca5840e Json doesn't need to depend on IoError to implement Encodable #13230 2014-04-01 03:05:32 +09:00
bors
c821cacfed auto merge of #13223 : brson/rust/dist, r=alexcrichton 2014-03-31 09:41:34 -07:00
bors
1c2ccf0503 auto merge of #13221 : thestinger/rust/append, r=alexcrichton
These were only free functions on `~[T]` because taking self by-value
used to be broken.
2014-03-31 02:11:34 -07:00
bors
abb616209d auto merge of #13220 : brson/rust/from_iter, r=thestinger 2014-03-31 00:51:35 -07:00
Brian Anderson
d2686c751a mk: Workaround distcheck failure on mac. #13224
Mac can't actually build our source tarballs because it's `tar`
command doesn't support the --exclude-vcs flag. This is just
a workaround to make our mac nightlies work (we get our source
tarballs from the linux bot).
2014-03-31 00:10:13 -07:00
bors
6281299230 auto merge of #13206 : TeXitoi/rust/fix-shootout-k-nucleotide, r=alexcrichton
Correct printing (sort, new lines), reading on stdin.
2014-03-30 23:31:37 -07:00
Daniel Micay
cbbc1fc843 vec: convert append and append_one to methods
These were only free functions on `~[T]` because taking self by-value
used to be broken.
2014-03-31 01:13:48 -04:00
Brian Anderson
ee052198c5 Rename from_iterator to from_iter for consistency. 2014-03-30 21:45:55 -07:00
Brian Anderson
84e9c0692a mk: distcheck --uninstall 2014-03-30 21:23:43 -07:00
Brian Anderson
45f2d83d3c dist: Add libbacktrace to source tarballs 2014-03-30 21:13:25 -07:00
bors
e63b2d3077 auto merge of #13219 : brson/rust/dist-root, r=sfackler 2014-03-30 21:11:40 -07:00
Brian Anderson
cfb52a5d35 mk: Don't touch config.tmp or tmp/dist as root. Closes #13190
When running `make install` we are touching these files that can't
then be removed later.
2014-03-30 20:15:27 -07:00
bors
7a70c69a31 auto merge of #13218 : brson/rust/dist-mac, r=sfackler 2014-03-30 19:56:40 -07:00
Brian Anderson
4aa7a8a5c8 mk: Fix 'make dist' on Mac 2014-03-30 19:14:39 -07:00
bors
612e22e417 auto merge of #13216 : alexcrichton/rust/fix-configure-for-travis, r=sfackler
The previous regex was a bit to strict, rejecting versions such as 3.4.1 which
is apparently the version which travis is currently installing, causing all
travis builds to fail.
2014-03-30 17:21:40 -07:00
bors
2674a16c18 auto merge of #13211 : csherratt/rust/arc_fix, r=alexcrichton
This is a fix for #13210. fetch_sub returns the old value of the atomic variable, not the new one.
2014-03-30 16:01:43 -07:00