Commit Graph

23861 Commits

Author SHA1 Message Date
Eric Holk
02e565a187 Don't use win64 calling convention on 32-bit machines. 2013-11-19 12:46:28 -05:00
Eric Holk
5b534e4a22 Use the correct calling convention for extern rust functions. 2013-11-18 19:20:09 -05:00
Eric Holk
50fb4be1cc Add Win64 calling convention. 2013-11-18 19:20:09 -05:00
bors
3d569df41d auto merge of #10555 : TeXitoi/rust/pidigits-resurected, r=alexcrichton
Changes:
* default value when no args
* license
* removed libc printing
* use extra::bigint instead of handmade gmp binding

The drawback is that it's 2 order of magnitude slower, the good news is that there is a good bench for extra::bigint.
2013-11-18 13:46:55 -08:00
Guillaume Pinot
ec27c09bdf pidigits resurected
Changes:
* default value when no args
* license
* removed libc printing
* use extra::bigint instead of handmade gmp binding
2013-11-18 22:23:38 +01:00
bors
6c8b702cf7 auto merge of #10539 : alexcrichton/rust/external-linkage, r=pcwalton
If a function is marked as external, then it's likely desired for use with some
native library, so we're not really accomplishing a whole lot by internalizing
all of these symbols.
2013-11-18 10:26:49 -08:00
Alex Crichton
4ddeef35e5 Don't mark reachable extern fns as internal
If a function is marked as external, then it's likely desired for use with some
native library, so we're not really accomplishing a whole lot by internalizing
all of these symbols.
2013-11-18 10:21:58 -08:00
bors
4dded4345f auto merge of #10508 : chris-morgan/rust/tags-improvements, r=cmr
Largely, this is just being more specific about where tags get searched
for to remove external dependencies like src/llvm, which reduces the
number of tags *enormously* and significantly increases the usefulness
of the tags file as it is then focusing on 240K lines of Rust code
and 4.5K of C++ rather than just shy of 1M lines of C++ code (mostly
from LLVM) and another 100K lines of Rust tests and a diverse collection
of other languages.

src/rustllvm/RustWrapper.cpp and src/rustllvm/PassWrapper.cpp are
getting tags made, but I'm not sure if that's desirable or not. At
worst, it's not a significant wrong.

A future, desirable step is producing tags for just libstd and libextra
for the use of people using Rust-the-language rather than working on
Rust itself.
2013-11-17 23:41:25 -08:00
bors
8eda5d8315 auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr
Closes #10111
2013-11-17 22:21:23 -08:00
Alex Crichton
dab8fec4af Forbid privacy in inner functions
Closes #10111
2013-11-17 21:28:18 -08:00
bors
727b70d6ae auto merge of #10526 : itdaniher/rust/master, r=pcwalton
This commit fixes issue #10468.

It propagate optimization level from PkgSrc to compile_crate as a rustc::driver::session::OptLevel enum.

The 'opt' argument to compile_crate was previously hardcoded as boolean false, such that calls to session::options would always result in the session::No flag being used.
2013-11-17 21:11:24 -08:00
bors
15a8e6248c auto merge of #10363 : astrieanna/rust/fix-x86stdcall, r=huonw
* moved `extern` inside module
* changed `extern "stdcall"` to `extern "system"`
* changed `cfg(target_os="win32")` to `cfg(windows)`
* only run on Windows && x86, (not x86_64)
* updated copyright dates
2013-11-17 20:01:34 -08:00
Leah Hanson
69768f7c94 Fix XFailed test x86stdcall
There was a syntax error because the `extern "stdcall"` was outside the module instead of inside it.

