]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #13237 : alexcrichton/rust/private-tuple-structs, r=brson
bors [Fri, 4 Apr 2014 01:41:45 +0000 (18:41 -0700)]
auto merge of #13237 : alexcrichton/rust/private-tuple-structs, r=brson

This is the final commit need to implement [RFC #4](https://github.com/rust-lang/rfcs/blob/master/active/0004-private-fields.md), it makes all tuple struct fields private by default, overridable with the `pub` keyword.

I'll note one divergence from the original RFC which is outlined in the first commit.

10 years agoauto merge of #13290 : alexcrichton/rust/rollup, r=alexcrichton
bors [Fri, 4 Apr 2014 00:17:02 +0000 (17:17 -0700)]
auto merge of #13290 : alexcrichton/rust/rollup, r=alexcrichton

Closes #13285 (rustc: Stop using LLVMGetSectionName)
Closes #13280 (std: override clone_from for Vec.)
Closes #13277 (serialize: add a few missing pubs to base64)
Closes #13275 (Add and remove some ignore-win32 flags)
Closes #13273 (Removed managed boxes from libarena.)
Closes #13270 (Minor copy-editing for the tutorial)
Closes #13267 (fix Option<~ZeroSizeType>)
Closes #13265 (Update emacs mode to support new `#![inner(attribute)]` syntax.)
Closes #13263 (syntax: Remove AbiSet, use one Abi)

10 years agoTest fixes from the rollup
Alex Crichton [Thu, 3 Apr 2014 21:09:16 +0000 (14:09 -0700)]
Test fixes from the rollup

10 years agoauto merge of #13286 : alexcrichton/rust/release, r=brson
bors [Thu, 3 Apr 2014 20:52:03 +0000 (13:52 -0700)]
auto merge of #13286 : alexcrichton/rust/release, r=brson

Merging the 0.10 release into the master branch.

10 years agosyntax: Remove AbiSet, use one Abi
Alex Crichton [Wed, 2 Apr 2014 08:19:41 +0000 (01:19 -0700)]
syntax: Remove AbiSet, use one Abi

This change removes the AbiSet from the AST, converting all usage to have just
one Abi value. The current scheme selects a relevant ABI given a list of ABIs
based on the target architecture and how relevant each ABI is to that
architecture.

Instead of this mildly complicated scheme, only one ABI will be allowed in abi
strings, and pseudo-abis will be created for special cases as necessary. For
example the "system" abi exists for stdcall on win32 and C on win64.

Closes #10049

10 years agoUpdate emacs mode to support new `#![inner(attribute)]` syntax.
Felix S. Klock II [Wed, 2 Apr 2014 21:50:20 +0000 (23:50 +0200)]
Update emacs mode to support new `#![inner(attribute)]` syntax.

10 years agofix Option<~ZeroSizeType>
Daniel Micay [Wed, 2 Apr 2014 21:23:52 +0000 (17:23 -0400)]
fix Option<~ZeroSizeType>

1778b6361627c5894bf75ffecf427573af02d390 provided the guarantee of no
`exchange_free` calls for ~ZeroSizeType, so a sentinel can now be used
without overhead.

Closes #11998

10 years agoMinor spelling/grammar/usage fixes.
Matt Brubeck [Thu, 3 Apr 2014 00:02:18 +0000 (17:02 -0700)]
Minor spelling/grammar/usage fixes.

Note: "different to" is not exactly incorrect, but "different from" is more
commonly accepted in both US and Commonwealth English, and also more
consistent with other usage within this tutorial.

10 years agoFix reference to "these two traits."
Matt Brubeck [Wed, 2 Apr 2014 23:56:23 +0000 (16:56 -0700)]
Fix reference to "these two traits."

There are actually three traits listed.

10 years ago`extern crate` and `mod` are not easily confused
Matt Brubeck [Wed, 2 Apr 2014 23:54:33 +0000 (16:54 -0700)]
`extern crate` and `mod` are not easily confused

Remove some statements that used to refer to similarities between `mod` and
`extern mod`, before the latter was renamed to `extern crate`.

10 years agoRemoved managed boxes from libarena.
Benjamin Adamson [Thu, 3 Apr 2014 03:06:55 +0000 (20:06 -0700)]
Removed managed boxes from libarena.

10 years agotest/run-pass: Add/remove some ignore-win32 flags
klutzy [Thu, 3 Apr 2014 03:34:26 +0000 (12:34 +0900)]
test/run-pass: Add/remove some ignore-win32 flags

10 years agotest/debug-info: Add/remove ignore-win32 flags
klutzy [Thu, 3 Apr 2014 03:18:58 +0000 (12:18 +0900)]
test/debug-info: Add/remove ignore-win32 flags

Fixes #10474

10 years agocompiletest: Fix bitrotted win32 routines
klutzy [Tue, 1 Apr 2014 07:10:56 +0000 (16:10 +0900)]
compiletest: Fix bitrotted win32 routines

10 years agoserialize: add a few missing pubs to base64
Arcterus [Thu, 3 Apr 2014 07:28:40 +0000 (00:28 -0700)]
serialize: add a few missing pubs to base64

10 years agostd: override clone_from for Vec.
Huon Wilson [Thu, 3 Apr 2014 11:28:45 +0000 (22:28 +1100)]
std: override clone_from for Vec.

A vector can reuse its allocation (and the allocations/resources of any
contained values) when cloning into an already-instantiated vector, so
we might as well do so.

10 years agorustllvm: Remove a no longer needed file
Alex Crichton [Thu, 3 Apr 2014 17:49:57 +0000 (10:49 -0700)]
rustllvm: Remove a no longer needed file

The .def.in files haven't been necessary since the switch to static linking
awhile back.

10 years agorustc: Stop using LLVMGetSectionName
Alex Crichton [Thu, 3 Apr 2014 17:45:36 +0000 (10:45 -0700)]
rustc: Stop using LLVMGetSectionName

The recent pull request to remove libc from libstd has hit a wall in compiling
on windows, and I've been trying to investigate on the try bots as to why (it
compiles locally just fine). To the best of my knowledge, the LLVM section
iterator is behaving badly when iterating over the sections of the libc DLL.

