Commit Graph

29897 Commits

Author SHA1 Message Date
Daniel Micay
1b1ca6d546 add back jemalloc to the tree
This adds a `std::rt::heap` module with a nice allocator API. It's a
step towards fixing #13094 and is a starting point for working on a
generic allocator trait.

The revision used for the jemalloc submodule is the stable 3.6.0 release.

Closes #11807
2014-05-10 19:58:17 -04:00
Nick Cameron
37ca36783c Reorganise driver code.
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... fns easier to use by tools.

This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
2014-05-11 11:08:01 +12:00
bors
11571cd9c1 auto merge of #14081 : Manishearth/rust/c-schar-reexport, r=huonw
Don't merge this until #14076 merges, since it is based on top of that branch to avoid merge conflicts.
2014-05-10 12:31:35 -07:00
Guillaume Pinot
db93ca28e2 shootout-nbody improvements
- minimize bound check
- factorise operations
- use x, y, z instead of [f64, ..3]
- ~1.15 faster
2014-05-10 20:32:31 +02:00
bors
1001635dc1 auto merge of #14073 : alexcrichton/rust/snapshots, r=huonw 2014-05-10 09:56:34 -07:00
klutzy
c92f51974b librand: Revise crypto part of document
This patch adds document which explains when to use `OSRng` in
cryptographic context, and explains why we use `/dev/urandom` instead
of `/dev/random`.
2014-05-10 23:37:55 +09:00
Manish Goregaokar
4cbd7754ea Reexport wchar_t, c_schar 2014-05-10 19:35:14 +05:30
bors
e850316408 auto merge of #14068 : alexcrichton/rust/rustdoc-xcrate-links, r=brson
This should improve the libcore experience quite a bit when looking at the
libstd documentation.
2014-05-10 03:36:30 -07:00
bors
061450dcf1 auto merge of #14066 : edwardw/rust/pod-to-copy, r=alexcrichton
Some error messages still use the word `Pod` instead of `Copy`. Renames
them.
2014-05-10 02:11:32 -07:00
bors
a7d877ce62 auto merge of #14056 : kballard/rust/vim_indent_fix, r=huonw
cindent handles the following case incorrectly:

    impl X {
        b: int,
        //
        c: int,
    }

if you try and insert a new line after the `c` declaration.

To fix this, fix the get_line_trimmed() function to work properly, and
then extend GetRustIndent to keep searching backwards until it finds a
non-blank line after trimming. This lets it handle the trailing comma
case properly, as if the comment were never there.

Fixes #14041.
2014-05-09 23:51:30 -07:00
Alex Crichton
3f5e3af838 Register new snapshots 2014-05-09 21:13:02 -07:00
bors
5b4774dafc auto merge of #14065 : alexcrichton/rust/ignore-flaky-windows-test, r=brson
See #14064 for some rationale, but the basic idea is that I suspect that there
is an LLVM codegen bug somewhere, and I'm not entirely sure why it's happening
intermittently rather than deterministically...

cc #14064
2014-05-09 20:31:31 -07:00
bors
fb8773463a auto merge of #14063 : TeXitoi/rust/shootout-meteor-improvement, r=pcwalton
- 5-10% of raw speedup
- parallelization of the search
2014-05-09 18:36:29 -07:00
bors
e3c62a20c3 auto merge of #14057 : kballard/rust/remove_no-bounds, r=sfackler
Printing <no-bounds> on trait objects comes from a time when trait
objects had a non-empty default bounds set. As they no longer have any
default bounds, printing <no-bounds> is just noise.
2014-05-09 16:41:47 -07:00
bors
3d6cf1d525 auto merge of #14055 : nikomatsakis/rust/issue-5527-use-substs-in-trans, r=pcwalton
Code to use `ty::substs` in trans. As part of this, uncovered (and fixed) issue #14050.

r? @pcwalton
2014-05-09 14:51:38 -07:00
Alex Crichton
620b4352f2 doc: Fix some broken links 2014-05-09 14:42:12 -07:00
Alex Crichton
1ba4971ab8 rustdoc: Hyperlink cross-crate reexports
This should improve the libcore experience quite a bit when looking at the
libstd documentation.
2014-05-09 14:42:12 -07:00
bors
66f4f558cb auto merge of #14054 : luqmana/rust/at, r=alexcrichton
`/data/local/tmp` seems to be more common.
2014-05-09 12:56:35 -07:00
bors
47ecc2e889 auto merge of #14046 : alexcrichton/rust/ignore-a-test-on-freebsd, r=kballard
This test runs successfully manually, but the bots are having trouble getting
this test to pass. Ignore it on freebsd for now.
2014-05-09 11:01:42 -07:00
Edward Wang
0f25aad746 Rename Pod to Copy
Some error messages still use the word `Pod` instead of `Copy`. Renames
them.
2014-05-10 02:01:29 +08:00
Alex Crichton
300109e5eb serialize: Ignore two flaky json tests on windows
See #14064 for some rationale, but the basic idea is that I suspect that there
is an LLVM codegen bug somewhere, and I'm not entirely sure why it's happening
intermittently rather than deterministically...

