Commit Graph

24166 Commits

Author SHA1 Message Date
bors
e2d192c9f4 auto merge of #10777 : alexcrichton/rust/issue-10743, r=luqmana
Commit messages have the fun details, the focus of this is closing #10743 though
2013-12-03 08:21:26 -08:00
Alex Crichton
0dc9f62779 Resume propagation of linking to native dylibs
The reasons for this are outlined in issue #10743 as well as the comment I have
now placed in the code.

Closes #10743
2013-12-03 08:19:33 -08:00
Alex Crichton
6437122e64 Tidy up a few problems with run-make tests
Use the correct set of dependencies as well as CFG_PYTHON instead of assuming
'python' is the right one.
2013-12-03 08:13:00 -08:00
Alex Crichton
2bd80758a2 Continue tightening holes in reachability
* Don't flag any address_insignificant statics as reachable because the whole
  point of the address_insignificant optimization is that the static is not
  reachable. Additionally, there's no need for it to be reachable because LLVM
  optimizes it away.

* Be sure to not leak external node ids into our reachable set, this can
  spuriously cause local items to be considered reachable if the node ids just
  happen to line up
2013-12-03 08:13:00 -08:00
bors
6a9db409e5 auto merge of #10782 : alexcrichton/rust/rustdoc-lib, r=thestinger
This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.
2013-12-03 01:51:26 -08:00
bors
f1ef36ea2f auto merge of #10773 : jvns/rust/patch-1, r=cmr
The section on closure types was missing, so I added one. I'm new to Rust, so there are probably important things to say about closure types that I'm missing here.

I tested the example with the latest Rust nightly.
2013-12-02 23:32:33 -08:00
bors
18084be316 auto merge of #10772 : alexcrichton/rust/issue-3053, r=alexcrichton
Rebasing #10446 with a `pub fn main`
2013-12-02 21:32:38 -08:00
Alex Crichton
6600ba97c3 rustdoc: Tell rustc we're building a library
This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.
2013-12-02 21:26:40 -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
bors
8cb59d3868 auto merge of #10771 : pnkfelix/rust/fix-make-check-for-ccacheless-clang, r=acrichto
This fixes a problem with `make check` clang -Werror failing due to an unused -Llib arg.
2013-12-02 19:02:07 -08:00
bors
3a3ffab69b auto merge of #10759 : SiegeLord/rust/placeholder, r=cmr
This makes the search bar more visible.
2013-12-02 17:31:42 -08:00
bors
0e66baf013 auto merge of #10736 : Blei/rust/fix_c_vec, r=alexcrichton
Controversial change: make the constructors safe, but instead mark the
setters and getters as unsafe. This follows the tradition that construction
of *T is safe, but the access is unsafe instead.
2013-12-02 16:06:40 -08:00
bors
c8b60a2d9e auto merge of #10742 : alexcrichton/rust/frameworks, r=cmr
Commits have the fun details, and scrutiny on the new documentation would be appreciated!
2013-12-02 13:36:41 -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
bors
fc4540d23e auto merge of #10728 : sanxiyn/rust/proc, r=cmr
Fix #10718.
2013-12-02 12:21:32 -08:00
Julia Evans
94c02af873 Add section on closure types to manual 2013-12-02 14:39:11 -05:00
Alex Crichton
d4c40b519b Bring the linkage documentation up-to-date
This includes documentation for all the previous changes done to linking
in #10582. Additionally, this brings the list of feature-gates up-to-date with
the currently recognized list of features.
2013-12-02 11:10:40 -08:00
Niko Matsakis
7067561189 Add test for #3053. Fixes #3053. 2013-12-02 10:33:17 -08:00
Felix S. Klock II
5e00d5c790 Make the ccache-free case look like the ccache case.
This fixes a problem with `make check` clang -Werror failing due to an
unused -Llib arg.
2013-12-02 19:25:14 +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
Seo Sanghyeon
e41c331b2e Fix type inference for proc expressions 2013-12-02 21:39:53 +09:00
SiegeLord
e73d50653f Add a type="search" to the search bar in the documentation. 2013-12-01 21:36:59 -05:00
SiegeLord
a3aa325c93 Add placeholder text to the search bar in the documentation. 2013-12-01 20:42:38 -05:00
bors
61443dc1f5 auto merge of #10753 : alexcrichton/rust/fix-make-install, r=huonw
Turns out that we only want to install the target rlibs, not the host rlibs.
I had it backwards the first time, then mixed up the second time, but this time
should get it right.

There's no need for host rlib files because none of them are needed at runtime.
2013-12-01 15:36:58 -08:00
bors
0455e4c9f8 auto merge of #10756 : thestinger/rust/transmute, r=alexcrichton 2013-12-01 12:42:16 -08:00
bors
9ac48785d6 auto merge of #10749 : Blei/rust/fix-linker-args, r=alexcrichton
This is inspired by a mystifying linker failure when using `pkg-config` to
generate the linker args: `pkg-config` produces output that ends in a
space, thus resulting in an empty linker argument.

Also added some updates to the concerning error messages that helped
spotting this bug.
2013-12-01 11:26:57 -08:00
Philipp Brüschweiler
32688f8f74 rustc: filter out empty linker args
This is inspired by a mystifying linker failure when using `pkg-config` to
generate the linker args: `pkg-config` produces output that ends in a
space, thus resulting in an empty linker argument.