Upon investigating the LLVMGetSectionName function in LLVM, I discovered that
this function doesn't always return a null-terminated string. It returns the
data pointer of a StringRef instance (LLVM's equivalent of &str essentially),
but it has no method of returning the length of the name of the section.

This commit modifies the section iteration when loading libraries to invoke a
custom LLVMRustGetSectionName which will correctly return both the length and
the data pointer.

I have not yet verified that this will fix landing liblibc, as it will require a
snapshot before doing a full test. Regardless, this is a worrisome situation
regarding the LLVM API, and should likely be fixed anyway.

10 years agoauto merge of #13244 : cmr/rust/tbaa, r=alexcrichton
bors [Thu, 3 Apr 2014 10:42:02 +0000 (03:42 -0700)]
auto merge of #13244 : cmr/rust/tbaa, r=alexcrichton

10 years agoauto merge of #13262 : ben0x539/rust/guide-runtime-fixup, r=alexcrichton
bors [Thu, 3 Apr 2014 00:51:48 +0000 (17:51 -0700)]
auto merge of #13262 : ben0x539/rust/guide-runtime-fixup, r=alexcrichton

10 years agoTweak the installation instructions in the README
Alex Crichton [Wed, 2 Apr 2014 23:59:39 +0000 (16:59 -0700)]
Tweak the installation instructions in the README

Update the instructions to reflect that we have binary installers for all
supported platforms, and move the building from source directions into a
dedicated "Building from Source" directory.

10 years agoUpdate AUTHORS.txt for 0.10
Brian Anderson [Wed, 2 Apr 2014 23:57:02 +0000 (16:57 -0700)]
Update AUTHORS.txt for 0.10

10 years agoMinor adjustments to the 0.10 release notes.
Huon Wilson [Tue, 1 Apr 2014 11:55:09 +0000 (22:55 +1100)]
Minor adjustments to the 0.10 release notes.

Mention another lint, fix a typo, and rearrange some things.

10 years agoauto merge of #13257 : alexcrichton/rust/index-uint, r=pnkfelix
bors [Wed, 2 Apr 2014 23:36:50 +0000 (16:36 -0700)]
auto merge of #13257 : alexcrichton/rust/index-uint, r=pnkfelix

The details are outlined in the first commit.

Closes #10453

10 years agoFix fallout of requiring uint indices
Alex Crichton [Wed, 2 Apr 2014 03:39:26 +0000 (20:39 -0700)]
Fix fallout of requiring uint indices

10 years agorustc: Require that vector indices are uints
Alex Crichton [Wed, 2 Apr 2014 03:34:40 +0000 (20:34 -0700)]
rustc: Require that vector indices are uints

This commit tightens up the restriction on types used to index slices to require
exactly `uint` indices. Previously any integral type was accepted, but this
leads to a few subtle problems:

  * 64-bit indices don't make much sense on 32-bit systems
  * Signed indices for slices used as negative indexing isn't implemented

This was discussed at the recent work week, and also has some discussion on
issue #10453.

Closes #10453

10 years agoutil: ppaux: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:47:40 +0000 (10:47 -0400)]
util: ppaux: remove dead code