* moved `extern` inside module
* change `extern "stdcall"` to `extern "system"`
* change `cfg(target_os="win32")` to `cfg(windows)`
* updated copyright dates
* changed log(error, ...) => info!(....)
* added `pub` keyword to kernel32 functions
2013-11-17 20:55:59 -06:00
bors
5e3123bfa7 auto merge of #10533 : tautologico/rust/fixdocs, r=huonw
This fixes a number of bugs in the doc comments for a bunch of functions in libstd/iter.rs, mostly updating to use unwrap() instead of get() on options. Also fixes the docs for advance() (trait Iterator) which was not making sense, though if it is not useful anymore maybe it should be removed.
2013-11-17 18:51:30 -08:00
Andrei Formiga
1f27512b17 Fixed docs for advance() in Iterator trait 2013-11-17 23:45:29 -03:00
Andrei Formiga
2839805b9c Fixed uses of get() to unwrap() in doc examples in std::iter 2013-11-17 23:30:57 -03:00
bors
b4197aeed6 auto merge of #10511 : cmr/rust/addtests, r=huonw
Commit messages have all
2013-11-17 16:21:32 -08:00
Corey Richardson
ed34cd1e3c Better error message when using vectors in statics
Closes #10487
2013-11-17 18:35:52 -05:00
Corey Richardson
5d466ff96e Add a test for #6976
Closes #6976
2013-11-17 18:35:47 -05:00
bors
2c9e56f0ed auto merge of #10532 : dhodder/rust/master, r=alexcrichton
Hello.  This is just a tiny doc update -- I'm new here, so apologies if I'm doing it wrong.
2013-11-17 15:11:41 -08:00
bors
60ec647b77 auto merge of #10531 : TeXitoi/rust/mandelbrot-resurected, r=cmr
Changes:
* add licence;
* remove usage of libc and unsafe;
* use BufferedWriter to improve performance;
* use a DummyWriter to cancel binary output in test.
2013-11-17 14:01:58 -08:00
Dave Hodder
48f76a0577 Add doc comment for extra::url::query_to_str 2013-11-17 16:52:14 +00:00
bors
e0943504e4 auto merge of #10523 : huonw/rust/10522, r=cmr
If any of the digits was one past the maximum (e.g. 10**9 for base 10),
then this wasn't detected correctly and so the length of the digit was
one more than expected, causing a very large allocation.

Fixes #10522.
Fixes #10288.
2013-11-17 07:32:13 -08:00
bors
5208332a1a auto merge of #10518 : huonw/rust/6911, r=alexcrichton
Bringing it into line with the unused-variable one,

    fn main() {
        let mut _a = 1;
    }

will not warn that `_a` is never used mutably.

