Commit Graph

28247 Commits

Author SHA1 Message Date
Stepan Koltsov
026d206aa1 Reimplement Vec::push_all* with .extend
It is shorter and also fixes missed reserve call.
2014-04-01 20:16:59 +00:00
Stepan Koltsov
08e95a87b8 Vec::reserve_exact should not shrink
reserve_exact should not shrink according to documentation.
2014-04-01 20:16:59 +00: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
Ted Horst
a8308fbb76 make Cmplx fields public 2014-04-01 12:58:13 -05:00
Corey Richardson
3f8d1588e8 metadata: cstore: remove dead code 2014-04-01 10:19:10 -04:00
Corey Richardson
6ce37e8dd7 metadata: csearch: remove dead code 2014-04-01 10:18:53 -04:00
Corey Richardson
86e6a80d8d metadata: common: remove dead code 2014-04-01 10:17:32 -04:00
Corey Richardson
aae9594932 lib: llvm: remove dead code 2014-04-01 10:17:18 -04:00
Corey Richardson
59645c1209 back: link: remove dead code 2014-04-01 10:16:58 -04:00
Corey Richardson
74ddaa27e7 back: archive: remove dead code 2014-04-01 10:16:46 -04:00
Corey Richardson
5a4c8a9c57 back: abi: remove dead code 2014-04-01 10:12:02 -04:00
Huon Wilson
50fca0fbbb std: fix Cell's Show instance.
Previously it was printing the address of the Unsafe contained in the
Cell (i.e. the address of the Cell itself). This is clearly useless, and
was presumably a mistake due to writing `*&` instead of `&*`.

However, this later expression is likely also incorrect, since it takes
a reference into a Cell while other user code is executing (i.e. the
Show instance for the contained type), hence the contents should just be
copied out.
2014-04-01 23:58:31 +11:00
Corey Richardson
3b4a5174c0 rustc: make comments on CrateContext doc comments 2014-04-01 07:11:23 -04: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
Steven Fackler
129cf09209 Make libtime fields public 2014-03-31 23:47:49 -07:00
Gábor Lehel
be673e77e7 syntax: allow stmt/expr macro invocations to be delimited by [].
this is useful for macros like vec! which construct containers
2014-03-31 22:42:31 -07:00
klutzy
e481ced80f doc: Update windows status on FAQ 2014-04-01 14:42:04 +09:00
Alex Crichton
922dcfdc69 Switch some tuple structs to pub fields
This commit deals with the fallout of the previous change by making tuples
structs have public fields where necessary (now that the fields are private by
default).
2014-03-31 19:50:51 -07:00
Alex Crichton
683197975c rustc: Switch tuple structs to have private fields
This is a continuation of the work done in #13184 to make struct fields private
by default. This commit finishes RFC 4 by making all tuple structs have private
fields by default. Note that enum variants are not affected.

A tuple struct having a private field means that it cannot be matched on in a
pattern match (both refutable and irrefutable), and it also cannot have a value
specified to be constructed. Similarly to private fields, switching the type of
a private field in a tuple struct should be able to be done in a backwards
compatible way.

The one snag that I ran into which wasn't mentioned in the RFC is that this
commit also forbids taking the value of a tuple struct constructor. For example,
this code now fails to compile:

    mod a {
        pub struct A(int);
    }

    let a: fn(int) -> a::A = a::A; //~ ERROR: first field is private

Although no fields are bound in this example, it exposes implementation details
through the type itself. For this reason, taking the value of a struct
constructor with private fields is forbidden (outside the containing module).

RFC: 0004-private-fields
2014-03-31 18:59:46 -07: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
a5681d2590 Bump version to 0.10 2014-03-31 14:40:44 -07: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