10 years agoutil: common: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:47:01 +0000 (10:47 -0400)]
util: common: remove dead code

10 years agomiddle: typeck: rscope: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:46:43 +0000 (10:46 -0400)]
middle: typeck: rscope: remove dead code

10 years agomiddle: typeck: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:46:28 +0000 (10:46 -0400)]
middle: typeck: remove dead code

10 years agomiddle: typeck: infer: resolve: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:45:17 +0000 (10:45 -0400)]
middle: typeck: infer: resolve: remove dead code

10 years agomiddle: typeck: infer: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:44:51 +0000 (10:44 -0400)]
middle: typeck: infer: remove dead code

10 years agomiddle: typeck: infer: lub: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:44:29 +0000 (10:44 -0400)]
middle: typeck: infer: lub: remove dead code

10 years agomiddle: typeck: infer: combine: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:44:00 +0000 (10:44 -0400)]
middle: typeck: infer: combine: remove dead code

10 years agomiddle: typeck: check: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:39:02 +0000 (10:39 -0400)]
middle: typeck: check: remove dead code

10 years agomiddle: ty: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:38:20 +0000 (10:38 -0400)]
middle: ty: remove dead code

10 years agomiddle: trans: type_: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:37:12 +0000 (10:37 -0400)]
middle: trans: type_: remove dead code

10 years agomiddle: trans: tvec: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:33:30 +0000 (10:33 -0400)]
middle: trans: tvec: remove dead code

10 years agomiddle: trans: reflect: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:31:41 +0000 (10:31 -0400)]
middle: trans: reflect: remove dead code

10 years agomiddle: trans: meth: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:31:30 +0000 (10:31 -0400)]
middle: trans: meth: remove dead code

10 years agomiddle: trans: datum: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:29:37 +0000 (10:29 -0400)]
middle: trans: datum: remove dead code

10 years agomiddle: trans: context: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:28:56 +0000 (10:28 -0400)]
middle: trans: context: remove dead code

10 years agomiddle: trans: common: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:28:42 +0000 (10:28 -0400)]
middle: trans: common: remove dead code

10 years agomiddle: trans: callee: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:28:31 +0000 (10:28 -0400)]
middle: trans: callee: remove dead code

10 years agomiddle: trans: cabi: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:28:20 +0000 (10:28 -0400)]
middle: trans: cabi: remove dead code

10 years agomiddle: trans: builder: ignore dead code
Corey Richardson [Tue, 1 Apr 2014 14:28:08 +0000 (10:28 -0400)]
middle: trans: builder: ignore dead code

10 years agomiddle: trans: build: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:27:56 +0000 (10:27 -0400)]
middle: trans: build: remove dead code

10 years agomiddle: trans: base: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:27:40 +0000 (10:27 -0400)]
middle: trans: base: remove dead code

10 years agomiddle: trans: adt: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:27:20 +0000 (10:27 -0400)]
middle: trans: adt: remove dead code

10 years agomiddle: region: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:27:05 +0000 (10:27 -0400)]
middle: region: remove dead code

10 years agomiddle: pat_util: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:26:53 +0000 (10:26 -0400)]
middle: pat_util: remove dead code

10 years agomiddle: mem_categorization: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:26:34 +0000 (10:26 -0400)]
middle: mem_categorization: remove dead code

10 years agomiddle: lang_items: allow dead code
Corey Richardson [Tue, 1 Apr 2014 14:26:21 +0000 (10:26 -0400)]
middle: lang_items: allow dead code

10 years agomiddle: kind: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:26:05 +0000 (10:26 -0400)]
middle: kind: remove dead code

10 years agomiddle: graph: ignore dead code
Corey Richardson [Tue, 1 Apr 2014 14:25:19 +0000 (10:25 -0400)]
middle: graph: ignore dead code

10 years agomiddle: freevars: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:24:45 +0000 (10:24 -0400)]
middle: freevars: remove dead code

10 years agomiddle: dataflow: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:24:11 +0000 (10:24 -0400)]
middle: dataflow: remove dead code

10 years agomiddle: const_eval: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:23:49 +0000 (10:23 -0400)]
middle: const_eval: remove dead code