Also added some updates to the concerning error messages that helped
spotting this bug.
2013-12-01 19:29:01 +01:00
Daniel Micay
b4a1733fd2 remove useless transmute_immut function 2013-12-01 10:18:47 -05:00
Alex Crichton
c6e934f447 *Actually* fix make install with rlibs
Turns out that we only want to install the target rlibs, not the host rlibs.
I had it backwards the first time, then mixed up the second time, but this time
should get it right.

There's no need for host rlib files because none of them are needed at runtime.
2013-12-01 06:58:46 -08:00
bors
df41115213 auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichton 2013-12-01 05:42:06 -08:00
bors
83084e9c77 auto merge of #10748 : kballard/rust/issue-10734-rpass, r=alexcrichton
Stop relying on a malloc error to indicate failure and instead use an
explicit check. Also ensure that the value is dropped at the correct
time (e.g. that the if statement is translated into `{ expr }` instead
of `expr`).
2013-12-01 04:26:52 -08:00
bors
b2aa00ba8b auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmr
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets.

With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes.

My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**.

I believe there is more to gain by fiddling with the enums' layouts.
2013-12-01 03:11:58 -08:00
Philipp Brüschweiler
47ce981903 ast: Remove one @ and fix the fallout 2013-12-01 11:24:58 +01:00
Kevin Ballard
2ffcbf11f5 Rewrite the issue-10734 rpass file
Stop relying on a malloc error to indicate failure and instead use an
explicit check. Also ensure that the value is dropped at the correct
time (e.g. that the if statement is translated into `{ expr }` instead
of `expr`).
2013-11-30 23:55:55 -08:00
bors
c470184c20 auto merge of #10746 : alexcrichton/rust/fix-make-install, r=cmr
It was only copying the host files, not the target rlib files.
2013-11-30 21:01:43 -08:00
bors
6616dbf075 auto merge of #10739 : DaGenix/rust/mut-chunks, r=alexcrichton
mut_chunks() returns an iterator that produces mutable slices. This is the mutable version of the existing chunks() method on the ImmutableVector trait.

EDIT: This uses only safe code now.

PREVIOUSLY:
I tried to get this working with safe code only, but I couldn't figure out how to make that work. Before #8624, the exact same code worked without the need for the transmute() call. With that fix and without the transmute() call, the compiler complains about the call to mut_slice(). I think the issue is that the mutable slice that is returned will live longer than the self parameter since the self parameter doesn't have an explicit lifetime. However, that is the way that the Iterator trait defines the next() method. I'm sure there is a good reason for that, although I don't quite understand why. Anyway, I think the interface is safe, since the MutChunkIter will only hand out non-overlapping pointers and there is no way to get it to hand out the same pointer twice.
2013-11-30 19:46:35 -08:00
Alex Crichton
8b964bf349 Fix make install to install rlib files
It was only copying the host files, not the target rlib files.
2013-11-30 18:58:09 -08:00
bors
7c889a2fb5 auto merge of #10733 : alexcrichton/rust/ignore-on-windows, r=pcwalton
I've seen this fail on windows twice now, and it's not clear to me why it's
failing. For now, ignore it on that platform while investigation enuses.
2013-11-30 18:31:46 -08:00
bors
1998b3e21e auto merge of #10738 : sfackler/rust/buffered-fixes, r=alexcrichton
BufferedWriter::inner flushes before returning the underlying writer.

BufferedWriter::write no longer flushes the underlying writer.

LineBufferedWriter::write flushes up to the *last* newline in the input
string, not the first.
2013-11-30 17:16:37 -08:00
Palmer Cox
2a8dfc3f22 Implement DoubleEndedIterator for MutChunkIter. 2013-11-30 19:54:28 -05:00
Palmer Cox
f2a01ea277 Implement mut_chunks() method for MutableVector trait.
mut_chunks() returns an iterator that produces mutable slices. This is the
mutable version of the existing chunks() method on the ImmutableVector trait.
2013-11-30 19:07:56 -05:00
bors
436adc2131 auto merge of #10731 : chris-morgan/rust/fix-double-slashing, r=metajack
CFG_BUILD_DIR, CFG_LLVM_SRC_DIR and CFG_SRC_DIR all have trailing
slashes, by definition, so this is correct.

(This is purely cosmetic; the doubled slash is ignored by all the tools we're using.)
2013-11-30 15:51:39 -08:00
Alex Crichton
f9d6fd20a5 Support OSX frameworks
This adds support to link to OSX frameworks via the new link attribute when
using `kind = "framework"`. It is a compiler error to request linkage to a
framework when the target is not macos because other platforms don't support
frameworks.

Closes #2023
2013-11-30 15:47:43 -08: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
Eduard Burtescu
a9c4b18b18 Box Block, fn_decl, variant and Ty in the AST, as they were inflating critical enum sizes. 2013-12-01 00:00:39 +02:00
bors
dfe46f788b auto merge of #10737 : huonw/rust/with-cap, r=alexcrichton
This allows one to reduce the number of reallocs of the internal buffer
if one has an approximate idea of the size of the final output.
2013-11-30 09:56:41 -08:00
Steven Fackler
26e57bbdb5 Fixes for BufferedWriter and LineBufferedWriter
BufferedWriter::inner flushes before returning the underlying writer.

BufferedWriter::write no longer flushes the underlying writer.

LineBufferedWriter::write flushes up to the *last* newline in the input
string, not the first.
2013-11-30 11:33:11 -05: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
Huon Wilson
be6ae6eb37 std::io::mem: add a with_capacity constructor to MemWriter.
This allows one to reduce the number of reallocs of the internal buffer
if one has an approximate idea of the size of the final output.
2013-12-01 00:58:27 +11:00