Commit Graph

916 Commits

Author SHA1 Message Date
Huon Wilson
164f7a290e std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut []. 2013-12-15 23:37:41 +11:00
Huon Wilson
f97040a93b std::vec: remove unnecessary count parameter on {bytes,
raw}::copy_memory.

Slices carry their length with them, so we can just use that
information.
2013-12-15 22:23:11 +11:00
bors
ca54ad8592 auto merge of #10952 : huonw/rust/1ms-bench, r=cmr
This makes sure we always run benchmarks even if they are predicted to
take a long time, so that we have some non-zero time to display
(although the error bars may be huge for particularly slow benchmarks).

Fixes #9532.
2013-12-14 14:11:21 -08:00
bors
844003683b auto merge of #10931 : sfackler/rust/base64-visibility, r=alexcrichton
These got swept up in the great privatizing of 2013.
2013-12-14 00:56:31 -08:00
bors
67177ef3e1 auto merge of #10923 : boredomist/rust/export-summary-members, r=alexcrichton
Several of the members of `extra::stats::Summary` were calculated and tested, but not exposed externally. This change exposes all of the members.
2013-12-13 20:01:44 -08:00
Brian Anderson
df1aa7ecd2 Ignore time tests on android. #10958 2013-12-13 16:39:20 -08:00
Huon Wilson
79739d96f7 extra::test: handle slow benchmarks more gracefully.
This makes sure we always run benchmarks even if they are predicted to
take a long time, so that we have some non-zero time to display
(although the error bars may be huge for particularly slow benchmarks).

Fixes #9532.
2013-12-13 23:18:55 +11:00
Steven Fackler
9762698b96 Make base64::config fields public again
These got swept up in the great privatizing of 2013.
2013-12-11 19:27:20 -08:00
Erik Price
07e18597bd Make priv members of extra::stats::Summary public. 2013-12-11 12:36:17 -08:00
Erik Price
5731ca3078 Make 'self lifetime illegal.
Also remove all instances of 'self within the codebase.

This fixes #10889.
2013-12-11 10:54:06 -08:00
bors
b8b16ae099 auto merge of #10791 : pcwalton/rust/decelling, r=pcwalton
34 uses of `Cell` remain.

r? @alexcrichton
2013-12-10 19:16:19 -08:00
Jack Moffitt
b349036e5f Make crate hash stable and externally computable.
This replaces the link meta attributes with a pkgid attribute and uses a hash
of this as the crate hash. This makes the crate hash computable by things
other than the Rust compiler. It also switches the hash function ot SHA1 since
that is much more likely to be available in shell, Python, etc than SipHash.

Fixes #10188, #8523.
2013-12-10 17:04:24 -07:00
Patrick Walton
8c2ebe1622 libextra: Remove various cells involved in Arcs.
I could have done this by making `Arc` use RAII, but this is too
involved for now.
2013-12-10 15:13:12 -08:00
Patrick Walton
786dea207d libextra: Another round of de-Cell-ing.
34 uses of `Cell` remain.
2013-12-10 15:13:12 -08:00
Kiet Tran
1755408d1a Remove dead codes 2013-12-08 02:55:28 -05:00
bors
3cc86d8ab3 auto merge of #10211 : ktt3ja/rust/add-lrucache, r=brson
There's an open issue ([Issue #4988](https://github.com/mozilla/rust/issues/4988?source=cc)) for adding an LRU Cache to the standard library. I'm new to this so I hope I didn't miss anything I'm supposed to do.
2013-12-05 12:32:12 -08:00
Kevin Ballard
2c4a1b55e6 Rename extra::json::*::init() constructors to *::new() 2013-12-04 22:33:53 -08:00
Kevin Ballard
408dc5ad1b Revert "libstd: Change Path::new to Path::init."
This reverts commit c54427ddfb.

Leave the #[ignores] in that were added to rustpkg tests.

Conflicts:
	src/librustc/driver/driver.rs
	src/librustc/metadata/creader.rs