10 years agomiddle: cfg: allow dead code
Corey Richardson [Tue, 1 Apr 2014 14:23:30 +0000 (10:23 -0400)]
middle: cfg: allow dead code

10 years agomiddle: borrowck: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:20:41 +0000 (10:20 -0400)]
middle: borrowck: remove dead code

10 years agomiddle: astencode: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:20:20 +0000 (10:20 -0400)]
middle: astencode: remove dead code

10 years agometadata: filesearch: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:19:42 +0000 (10:19 -0400)]
metadata: filesearch: remove dead code

10 years agometadata: decoder: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:19:25 +0000 (10:19 -0400)]
metadata: decoder: remove dead code

10 years agoauto merge of #13248 : tedhorst/rust/master, r=alexcrichton
bors [Wed, 2 Apr 2014 15:16:42 +0000 (08:16 -0700)]
auto merge of #13248 : tedhorst/rust/master, r=alexcrichton

10 years agodoc: Remove dated "libgreen is default" statement.
Benjamin Herr [Wed, 2 Apr 2014 14:56:31 +0000 (16:56 +0200)]
doc: Remove dated "libgreen is default" statement.

10 years agoauto merge of #13177 : huonw/rust/devec-rand, r=alexcrichton
bors [Wed, 2 Apr 2014 13:01:44 +0000 (06:01 -0700)]
auto merge of #13177 : huonw/rust/devec-rand, r=alexcrichton

Remove ~[] from librand, rename Rng.shuffle_mut to .shuffle.

See commits.

10 years agorand: replace Rng.shuffle's functionality with .shuffle_mut.
Huon Wilson [Thu, 27 Mar 2014 12:01:41 +0000 (23:01 +1100)]
rand: replace Rng.shuffle's functionality with .shuffle_mut.

Deprecates the `shuffle_mut` name in favour of `shuffle` too.

In future there will be many different types of owned
vectors/vector-likes (e.g. DST's ~[], Vec, SmallVec, Rope, ...), and so
privileging just `Vec` with the "functional" `shuffle` method is silly.

10 years agorand: remove (almost) all ~[]'s from Vec.
Huon Wilson [Thu, 27 Mar 2014 12:00:46 +0000 (23:00 +1100)]
rand: remove (almost) all ~[]'s from Vec.

There are a few instances of them in tests which are using functions
from std etc. that still are using ~[].

10 years agoauto merge of #13243 : huonw/rust/cellshow, r=thestinger
bors [Wed, 2 Apr 2014 09:21:39 +0000 (02:21 -0700)]
auto merge of #13243 : huonw/rust/cellshow, r=thestinger

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.

10 years agoauto merge of #13242 : huonw/rust/release-note-edits, r=alexcrichton
bors [Wed, 2 Apr 2014 07:06:40 +0000 (00:06 -0700)]
auto merge of #13242 : huonw/rust/release-note-edits, r=alexcrichton

Minor adjustments to the 0.10 release notes.

Mention another lint, fix a typo, and rearrange some things.

10 years agoauto merge of #13235 : klutzy/rust/doc-faq-win, r=alexcrichton
bors [Wed, 2 Apr 2014 05:41:42 +0000 (22:41 -0700)]
auto merge of #13235 : klutzy/rust/doc-faq-win, r=alexcrichton

10 years agoauto merge of #13241 : stepancheg/rust/push-all, r=alexcrichton
bors [Wed, 2 Apr 2014 04:21:48 +0000 (21:21 -0700)]
auto merge of #13241 : stepancheg/rust/push-all, r=alexcrichton

* push_all* operations should reserve capacity before pushing data to avoid unnecessary reallocations
* reserve_exact should never shrink, as specified in documentation

10 years agoauto merge of #13240 : sfackler/rust/time-pub, r=alexcrichton
bors [Tue, 1 Apr 2014 23:41:53 +0000 (16:41 -0700)]
auto merge of #13240 : sfackler/rust/time-pub, r=alexcrichton

10 years agoMinor adjustments to the 0.10 release notes.
Huon Wilson [Tue, 1 Apr 2014 11:55:09 +0000 (22:55 +1100)]
Minor adjustments to the 0.10 release notes.

Mention another lint, fix a typo, and rearrange some things.

10 years agoauto merge of #13234 : seanmonstar/rust/pr/12947, r=alexcrichton
bors [Tue, 1 Apr 2014 21:46:47 +0000 (14:46 -0700)]
auto merge of #13234 : seanmonstar/rust/pr/12947, r=alexcrichton

this is useful for macros like vec! which construct containers

rebase of #12947 because I'm impatient.

10 years agoauto merge of #13225 : thestinger/rust/num, r=cmr
bors [Tue, 1 Apr 2014 20:26:49 +0000 (13:26 -0700)]
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.

10 years agoReimplement Vec::push_all* with .extend
Stepan Koltsov [Tue, 1 Apr 2014 20:16:59 +0000 (20:16 +0000)]
Reimplement Vec::push_all* with .extend

It is shorter and also fixes missed reserve call.

10 years agoVec::reserve_exact should not shrink
Stepan Koltsov [Tue, 1 Apr 2014 20:16:59 +0000 (20:16 +0000)]
Vec::reserve_exact should not shrink

reserve_exact should not shrink according to documentation.

10 years agoauto merge of #13115 : huonw/rust/rand-errors, r=alexcrichton
bors [Tue, 1 Apr 2014 18:11:51 +0000 (11:11 -0700)]
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).

