]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #10165 : dcrewi/rust/missing-doc-on-private-trait, r=cmr
bors [Sat, 2 Nov 2013 19:11:18 +0000 (12:11 -0700)]
auto merge of #10165 : dcrewi/rust/missing-doc-on-private-trait, r=cmr

Fixes #10069.

10 years agoauto merge of #10217 : alexcrichton/rust/less-reachable, r=pcwalton
bors [Sat, 2 Nov 2013 18:01:16 +0000 (11:01 -0700)]
auto merge of #10217 : alexcrichton/rust/less-reachable, r=pcwalton

Previously, all functions called by a reachable function were considered
reachable, but this is only the case if the original function was possibly
inlineable (if it's type generic or #[inline]-flagged).

10 years agoauto merge of #10233 : sfackler/rust/private-module, r=alexcrichton
bors [Sat, 2 Nov 2013 10:11:10 +0000 (03:11 -0700)]
auto merge of #10233 : sfackler/rust/private-module, r=alexcrichton

A private module will survive the strip-private pass if it contains
trait implementations, which aren't stripped until a separate pass in
render.

10 years agoauto merge of #10230 : alexcrichton/rust/snapshots, r=brson
bors [Sat, 2 Nov 2013 09:01:25 +0000 (02:01 -0700)]
auto merge of #10230 : alexcrichton/rust/snapshots, r=brson

Closes #2240

10 years agoauto merge of #10229 : brson/rust/warnings, r=thestinger
bors [Sat, 2 Nov 2013 07:51:12 +0000 (00:51 -0700)]
auto merge of #10229 : brson/rust/warnings, r=thestinger

In Rust we don't like capital letters.

10 years agoauto merge of #10225 : Jurily/rust/master, r=alexcrichton
bors [Sat, 2 Nov 2013 06:36:10 +0000 (23:36 -0700)]
auto merge of #10225 : Jurily/rust/master, r=alexcrichton

10 years agoRustdoc: Properly strip private modules
Steven Fackler [Sat, 2 Nov 2013 06:32:58 +0000 (23:32 -0700)]
Rustdoc: Properly strip private modules

A private module will survive the strip-private pass if it contains
trait implementations, which aren't stripped until a separate pass in
render.

10 years agoauto merge of #10232 : brson/rust/destdir, r=thestinger
bors [Sat, 2 Nov 2013 04:56:13 +0000 (21:56 -0700)]
auto merge of #10232 : brson/rust/destdir, r=thestinger

10 years agoauto merge of #10222 : nibrahim/rust/docfix, r=brson
bors [Sat, 2 Nov 2013 03:46:18 +0000 (20:46 -0700)]
auto merge of #10222 : nibrahim/rust/docfix, r=brson

Earlier versions of pandoc don't have the `default.html5` template file. When `make docs` is run, the build process fails with this message.

    pandoc: doc/rust.html
    pandoc: /usr/share/pandoc-1.8.2.1/templates/default.html5: openFile: does not exist (No such file or directory)

    node.js:201
            throw e; // process.nextTick error, or 'error' event on first tick
                  ^
    Error: write EPIPE
        at errnoException (net.js:670:11)
        at Object.afterWrite [as oncomplete] (net.js:503:19)
    make: *** [doc/rust.html] Error 1

10 years agoFix installation with DESTDIR
Brian Anderson [Sat, 2 Nov 2013 03:23:22 +0000 (20:23 -0700)]
Fix installation with DESTDIR

10 years agoauto merge of #10223 : huonw/rust/gamma, r=cmr
bors [Sat, 2 Nov 2013 01:36:42 +0000 (18:36 -0700)]
auto merge of #10223 : huonw/rust/gamma, r=cmr

Implements the [Gamma distribution](https://en.wikipedia.org/wiki/Gamma_distribution), using the algorithm described by Marsaglia & Tsang 2000[1]. I added tests checking that the mean and variance of this implementation is as expected for a range of values of the parameters in https://github.com/huonw/random-tests/commit/5d87c00a0fb69c8fa173593714cef76ddfddb651 (they pass locally, but obviously won't even build on Travis until this is merged).

Also, moves `std::rand::distributions` to a subfolder, and performs a minor clean-up of the benchmarking (makes the number of iterations shared by the whole `std::rand` subtree).

[1]: George Marsaglia and Wai Wan Tsang. 2000. "A Simple Method for Generating Gamma Variables" *ACM Trans. Math. Softw.* 26, 3 (September 2000), 363-372. DOI:[10.1145/358407.358414](http://doi.acm.org/10.1145/358407.358414).

10 years agoRegister new snapshots
Alex Crichton [Fri, 1 Nov 2013 20:46:30 +0000 (13:46 -0700)]
Register new snapshots

Closes #2240

10 years agoauto merge of #10215 : brson/rust/rustctask, r=thestinger
bors [Fri, 1 Nov 2013 23:16:26 +0000 (16:16 -0700)]
auto merge of #10215 : brson/rust/rustctask, r=thestinger

10 years agoUse consistent capitalization in makefile errors
Brian Anderson [Fri, 1 Nov 2013 22:28:12 +0000 (15:28 -0700)]
Use consistent capitalization in makefile errors

In Rust we don't like capital letters.

10 years agoBump required pandoc version to 1.9.
Noufal Ibrahim [Fri, 1 Nov 2013 05:06:13 +0000 (10:36 +0530)]
Bump required pandoc version to 1.9.

Earlier versions of pandoc don't have the default.html5 and thus,
building the docs fail.

Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
10 years agoauto merge of #10220 : luqmana/rust/con, r=brson
bors [Fri, 1 Nov 2013 19:46:21 +0000 (12:46 -0700)]
auto merge of #10220 : luqmana/rust/con, r=brson

Previously we were actually overwriting `CFG_{HOST,TARGET,BUILD}` with `CFG_{HOST,TARGET,BUILD}_TRIPLE(S)` since configure tested for the legacy one by checking if it was empty which would never be the case. That meant it wouldn't split up multiple triples and just treat it as one long triple.

This pull also fixes the rules that were changed when librustuv was added to use the right CFG_ vars and removes the legacy flags.

10 years agoauto merge of #10204 : alexcrichton/rust/better-names, r=brson
bors [Fri, 1 Nov 2013 18:31:32 +0000 (11:31 -0700)]
auto merge of #10204 : alexcrichton/rust/better-names, r=brson

Tests now have the same name as the test that they're running (to allow for
easier diagnosing of failure sources), and the main task is now specially named
`<main>` instead of `<unnamed>`.

Closes #10195
Closes #10073

10 years agoconfigure: Remove legacy triple flags.
Luqman Aden [Fri, 1 Nov 2013 18:21:48 +0000 (14:21 -0400)]
configure: Remove legacy triple flags.

10 years agoauto merge of #10119 : Kimundi/rust/option_and_generic, r=alexcrichton
bors [Fri, 1 Nov 2013 16:36:25 +0000 (09:36 -0700)]
auto merge of #10119 : Kimundi/rust/option_and_generic, r=alexcrichton

This takes the last reforms on the `Option` type and applies them to `Result` too. For that, I reordered and grouped the functions in both modules, and also did some refactorings:

- Added `as_ref` and `as_mut` adapters to `Result`.
- Renamed `Result::map_move` to `Result::map` (same for `_err` variant), deleted other map functions.
- Made the `.expect()` methods be generic over anything you can
  fail with.
- Updated some doc comments to the line doc comment style
- Cleaned up and extended standard trait implementations on `Option` and `Result`
- Removed legacy implementations in the `option` and `result` module

10 years agoGive test and main tasks better names
Alex Crichton [Fri, 1 Nov 2013 16:16:11 +0000 (09:16 -0700)]
Give test and main tasks better names

Tests now have the same name as the test that they're running (to allow for
easier diagnosing of failure sources), and the main task is now specially named
<main> instead of <unnamed>.

Closes #10195
Closes #10073

10 years agoFix typo in to_digit
Gyorgy Andrasek [Fri, 1 Nov 2013 16:13:43 +0000 (17:13 +0100)]
Fix typo in to_digit

10 years agoauto merge of #10218 : alexcrichton/rust/stdio-flush-safe, r=cmr
bors [Fri, 1 Nov 2013 15:26:24 +0000 (08:26 -0700)]
auto merge of #10218 : alexcrichton/rust/stdio-flush-safe, r=cmr

The previous method was unsound because you could very easily create two mutable
pointers which alias the same location (not sound behavior). This hides the
function which does so and then exports an explicit flush() function (with
documentation about how it works).

10 years agoFixed unused import warning in tests
Marvin Löbel [Fri, 1 Nov 2013 14:37:29 +0000 (15:37 +0100)]
Fixed unused import warning in tests

10 years agoRemoved legacy implementations
Marvin Löbel [Fri, 1 Nov 2013 13:36:43 +0000 (14:36 +0100)]
Removed legacy implementations

10 years agoCleaned up the option and result module in more detail
Marvin Löbel [Fri, 1 Nov 2013 11:25:36 +0000 (12:25 +0100)]
Cleaned up the option and result module in more detail

Made both types implement more standard traits in a nicer way

Derived more traits

10 years agoReordered the methods in std::Option and std::Result
Marvin Löbel [Thu, 31 Oct 2013 22:09:24 +0000 (23:09 +0100)]
Reordered the methods in std::Option and std::Result

Cleaned up the source in a few places

Renamed `map_move` to `map`, removed other `map` methods

Added `as_ref` and `as_mut` adapters to `Result`

Added `fmt::Default` impl

10 years agoauto merge of #10213 : telotortium/rust/rand-fill_bytes-stack-overflow, r=huonw
bors [Fri, 1 Nov 2013 12:21:24 +0000 (05:21 -0700)]
auto merge of #10213 : telotortium/rust/rand-fill_bytes-stack-overflow, r=huonw

Fix the implementation of `std::rand::Rng::fill_bytes()` for
`std::rand::reseeding::ReseedingRng` to call the `fill_bytes()` method
of the underlying RNG rather than itself, which causes infinite
recursion.

Fixes #10202.

10 years agostd::rand: share the benchmark counter among the whole module tree.
Huon Wilson [Fri, 1 Nov 2013 10:33:13 +0000 (21:33 +1100)]
std::rand: share the benchmark counter among the whole module tree.

10 years agostd::rand: Implement the Gamma distribution.
Huon Wilson [Fri, 1 Nov 2013 02:34:08 +0000 (13:34 +1100)]
std::rand: Implement the Gamma distribution.

10 years agoauto merge of #10205 : brson/rust/unnamed_addr, r=thestinger
bors [Fri, 1 Nov 2013 11:06:23 +0000 (04:06 -0700)]
auto merge of #10205 : brson/rust/unnamed_addr, r=thestinger

10 years agostd::rand: Move distributions to a subfolder.
Huon Wilson [Fri, 1 Nov 2013 00:25:20 +0000 (11:25 +1100)]
std::rand: Move distributions to a subfolder.

10 years agoauto merge of #10203 : kud1ing/rust/ios, r=alexcrichton
bors [Fri, 1 Nov 2013 09:26:23 +0000 (02:26 -0700)]
auto merge of #10203 : kud1ing/rust/ios, r=alexcrichton

This is based on the work by @dobkeratops, updated and extended to work for Xcode 5.

This gets you going. I will add separate PRs for compilation/linking fixes.
See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios

10 years agoauto merge of #10196 : huonw/rust/fix-zig, r=alexcrichton
bors [Fri, 1 Nov 2013 08:16:22 +0000 (01:16 -0700)]
auto merge of #10196 : huonw/rust/fix-zig, r=alexcrichton

The code was using (in the notation of Doornik 2005) `f(x_{i+1}) -
f(x_{i+2})` rather than `f(x_i) - f(x_{i+1})`. This corrects that, and
removes the F_DIFF tables which caused this problem in the first place.

They `F_DIFF` tables are a micro-optimisation (in theory, they could
easily be a micro-pessimisation): that `if` gets hit about 1% of the
time for Exp/Normal, and the rest of the condition involves RNG calls
and a floating point `exp`, so it is unlikely that saving a single FP
subtraction will be very useful (especially as more tables means more
memory reads and higher cache pressure, as well as taking up space in
the binary (although only ~2k in this case)).

Closes #10084. Notably, unlike that issue suggests, this wasn't a
problem with the Exp tables. It affected Normal too, but since it is
symmetric, there was no bias in the mean (as the bias was equal on the
positive and negative sides and so cancelled out) but it was visible as
a variance slightly lower than it should be.

New plot:

![exp-density](https://f.cloud.github.com/assets/1203825/1445796/42218dfe-422a-11e3-9f98-2cd146b82b46.png)

I've started writing some tests in [huonw/random-tests](https://github.com/huonw/random-tests) (not in the main repo because they can and do fail occasionally, due to randomness, but it is on Travis and Rust-CI so it will hopefully track the language), unsurprisingly, they're [currently failing](https://travis-ci.org/huonw/random-tests/builds/13313987) (note that both exp and norm are failing, the former due to both mean and variance the latter due to just variance), but pass at the 0.01 level reliably with this change.

(Currently the only test is essentially a quantitative version of the plots I've been showing, which is run on the `f64` `Rand` instance (uniform 0 to 1), and the Normal and Exp distributions.)

10 years agoconfigure: Fix passing multiple target and host triples.
Luqman Aden [Fri, 1 Nov 2013 07:09:04 +0000 (03:09 -0400)]
configure: Fix passing multiple target and host triples.

10 years agoauto merge of #10187 : pcwalton/rust/remove-mocks, r=pcwalton
bors [Fri, 1 Nov 2013 05:26:24 +0000 (22:26 -0700)]
auto merge of #10187 : pcwalton/rust/remove-mocks, r=pcwalton

r? @alexcrichton

10 years agoProvide a sound method of flushing stdout
Alex Crichton [Fri, 1 Nov 2013 05:09:48 +0000 (22:09 -0700)]
Provide a sound method of flushing stdout

The previous method was unsound because you could very easily create two mutable
pointers which alias the same location (not sound behavior). This hides the
function which does so and then exports an explicit flush() function (with
documentation about how it works).

10 years agoReduce the aggressiveness of reachability
Alex Crichton [Fri, 1 Nov 2013 03:47:23 +0000 (20:47 -0700)]
Reduce the aggressiveness of reachability

Previously, all functions called by a reachable function were considered
reachable, but this is only the case if the original function was possibly
inlineable (if it's type generic or #[inline]-flagged).

10 years agoauto merge of #10181 : brson/rust/managed_boxes, r=thestinger
bors [Fri, 1 Nov 2013 03:36:17 +0000 (20:36 -0700)]
auto merge of #10181 : brson/rust/managed_boxes, r=thestinger

10 years agoName the rustc task 'rustc'
Brian Anderson [Fri, 1 Nov 2013 03:08:17 +0000 (20:08 -0700)]
Name the rustc task 'rustc'

10 years agoFix infinite recursion in `fill_bytes()`
Robert Irelan [Fri, 1 Nov 2013 00:26:33 +0000 (19:26 -0500)]
Fix infinite recursion in `fill_bytes()`

Fix the implementation of `std::rand::Rng::fill_bytes()` for
`std::rand::reseeding::ReseedingRng` to call the `fill_bytes()` method
of the underlying RNG rather than itself, which causes infinite
recursion.

Fixes #10202.

10 years agoauto merge of #9740 : alexcrichton/rust/concat, r=cmr
bors [Fri, 1 Nov 2013 00:51:26 +0000 (17:51 -0700)]
auto merge of #9740 : alexcrichton/rust/concat, r=cmr

This extension can be used to concatenate string literals at compile time. C has
this useful ability when placing string literals lexically next to one another,
but this needs to be handled at the syntax extension level to recursively expand
macros.

The major use case for this is something like:

    macro_rules! mylog( ($fmt:expr $($arg:tt)*) => {
        error2!(concat!(file!(), ":", line!(), " - ", $fmt) $($arg)*);
    })

Where the mylog macro will automatically prepend the filename/line number to the
beginning of every log message.

10 years agoauto merge of #10206 : brson/rust/configure, r=brson
bors [Thu, 31 Oct 2013 22:36:36 +0000 (15:36 -0700)]
auto merge of #10206 : brson/rust/configure, r=brson

10 years agoFix fallback configuration flags
Brian Anderson [Thu, 31 Oct 2013 22:27:54 +0000 (15:27 -0700)]
Fix fallback configuration flags

10 years agoDeclare all Rust functions as unnamed_addr. Closes #8957
Brian Anderson [Thu, 31 Oct 2013 21:12:17 +0000 (14:12 -0700)]
Declare all Rust functions as unnamed_addr. Closes #8957

10 years agoadd target triple arm-apple-darwin
kud1ing [Thu, 31 Oct 2013 19:36:27 +0000 (20:36 +0100)]
add target triple arm-apple-darwin

10 years agofix missing_doc lint on private traits
David Creswick [Wed, 30 Oct 2013 18:52:24 +0000 (13:52 -0500)]
fix missing_doc lint on private traits

Fixes #10069.

10 years agoImplement a concat!() format extension
Alex Crichton [Sun, 6 Oct 2013 04:15:46 +0000 (21:15 -0700)]
Implement a concat!() format extension

This extension can be used to concatenate string literals at compile time. C has
this useful ability when placing string literals lexically next to one another,
but this needs to be handled at the syntax extension level to recursively expand
macros.

The major use case for this is something like:

    macro_rules! mylog( ($fmt:expr $($arg:tt)*) => {
        error2!(concat!(file!(), ":", line!(), " - ", $fmt) $($arg)*);
    })

Where the mylog macro will automatically prepend the filename/line number to the
beginning of every log message.

10 years agoMake managed_boxes feature gate error less opinionated
Brian Anderson [Wed, 30 Oct 2013 23:27:31 +0000 (16:27 -0700)]
Make managed_boxes feature gate error less opinionated

10 years agoauto merge of #10167 : briantdawn/rust/master, r=cmr
bors [Thu, 31 Oct 2013 17:31:56 +0000 (10:31 -0700)]
auto merge of #10167 : briantdawn/rust/master, r=cmr

To keep consistency with the word "borrowing" I suppose an alternate way to write this could be "Having an object borrow an immutable pointer freezes it and prevents mutation".

10 years agolibstd: Remove mocks.
Patrick Walton [Thu, 31 Oct 2013 01:28:37 +0000 (18:28 -0700)]
libstd: Remove mocks.

10 years agolibrustc: Implement `|A| -> B` syntax for closures and make bare `fn`
Patrick Walton [Tue, 29 Oct 2013 22:06:13 +0000 (15:06 -0700)]
librustc: Implement `|A| -> B` syntax for closures and make bare `fn`
work

10 years agoauto merge of #10193 : osaut/rust/Fix_install, r=huonw
bors [Thu, 31 Oct 2013 14:46:50 +0000 (07:46 -0700)]
auto merge of #10193 : osaut/rust/Fix_install, r=huonw

Fix missing parentheses coming from a previous substitution '$(PREFIX_ROOT)' to  '$(CFG_MANDIR' on 1c4a348b072a

10 years agostd::rand: correct an off-by-one in the Ziggurat code.
Huon Wilson [Thu, 31 Oct 2013 12:27:26 +0000 (23:27 +1100)]
std::rand: correct an off-by-one in the Ziggurat code.

The code was using (in the notation of Doornik 2005) `f(x_{i+1}) -
f(x_{i+2})` rather than `f(x_i) - f(x_{i+1})`. This corrects that, and
removes the F_DIFF tables which caused this problem in the first place.

They `F_DIFF` tables are a micro-optimisation (in theory, they could
easily be a micro-pessimisation): that `if` gets hit about 1% of the
time for Exp/Normal, and the rest of the condition involves RNG calls
and a floating point `exp`, so it is unlikely that saving a single FP
subtraction will be very useful (especially as more tables means more
memory reads and higher cache pressure, as well as taking up space in
the binary (although only ~2k in this case)).

Closes #10084. Notably, unlike that issue suggests, this wasn't a
problem with the Exp tables. It affected Normal too, but since it is
symmetric, there was no bias in the mean (as the bias was equal on the
positive and negative sides and so cancelled out) but it was visible as
a variance slightly lower than it should be.

10 years agoauto merge of #10189 : alexcrichton/rust/inner-statics, r=cmr
bors [Thu, 31 Oct 2013 11:46:34 +0000 (04:46 -0700)]
auto merge of #10189 : alexcrichton/rust/inner-statics, r=cmr

Closes #9186

10 years agoFix missing parenthesis in a previous substitution '$(PREFIX_ROOT)' to '$(CFG_MANDIR...
Olivier Saut [Thu, 31 Oct 2013 10:04:39 +0000 (11:04 +0100)]
Fix missing parenthesis in a previous substitution '$(PREFIX_ROOT)' to  '$(CFG_MANDIR' on 1c4a348b072a

10 years agoauto merge of #10180 : alexcrichton/rust/flush-default, r=brson
bors [Thu, 31 Oct 2013 09:16:40 +0000 (02:16 -0700)]
auto merge of #10180 : alexcrichton/rust/flush-default, r=brson

Closes #9126

10 years agoauto merge of #10166 : brson/rust/meta, r=alexcrichton
bors [Thu, 31 Oct 2013 06:41:22 +0000 (23:41 -0700)]
auto merge of #10166 : brson/rust/meta, r=alexcrichton

This doesn't fix #623 but works around it by limiting the grammar.

10 years agoauto merge of #10164 : brson/rust/configure, r=brson
bors [Thu, 31 Oct 2013 04:06:33 +0000 (21:06 -0700)]
auto merge of #10164 : brson/rust/configure, r=brson

Rebase of #9990

10 years agoForbid type parameters in inner statics
Alex Crichton [Wed, 30 Oct 2013 23:44:55 +0000 (16:44 -0700)]
Forbid type parameters in inner statics

Closes #9186

10 years agoauto merge of #10120 : Kimundi/rust/remove_sys, r=alexcrichton
bors [Thu, 31 Oct 2013 01:31:26 +0000 (18:31 -0700)]
auto merge of #10120 : Kimundi/rust/remove_sys, r=alexcrichton

- `begin_unwind` and `fail!` is now generic over any `T: Any + Send`.
- Every value you fail with gets boxed as an `~Any`.
- Because of implementation issues, `&'static str` and `~str` are still
  handled specially behind the scenes.
- Changed the big macro source string in libsyntax to a raw string
  literal, and enabled doc comments there.

10 years agoMake Writer::flush a no-op default method
Alex Crichton [Wed, 30 Oct 2013 22:10:32 +0000 (15:10 -0700)]
Make Writer::flush a no-op default method

Closes #9126

10 years agosyntax: Forbid non-string literals in meta items. #623
Brian Anderson [Wed, 30 Oct 2013 00:47:11 +0000 (17:47 -0700)]
syntax: Forbid non-string literals in meta items. #623

10 years agoauto merge of #10172 : pythonesque/rust/issue-9890, r=thestinger
bors [Wed, 30 Oct 2013 20:26:29 +0000 (13:26 -0700)]
auto merge of #10172 : pythonesque/rust/issue-9890, r=thestinger

10 years agoPrepared `std::sys` for removal, and made `begin_unwind` simpler
Marvin Löbel [Sun, 27 Oct 2013 19:12:40 +0000 (20:12 +0100)]
Prepared `std::sys` for removal, and made `begin_unwind` simpler

- `begin_unwind` is now generic over any `T: Any + Send`.
- Every value you fail with gets boxed as an `~Any`.
- Because of implementation details, `&'static str` and `~str` are still
  handled specially behind the scenes.
- Changed the big macro source string in libsyntax to a raw string
  literal, and enabled doc comments there.

10 years agoSpecial-casing iter_vec_raw to use a counter for zero-size types (Closes #9890).
Joshua Yanovski [Wed, 30 Oct 2013 06:34:43 +0000 (23:34 -0700)]
Special-casing iter_vec_raw to use a counter for zero-size types (Closes #9890).

10 years agoauto merge of #10123 : klutzy/rust/fix-7507, r=alexcrichton
bors [Wed, 30 Oct 2013 11:36:26 +0000 (04:36 -0700)]
auto merge of #10123 : klutzy/rust/fix-7507, r=alexcrichton

This patch fixes rustc to emit explicit error if LHS of assignment is
not allowed.

Fixes #7507
Fixes #7508

10 years agoauto merge of #10168 : reedlepee123/rust/priv_fields, r=brson
bors [Wed, 30 Oct 2013 10:31:20 +0000 (03:31 -0700)]
auto merge of #10168 : reedlepee123/rust/priv_fields, r=brson

....rs #8180

10 years agotest: Add test for LHS expression check
klutzy [Mon, 28 Oct 2013 16:27:12 +0000 (01:27 +0900)]
test: Add test for LHS expression check

10 years agorustc: Check LHS expression of assignment
klutzy [Mon, 28 Oct 2013 16:05:33 +0000 (01:05 +0900)]
rustc: Check LHS expression of assignment

Fixes #7507
Fixes #7508

10 years agoauto merge of #9613 : jld/rust/enum-discrim-size.r0, r=alexcrichton
bors [Wed, 30 Oct 2013 07:31:23 +0000 (00:31 -0700)]
auto merge of #9613 : jld/rust/enum-discrim-size.r0, r=alexcrichton

Allows an enum with a discriminant to use any of the primitive integer types to store it.  By default the smallest usable type is chosen, but this can be overridden with an attribute: `#[repr(int)]` etc., or `#[repr(C)]` to match the target's C ABI for the equivalent C enum.

Also adds a lint pass for using non-FFI safe enums in extern declarations, checks that specified discriminants can be stored in the specified type if any, and fixes assorted code that was assuming int.

10 years agoFix check-fast breakage in new enum test.
Jed Davis [Wed, 30 Oct 2013 07:13:17 +0000 (00:13 -0700)]
Fix check-fast breakage in new enum test.

10 years agoauto merge of #10163 : brson/rust/rtcxx, r=alexcrichton
bors [Wed, 30 Oct 2013 04:26:20 +0000 (21:26 -0700)]
auto merge of #10163 : brson/rust/rtcxx, r=alexcrichton

10 years agoauto merge of #10161 : brson/rust/upcall, r=alexcrichton
bors [Wed, 30 Oct 2013 03:16:28 +0000 (20:16 -0700)]
auto merge of #10161 : brson/rust/upcall, r=alexcrichton

10 years agoauto merge of #10149 : chris-morgan/rust/2013-10-29-vim-updates, r=erickt
bors [Wed, 30 Oct 2013 02:07:55 +0000 (19:07 -0700)]
auto merge of #10149 : chris-morgan/rust/2013-10-29-vim-updates, r=erickt

- Syntax updates for the regular prelude changes.
- Fix an issue with the indentation of the second line of wrapped function arguments.

10 years agochanged all the impl<T> to impl<T: Send> in rt::comm.rs and libstd::comm.rs #8180
reedlepee [Wed, 30 Oct 2013 01:10:40 +0000 (06:40 +0530)]
changed all the impl<T> to impl<T: Send> in rt::comm.rs and libstd::comm.rs #8180

10 years agoauto merge of #10160 : alexcrichton/rust/snapshots, r=pcwalton
bors [Wed, 30 Oct 2013 01:01:50 +0000 (18:01 -0700)]
auto merge of #10160 : alexcrichton/rust/snapshots, r=pcwalton

Notably this deletes `std::rt::uv`

10 years agoFixed incorrect usage of 'Borrowing'.
Brian [Wed, 30 Oct 2013 00:47:42 +0000 (00:47 +0000)]
Fixed incorrect usage of 'Borrowing'.

10 years agort: Remove array_list.h
Brian Anderson [Wed, 30 Oct 2013 00:04:20 +0000 (17:04 -0700)]
rt: Remove array_list.h

10 years agort: Remove rust_thread::detach
Brian Anderson [Wed, 30 Oct 2013 00:02:37 +0000 (17:02 -0700)]
rt: Remove rust_thread::detach

10 years agort: Remove four unused upcalls
Brian Anderson [Tue, 29 Oct 2013 23:49:38 +0000 (16:49 -0700)]
rt: Remove four unused upcalls

10 years agoauto merge of #10145 : TeXitoi/rust/issues-2913, r=bstrie
bors [Tue, 29 Oct 2013 23:26:25 +0000 (16:26 -0700)]
auto merge of #10145 : TeXitoi/rust/issues-2913, r=bstrie

The old version didn't follow shootout's directives: no memory were
deallocated.  At the same time, parallelisation of the computation.

fix #2913

10 years agosupport for GNU configure syntax corrections: patch from brson
Heather [Fri, 25 Oct 2013 04:57:56 +0000 (08:57 +0400)]
support for GNU configure syntax corrections: patch from brson

10 years agoCorrect prefix / CFG_PREFIX work in configure / install.mk
Heather [Tue, 22 Oct 2013 04:35:45 +0000 (08:35 +0400)]
Correct prefix / CFG_PREFIX work in configure / install.mk

10 years agosupport for GNU configure syntax
Heather [Mon, 21 Oct 2013 09:18:21 +0000 (13:18 +0400)]
support for GNU configure syntax

10 years agoRegister new snapshots
Alex Crichton [Tue, 29 Oct 2013 21:14:34 +0000 (14:14 -0700)]
Register new snapshots

10 years agoauto merge of #10134 : reedlepee123/rust/priv_fields, r=brson
bors [Tue, 29 Oct 2013 22:11:30 +0000 (15:11 -0700)]
auto merge of #10134 : reedlepee123/rust/priv_fields, r=brson

10 years agoauto merge of #10140 : brson/rust/comm, r=alexcrichton
bors [Tue, 29 Oct 2013 20:37:08 +0000 (13:37 -0700)]
auto merge of #10140 : brson/rust/comm, r=alexcrichton

Just putting this public trait into the correct module.

10 years agoauto merge of #10136 : hatahet/rust/master, r=alexcrichton
bors [Tue, 29 Oct 2013 19:02:59 +0000 (12:02 -0700)]
auto merge of #10136 : hatahet/rust/master, r=alexcrichton

Fixes #10077

10 years agoauto merge of #10132 : pcwalton/rust/proc, r=pcwalton
bors [Tue, 29 Oct 2013 17:52:25 +0000 (10:52 -0700)]
auto merge of #10132 : pcwalton/rust/proc, r=pcwalton

the feature gate for `once fn` if used with the `~` sigil.

r? @brson

10 years agolibrustc: Implement the `proc` type as sugar for `~once fn` and `proc`
Patrick Walton [Mon, 28 Oct 2013 22:22:49 +0000 (15:22 -0700)]
librustc: Implement the `proc` type as sugar for `~once fn` and `proc`
notation for closures, and disable the feature gate for `once fn` if
used with the `~` sigil.

10 years agoauto merge of #10058 : alexcrichton/rust/uv-crate, r=brson
bors [Tue, 29 Oct 2013 16:36:47 +0000 (09:36 -0700)]
auto merge of #10058 : alexcrichton/rust/uv-crate, r=brson

This is one of the final steps needed to complete #9128. It still needs a little bit of polish before closing that issue, but it's in a pretty much "done" state now.

The idea here is that the entire event loop implementation using libuv is now housed in `librustuv` as a completely separate library. This library is then injected (via `extern mod rustv`) into executable builds (similarly to how libstd is injected, tunable via `#[no_uv]`) to bring in the "rust blessed event loop implementation."

Codegen-wise, there is a new `event_loop_factory` language item which is tagged on a function with 0 arguments returning `~EventLoop`. This function's symbol is then inserted into the crate map for an executable crate, and if there is no definition of the `event_loop_factory` language item then the value is null.

What this means is that embedding rust as a library in another language just got a little harder. Libraries don't have crate maps, which means that there's no way to find the event loop implementation to spin up the runtime. That being said, it's always possible to build the runtime manually. This request also makes more runtime components public which should probably be public anyway. This new public-ness should allow custom scheduler setups everywhere regardless of whether you follow the `rt::start `path.

10 years agoPrevent unoptimized rustpkg tests from running out of stack.
Jed Davis [Tue, 29 Oct 2013 16:07:30 +0000 (09:07 -0700)]
Prevent unoptimized rustpkg tests from running out of stack.

The actual fix would be to make rustpkg use `rustc::monitor` so it picks
up anything special that rustc needs, but for now let's keep the tests
from breaking.

10 years agoFix type_of for enums to not lose data in some cases when immediate.
Jed Davis [Sat, 26 Oct 2013 19:12:53 +0000 (12:12 -0700)]
Fix type_of for enums to not lose data in some cases when immediate.

The previous implementation, when combined with small discriminants and
immediate types, caused problems for types like `Either<u8, i16>` which
are now small enough to be immediate and can have fields intersecting
the highest-alignment variant's alignment padding (which LLVM doesn't
preserve).  So let's not do that.

10 years agoAdd another discriminant-size-related test, this time with fields.
Jed Davis [Sat, 26 Oct 2013 04:22:00 +0000 (21:22 -0700)]
Add another discriminant-size-related test, this time with fields.

10 years agoWork around const_eval issues by changing signed integer `min_value`s.
Jed Davis [Sun, 20 Oct 2013 18:13:41 +0000 (11:13 -0700)]
Work around const_eval issues by changing signed integer `min_value`s.

Otherwise, run-pass/deriving-primitive.rs breaks on 32-bit platforms,
because `int::min_value` is `0xffffffff7fffffff` when evaluated for the
discriminant declaration.

10 years agoAdd tests for enum discriminant sizing.
Jed Davis [Sun, 29 Sep 2013 21:00:34 +0000 (14:00 -0700)]
Add tests for enum discriminant sizing.

10 years agoC-like enums are not always immediate
Jed Davis [Thu, 3 Oct 2013 20:59:34 +0000 (13:59 -0700)]
C-like enums are not always immediate

10 years agoAdjust reflection for the possibility of discriminants larger than int.
Jed Davis [Sun, 29 Sep 2013 09:20:11 +0000 (02:20 -0700)]
Adjust reflection for the possibility of discriminants larger than int.

Not only can discriminants be smaller than int now, but they can be
larger than int on 32-bit targets.  This has obvious implications for the
reflection interface.  Without this change, things fail with LLVM
assertions when we try to "extend" i64 to i32.

10 years agoYet more neatening
Jed Davis [Thu, 3 Oct 2013 20:58:01 +0000 (13:58 -0700)]
Yet more neatening

10 years agoAssorted cleanups suggested by reviewers.
Jed Davis [Wed, 25 Sep 2013 16:41:10 +0000 (09:41 -0700)]
Assorted cleanups suggested by reviewers.