Fixes #6911.
2013-11-17 06:21:47 -08:00
bors
6c8e33753c auto merge of #10510 : chris-morgan/rust/fix-num_lit-grammar-in-the-reference-manaul, r=cmr
- Cause `0` to be considered a valid integer literal (it is).
- Add octal literals (missed from #10243).

I have *not* modified doc/po/rust.md.pot or doc/po/ja/rust.md.po at all;
they already seem to be out of date so it's easier to ignore them for
myself. I can update them if desired, of course.
2013-11-17 04:26:37 -08:00
Guillaume Pinot
93bb99ea09 Prettier long string breaking. 2013-11-17 13:09:56 +01:00
Guillaume Pinot
0c3b04fa0f Clarrify the message for test mode and use u8 instead of i8 for storing bits 2013-11-17 12:47:47 +01:00
bors
dff4f52a72 auto merge of #10509 : cmr/rust/trait_name, r=alexcrichton
Rebase + fix of #10118
2013-11-17 03:16:37 -08:00
Guillaume Pinot
6258857beb resurect shootout-mandelbrot.rs
Changes:
* add licence;
* remove usage of libc and unsafe;
* use BufferedWriter to improve performance;
* use a DummyWriter to cancel binary output in test.
2013-11-17 12:04:36 +01:00
bors
66df86ae98 auto merge of #10466 : alexcrichton/rust/issue-10334, r=cmr
These commits create a `Buffer` trait in the `io` module which represents an I/O reader which is internally buffered. This abstraction is used to reasonably implement `read_line` and `read_until` along with at least an ok implementation of `read_char` (although I certainly haven't benchmarked `read_char`).
2013-11-17 01:21:36 -08:00
bors
0a577f384e auto merge of #10454 : z0w0/rust/issue-9944, r=cmr
Allows you to provide explicit `--cfg` flags when building certain packages through the rustpkg API.
2013-11-16 23:46:37 -08:00
Huon Wilson
c8e6a38693 extra: handle an edge case in BigUint.to_str().
If any of the digits was one past the maximum (e.g. 10**9 for base 10),
then this wasn't detected correctly and so the length of the digit was
one more than expected, causing a very large allocation.

Fixes #10522.
Fixes #10288.
2013-11-17 16:05:01 +11:00
Ian Daniher
b60b411495 fix 10468, propagate optimization level as rustc::driver::session::OptLevel 2013-11-16 20:26:01 -05:00
bors
b0e1318164 auto merge of #10420 : sanxiyn/rust/path, r=cmr
Fix #10283.
2013-11-16 14:36:40 -08:00
Huon Wilson
6bd8bb51a0 lint: _-prefixed variables don't get an unused-mut warning.
Bringing it into line with the unused-variable one,

    fn main() {
        let mut _a = 1;
    }

will not warn that `_a` is never used mutably.

Fixes #6911.
2013-11-16 22:20:42 +11:00
Alex Crichton
01343d3d29 Implement read_char on the Buffer trait 2013-11-16 02:11:47 -08:00
Corey Richardson
ab9e3a6652 Adjust error message for method type mismatch
Closes #10118, Closes #5925
2013-11-16 00:50:20 -05:00
Jaemin Moon
51bdec18b0 Show the name of the trait in the error message 2013-11-16 00:50:18 -05:00
Chris Morgan
9fa32c07a0 Fix the num_lit grammar in the reference manual.
- Cause `0` to be considered a valid integer literal (it is).
- Add octal literals (missed from #10243).

I have *not* modified doc/po/rust.md.pot or doc/po/ja/rust.md.po at all;
they already seem to be out of date so it's easier to ignore them for
myself. I can update them if desired, of course.
2013-11-16 15:53:56 +11:00
Chris Morgan
8e59c5d34a Don't make tags for our dependencies and tests.
Largely, this is just being more specific about where tags get searched
for to remove external dependencies like src/llvm, which reduces the
number of tags *enormously* and significantly increases the usefulness
of the tags file as it is then focusing on 240K lines of Rust code
and 4.5K of C++ rather than just shy of 1M lines of C++ code (mostly
from LLVM) and another 100K lines of Rust tests and a diverse collection
of other languages.

src/rustllvm/RustWrapper.cpp and src/rustllvm/PassWrapper.cpp are
getting tags made, but I'm not sure if that's desirable or not. At
worst, it's not a significant wrong.

A future, desirable step is producing tags for just libstd and libextra
for the use of people using Rust-the-language rather than working on
Rust itself.
2013-11-16 13:44:52 +11:00
bors
90754ae9c9 auto merge of #10478 : TeXitoi/rust/shootout-meteor, r=brson
This implementation of the meteor contest implements:
 - insertion check with bit trick;
 - pregenetation of every feasible placement of the pieces on the
   board;
 - filtering of placement that implies unfeasible board
 - central symetry breaking

related to #2776
2013-11-14 22:01:26 -08:00
bors
43f6791e75 auto merge of #10497 : thestinger/rust/cleanup, r=cmr
This is the same functionality as `ptr::read_ptr`.
2013-11-14 19:31:24 -08:00
Daniel Micay
fbad2e2ae9 remove cast::unsafe_copy
This is the same functionality as `ptr::read_ptr`.
2013-11-14 22:20:12 -05:00
Guillaume Pinot
d2bcc7b621 Improve variable naming. 2013-11-14 23:22:44 +01:00
Guillaume Pinot
74d27311a7 remove useless Iterate impl, and permute the order of the argument of iterate
Writing iterate(x, f) is more logical as rust iterator pipeline is left to right.
2013-11-14 23:05:33 +01:00
bors
ade310cbb6 auto merge of #10018 : fhahn/rust/check-inferred-ints, r=alexcrichton
I've started working on this issue and pushed a small commit, which adds a range check for integer literals in `middle::const_eval` (no `uint` at the moment) 
At the moment, this patch is just a proof of concept, I'm not sure if there is a better function for the checks in `middle::const_eval`. This patch does not check for overflows after constant folding, eg:

    let x: i8 = 99 + 99;
2013-11-14 13:01:35 -08:00
bors
0d11935bf6 auto merge of #10428 : toffaletti/rust/try_lock, r=alexcrichton
I need try_lock for an algorithm I'm trying to implement in Rust.
2013-11-14 11:51:25 -08:00
bors
11ece44f02 auto merge of #10484 : nibrahim/rust/docfix, r=cmr
Without this, a.rs appears as a struck out line.
2013-11-14 08:01:42 -08:00
Noufal Ibrahim
bc698ba3ef Fixes formatting
Without this, a.rs appears as a struck out line.
2013-11-14 21:04:38 +05:30
bors
af62adfad0 auto merge of #9788 : geoffhill/rust/bare-fn-cast, r=pnkfelix
Bare functions are another example of a scalar but non-numeric
type (like char) that should be handled separately in casts.
This disallows expressions like `0 as extern "Rust" fn() -> int;`.

It might be advantageous to allow casts between bare functions
and raw pointers in unsafe code in the future, to pass function
pointers between Rust and C.

Closes #8728
2013-11-14 05:21:21 -08:00