2013-12-04 22:33:53 -08:00
Huon Wilson
b0426edc0a std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter. 2013-12-04 22:35:53 +11:00
Huon Wilson
9d64e46013 std::str: remove from_utf8.
This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-04 22:35:53 +11:00
bors
50e9d4f889 auto merge of #10752 : dhodder/rust/master, r=pcwalton 2013-12-03 18:31:36 -08:00
bors
693ec73b9b auto merge of #10747 : alexcrichton/rust/snapshots, r=cmr
This registers new snapshots after the landing of #10528, and then goes on to tweak the build process to build a monolithic `rustc` binary for use in future snapshots. This mainly involved dropping the dynamic dependency on `librustllvm`, so that's now built as a static library (with a dynamically generated rust file listing LLVM dependencies).

This currently doesn't actually make the snapshot any smaller (24MB => 23MB), but I noticed that the executable has 11MB of metadata so once progress is made on #10740 we should have a much smaller snapshot.

There's not really a super-compelling reason to distribute just a binary because we have all the infrastructure for dealing with a directory structure, but to me it seems "more correct" that a snapshot compiler is just a `rustc` binary.
2013-12-03 14:36:59 -08:00
Alex Crichton
acc5e32e53 Register new snapshots 2013-12-03 14:31:54 -08:00
bors
899217c11b auto merge of #10757 : TeXitoi/rust/mut-split-iter, r=alexcrichton
I've renamed `MutableVector::mut_split(at)` to `MutableVector::mut_split_at(at)` to be coherent with ImmutableVector.  As specified in the commit log, The `size_hint` method is not optimal because of #9629.
2013-12-03 10:11:25 -08:00
bors
fc3b7c1450 auto merge of #10770 : alexcrichton/rust/static-librustrt, r=alexcrichton
This wasn't uncovered during testing because the librustrt is available locally
in the build directory (and it needs to be for all the tests to link against it
as well).

Closes #10765
2013-12-02 20:16:51 -08:00
Philipp Brüschweiler
870fb7d75c c_vec: Modernize
Generally use more modern constructs (such as using `CVec::new()` as
constructor and move to more method usage).

Potentially controversial changes:
* change `get()` to return a reference instead of cloning
* remove `set()`, add `get_mut()` instead
* add an `unwrap()` method that destroys the CVec without running any
  associated destructor
2013-12-02 21:53:23 +01:00
Alex Crichton
837a770b21 Declare librustrt a static dependency of libextra
This wasn't uncovered during testing because the librustrt is available locally
in the build directory (and it needs to be for all the tests to link against it
as well).

Closes #10765
2013-12-02 09:39:02 -08:00
Guillaume Pinot
25bb1a406c rename MutableVector::mut_split(at) to MutableVector::mut_split_at(at) 2013-12-02 08:58:07 +01:00
Dave Hodder
2c1acd7998 Add struct and type doc comments for extra::url::*
Updated doc comments further, following suggestions from huonw in PR
#10752.
2013-12-01 22:25:58 +00:00
bors
0455e4c9f8 auto merge of #10756 : thestinger/rust/transmute, r=alexcrichton 2013-12-01 12:42:16 -08:00
Daniel Micay
b4a1733fd2 remove useless transmute_immut function 2013-12-01 10:18:47 -05:00
Dave Hodder
0515e0541f Add struct and type doc comments for extra::url::* 2013-12-01 12:30:32 +00:00
bors
4252a24ae1 auto merge of #10528 : alexcrichton/rust/static-linking-v2, r=pcwalton
In this series of commits, I've implemented static linking for rust. The scheme I implemented was the same as my [mailing list post](https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html).

The commits have more details to the nitty gritty of what went on. I've rebased this on top of my native mutex pull request (#10479), but I imagine that it will land before this lands, I just wanted to pre-emptively get all the rebase conflicts out of the way (becuase this is reorganizing building librustrt as well).

Some contentious points I want to make sure are all good:

* I've added more "compiler chooses a default" behavior than I would like, I want to make sure that this is all very clearly outlined in the code, and if not I would like to remove behavior or make it clearer.
* I want to make sure that the new "fancy suite" tests are ok (using make/python instead of another rust crate)