cc #14064
2014-05-09 09:49:30 -07:00
bors
58d540f0c6 auto merge of #14053 : FlaPer87/rust/master, r=huonw
This patch allows for using derivings for `kinds` in libcore

r? @alexcrichton
2014-05-09 09:11:35 -07:00
Guillaume Pinot
3fa293c10f shootout-meteor improvement
- 5-10% of raw speedup
- parallelization of the search
2014-05-09 17:39:00 +02:00
bors
176df98a19 auto merge of #14044 : hirschenberger/rust/lint_mut_match, r=alexcrichton
fixing #13866
2014-05-09 06:26:33 -07:00
bors
65205652b8 auto merge of #14043 : sanxiyn/rust/attr-reference, r=alexcrichton
Attribute grammar in reference manual allowed `#[foo, bar]`, which does not match parser behavior.

Also rename nonterminals to match parser code.

Fix #13825.
2014-05-09 04:36:33 -07:00
Niko Matsakis
ed7c849057 Currently trans uses Vec<ty::t> to represent substitutions instead of a proper
ty::substs struct. This is a holdover from the olden days of yore. This patch
removes the last vestiges of that practice. This is part of the work
I was doing on #5527.
2014-05-09 05:56:44 -04:00
Niko Matsakis
b6c9dbd3e4 Check lifetime parameters when we do check for supertrait impls. Fixes #14050. 2014-05-09 05:55:42 -04:00
Niko Matsakis
fa43727781 Rename resolve_regions to resolve_regions_and_report_errors 2014-05-09 05:55:42 -04:00
bors
52002154c7 auto merge of #14035 : alexcrichton/rust/experimental, r=huonw
This was intended as part of the I/O timeouts commit, but it was mistakenly
forgotten. The type of the timeout argument is not guaranteed to remain constant
into the future.
2014-05-09 02:41:36 -07:00
bors
ab369c4353 auto merge of #14025 : tbrooks8/rust/big_uint_doc, r=alexcrichton
I changed the documentation for the BigUint to reflection the deprecation of ~[T] in favor of Vec<T>.
2014-05-09 00:51:35 -07:00
bors
fcf25ae83d auto merge of #14019 : brson/rust/docs, r=alexcrichton
Just small bits of polish.
2014-05-08 23:01:40 -07:00
Kevin Ballard
33cc0efa3d Remove <no-bounds> on trait objects
Printing <no-bounds> on trait objects comes from a time when trait
objects had a non-empty default bounds set. As they no longer have any
default bounds, printing <no-bounds> is just noise.
2014-05-08 21:37:57 -07:00
bors
a990920c6f auto merge of #13963 : kballard/rust/remove_owned_vec_from_iterator, r=pcwalton
With `~[T]` no longer growable, the `FromIterator` impl for `~[T]` doesn't make
much sense. Not only that, but nearly everywhere it is used is to convert from
a `Vec<T>` into a `~[T]`, for the sake of maintaining existing APIs. This turns
out to be a performance loss, as it means every API that returns `~[T]`, even a
supposedly non-copying one, is in fact doing extra allocations and memcpy's.
Even `&[T].to_owned()` is going through `Vec<T>` first.

Remove the `FromIterator` impl for `~[T]`, and adjust all the APIs that relied
on it to start using `Vec<T>` instead. This includes rewriting
`&[T].to_owned()` to be more efficient, among other performance wins.

Also add a new mechanism to go from `Vec<T>` -> `~[T]`, just in case anyone
truly needs that, using the new trait `FromVec`.

[breaking-change]
2014-05-08 21:01:42 -07:00
bors
c0a25e4fdc auto merge of #14001 : alexcrichton/rust/issue-11680, r=pcwalton
The code in resolve erroneously assumed that private enums weren't visited, so
the logic was adjusted to check to see if the enum definition itself was public.