10 years agomake Cmplx fields public
Ted Horst [Tue, 1 Apr 2014 17:58:13 +0000 (12:58 -0500)]
make Cmplx fields public

10 years agometadata: cstore: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:19:10 +0000 (10:19 -0400)]
metadata: cstore: remove dead code

10 years agometadata: csearch: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:18:53 +0000 (10:18 -0400)]
metadata: csearch: remove dead code

10 years agometadata: common: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:17:32 +0000 (10:17 -0400)]
metadata: common: remove dead code

10 years agolib: llvm: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:17:18 +0000 (10:17 -0400)]
lib: llvm: remove dead code

10 years agoback: link: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:16:58 +0000 (10:16 -0400)]
back: link: remove dead code

10 years agoback: archive: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:16:46 +0000 (10:16 -0400)]
back: archive: remove dead code

10 years agoback: abi: remove dead code
Corey Richardson [Tue, 1 Apr 2014 14:12:02 +0000 (10:12 -0400)]
back: abi: remove dead code

10 years agostd: fix Cell's Show instance.
Huon Wilson [Tue, 1 Apr 2014 12:58:31 +0000 (23:58 +1100)]
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.

10 years agorustc: make comments on CrateContext doc comments
Corey Richardson [Tue, 1 Apr 2014 11:11:23 +0000 (07:11 -0400)]
rustc: make comments on CrateContext doc comments

10 years agoremove the cmath module
Daniel Micay [Tue, 1 Apr 2014 09:11:23 +0000 (05:11 -0400)]
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.

10 years agorand: bubble up IO messages futher.
Huon Wilson [Tue, 25 Mar 2014 05:13:11 +0000 (16:13 +1100)]
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.

10 years agorand: bubble up IO errors when creating an OSRng.
Huon Wilson [Mon, 24 Mar 2014 13:41:43 +0000 (00:41 +1100)]
rand: bubble up IO errors when creating an OSRng.

10 years agostd: migrate the errno -> IoError converter from libnative.
Huon Wilson [Mon, 24 Mar 2014 13:39:40 +0000 (00:39 +1100)]
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.

10 years agoMake libtime fields public
Steven Fackler [Tue, 1 Apr 2014 06:47:49 +0000 (23:47 -0700)]
Make libtime fields public

10 years agosyntax: allow stmt/expr macro invocations to be delimited by [].
Gábor Lehel [Sun, 16 Mar 2014 21:46:04 +0000 (22:46 +0100)]
syntax: allow stmt/expr macro invocations to be delimited by [].

this is useful for macros like vec! which construct containers

10 years agodoc: Update windows status on FAQ
klutzy [Tue, 1 Apr 2014 01:42:42 +0000 (10:42 +0900)]
doc: Update windows status on FAQ

10 years agoSwitch some tuple structs to pub fields
Alex Crichton [Tue, 1 Apr 2014 02:01:01 +0000 (19:01 -0700)]
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).

10 years agorustc: Switch tuple structs to have private fields
Alex Crichton [Tue, 1 Apr 2014 01:13:44 +0000 (18:13 -0700)]
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

10 years agoauto merge of #13184 : alexcrichton/rust/priv-fields, r=brson
bors [Mon, 31 Mar 2014 22:51:33 +0000 (15:51 -0700)]
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

10 years agodoc: Update with changes in field privacy
Alex Crichton [Fri, 28 Mar 2014 22:00:40 +0000 (15:00 -0700)]
doc: Update with changes in field privacy