If we do indeed pursue this, I would be more than willing to write up a document describing how linking in rust works. I believe that this behavior should be very understandable, and the compiler should never hinder someone just because linking is a little fuzzy.
2013-11-30 14:41:40 -08:00
Alex Crichton
56e4c82a38 Test fixes and merge conflicts 2013-11-30 14:34:59 -08:00
bors
9bf62f71bc auto merge of #10727 : erickt/rust/json, r=huonw
This PR does some small modernizations to the json library. First is to remove the `@` boxes, second is to rename the constructors to `new`.
2013-11-30 06:06:42 -08:00
Erick Tryzelaar
a7b311ac61 extra: missed a couple @ in json 2013-11-29 21:26:03 -08:00
Alex Crichton
e338a4154b Add generation of static libraries to rustc
This commit implements the support necessary for generating both intermediate
and result static rust libraries. This is an implementation of my thoughts in
https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html.

When compiling a library, we still retain the "lib" option, although now there
are "rlib", "staticlib", and "dylib" as options for crate_type (and these are
stackable). The idea of "lib" is to generate the "compiler default" instead of
having too choose (although all are interchangeable). For now I have left the
"complier default" to be a dynamic library for size reasons.

Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an
rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a
dynamic object. I chose this for size reasons, but also because you're probably
not going to be embedding the rustc compiler anywhere any time soon.

Other than the options outlined above, there are a few defaults/preferences that
are now opinionated in the compiler:

* If both a .dylib and .rlib are found for a rust library, the compiler will
  prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option
* If generating a "lib", the compiler will generate a dynamic library. This is
  overridable by explicitly saying what flavor you'd like (rlib, staticlib,
  dylib).
* If no options are passed to the command line, and no crate_type is found in
  the destination crate, then an executable is generated

With this change, you can successfully build a rust program with 0 dynamic
dependencies on rust libraries. There is still a dynamic dependency on
librustrt, but I plan on removing that in a subsequent commit.

This change includes no tests just yet. Our current testing
infrastructure/harnesses aren't very amenable to doing flavorful things with
linking, so I'm planning on adding a new mode of testing which I believe belongs
as a separate commit.

Closes #552
2013-11-29 18:36:13 -08:00
Erick Tryzelaar
6818b96a66 extra: json::Encoder should take a &mut io::Writer 2013-11-29 11:19:19 -08:00
Erick Tryzelaar
f7b739c34c extra: Rename json constructors into *::init 2013-11-29 11:19:19 -08:00
Erick Tryzelaar
5b41df4ca0 Remove some unnecessary impls from json 2013-11-29 11:19:18 -08:00
Erick Tryzelaar
18ca312984 Remove @ from json::Error 2013-11-29 11:19:18 -08:00
Patrick Walton
c54427ddfb libstd: Change Path::new to Path::init. 2013-11-29 10:55:13 -08:00
Alex Crichton
ab387a6838 Register new snapshots 2013-11-28 20:27:56 -08:00
bors
859c3baf64 auto merge of #10519 : nikomatsakis/rust/issue-8624-borrowck-overly-permissive, r=pnkfelix
See #8624 for details.

r? @pnkfelix
2013-11-28 03:51:32 -08:00
Niko Matsakis
bc4164d4c0 Modify iterators to make them safe with the new rules. 2013-11-28 06:43:39 -05:00
bors
82d9033b67 auto merge of #10679 : alexcrichton/rust/no-routine, r=pcwalton 2013-11-26 19:37:38 -08:00
Alex Crichton
7dcc066bd2 Remove unused std::routine 2013-11-26 15:19:41 -08:00
Patrick Walton
9521551b47 librustc: Fix merge fallout. 2013-11-26 11:04:39 -08:00
Patrick Walton
749ee53c6d librustc: Make || lambdas not infer to procs 2013-11-26 08:25:27 -08:00
Patrick Walton
38efa17bb8 test: Remove all remaining non-procedure uses of do. 2013-11-26 08:25:27 -08:00