Closes #11680
2014-05-08 19:12:05 -07:00
Kevin Ballard
0381ad4fdf vim: Fix an indentation issue with cindent
cindent handles the following case incorrectly:

impl X {
    b: int,
    //
    c: int,
}

if you try and insert a new line after the `c` declaration.

To fix this, fix the get_line_trimmed() function to work properly, and
then extend GetRustIndent to keep searching backwards until it finds a
non-blank line after trimming. This lets it handle the trailing comma
case properly, as if the comment were never there.

Fixes #14041.
2014-05-08 19:04:23 -07:00
Niko Matsakis
7cdd02db32 Tweak region inference to ignore constraints like 'a <= 'static, since they
have no value. This also ensures that we can handle some obscure cases of fn
subtyping with bound regions that we didn't used to handle correctly.

Fixes #13974.
2014-05-08 20:31:12 -04:00
bors
74172341aa auto merge of #14010 : richo/rust/tests/11493, r=alexcrichton
Is this what you had in mind?

Closes #11493
2014-05-08 17:16:43 -07:00
Luqman Aden
b55423a852 libstd: Check TMPDIR for android as well and if not set use '/data/local/tmp' instead of '/data/tmp'. 2014-05-08 19:53:04 -04:00
Flavio Percoco
d90b4daac9 core: Allow kinds derivings 2014-05-09 00:08:26 +02:00
bors
c4f0980d2e auto merge of #13990 : nikomatsakis/rust/issue-5527-cleanup-writeback, r=pcwalton
As part of #5527 I had to make some changes here and I just couldn't take it anymore. Refactor the writeback code. Should be functionally equivalent to the old stuff.

r? @pcwalton
2014-05-08 14:16:41 -07:00
Falco Hirschenberger
de92d42d4c Fix false lint warnings in match arms with multiple patterns
fixing #13866
2014-05-08 21:48:45 +02:00
bors
d8781b36fc auto merge of #13985 : alexcrichton/rust/libfmt, r=brson
This code does not belong in libstd, and rather belongs in a dedicated crate. In
the future, the syntax::ext::format module should move to the fmt_macros crate
(hence the name of the crate), but for now the fmt_macros crate will only
contain the format string parser.

The entire fmt_macros crate is marked #[experimental] because it is not meant
for general consumption, only the format!() interface is officially supported,
not the internals.

This is a breaking change for anyone using the internals of std::fmt::parse.
Some of the flags have moved to std::fmt::rt, while the actual parsing support
has all moved to the fmt_macros library.

[breaking-change]
2014-05-08 12:26:39 -07:00
Kevin Ballard
dc30c48381 Move partition/partitioned/concat/connect tests back into slice
There was no reason to remove them from slice. They're testing methods
defined in slice, so that's where they belong.

Leave vec with copies of the partition/partitioned tests because it has
its own implementation of those methods.
2014-05-08 12:08:01 -07:00
Kevin Ballard
f582150159 Restore Decodable impl for ~[T]
Bring back the Decodable impl for ~[T], this time using FromVec. It's
still not recommended that anyone use this, but at least it's available
if necessary.
2014-05-08 12:08:01 -07:00
Kevin Ballard
9fb8741b2e Handle breakage after libcore split
API Changes:

- &[T] and ~[T] no longer support the addition operator (+)
2014-05-08 12:08:01 -07:00
Kevin Ballard
300d865fa4 Add a mechanism to convert from Vec<T> to ~[T]
Add a new trait FromVec with one self-less method from_vec(). This is
kind of like FromIterator, but it consumes a Vec<T>. It's only
implemented for ~[T], but the idea is post-DST it can be implemented for
any Boxed<[T]>.
2014-05-08 12:08:00 -07:00
Kevin Ballard
dbbb847bf0 Handle fallout in bench tests 2014-05-08 12:06:22 -07:00
Kevin Ballard
eab6bb2ece Handle fallout in documentation
Tweak the tutorial's section on vectors and strings, to slightly clarify
the difference between fixed-size vectors, vectors, and slices.
2014-05-08 12:06:22 -07:00
Kevin Ballard
752048a271 Handle more fallout
os::args() no longer auto-borrows to &[~str].
2014-05-08 12:06:22 -07:00
Kevin Ballard
fa82ef23b8 Handle fallout in librustuv
API Changes:

- GetAddrInfoRequest::run() returns Result<Vec<..>, ..>
- Process::spawn() returns Result<(.., Vec<..>), ..>
2014-05-08 12:06:22 -07:00