Commit Graph

24311 Commits

Author SHA1 Message Date
Patrick Walton fdd6750570 compiletest: Remove uses of Cell. 2013-12-10 15:13:12 -08:00
Patrick Walton f08f3a7576 libstd: Remove Cells that were used because of finally by converting
their `finally` blocks to RAII.
2013-12-10 15:13:12 -08:00
Patrick Walton ec5603bf13 librustpkg: Make io::ignore_io_error() use RAII; remove a few more
cells.
2013-12-10 15:13:12 -08:00
Patrick Walton ab3bec91d7 libstd: Remove some cells involved in
`deschedule_running_task_and_then`.
2013-12-10 15:13:12 -08:00
Patrick Walton 7cac9fe763 librustuv: RAII-ify Local::borrow, and remove some 12 Cells. 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
bors 5aad292fb9 auto merge of #10880 : cmr/rust/tut++, r=pnkfelix
Many of them are small. Will squash on request, but I feel like it's easier
for everyone (easier to see and back out individual changes) this way.
2013-12-10 12:51:22 -08:00
bors 4ab6a0856f auto merge of #10886 : alexcrichton/rust/snapshots, r=huonw
Makes the `dead_code` lint a citizen of stage0 to silence the "unknown lint"
warnings.
2013-12-10 07:41:37 -08:00
Corey Richardson c935a88a97 Remove duplication of libstd docs.
This is literally a copy-paste, there's no need to have this duplication.
2013-12-10 09:46:40 -05:00
Corey Richardson c8f47db8f5 Update Freeze information 2013-12-10 09:43:36 -05:00
Corey Richardson fab5624eb6 Tiny fixes to linked list section. 2013-12-10 09:43:36 -05:00
Corey Richardson a44852a2d5 Update Owned to Send, show some types which aren't 2013-12-10 09:43:36 -05:00
Corey Richardson 888144c98d Function declaration takes pats, not exprs. 2013-12-10 09:43:36 -05:00
Corey Richardson b5122c52ae Clarify newtype 2013-12-10 09:43:36 -05:00
Corey Richardson d9eff8de8a Clarify arity 2013-12-10 09:43:36 -05:00
Corey Richardson 2750adb5d8 Inherited mutabilty clarification
Also no longer reference mutable fields
2013-12-10 09:43:36 -05:00
Corey Richardson 381c08bf69 loop -> continue 2013-12-10 09:43:36 -05:00
Corey Richardson f006a10b1e Wildcard changes. 2013-12-10 09:43:35 -05:00
Corey Richardson 079ea00d23 Macro definition is feature gated. 2013-12-10 09:43:35 -05:00
Corey Richardson eb8739f4f8 Fix tiny formatting error. 2013-12-10 09:43:35 -05:00
Corey Richardson 0f82cbd19a Clarify as, mention transmute. 2013-12-10 09:43:35 -05:00
Corey Richardson d00a407e00 Clarify that strings aren't magical. 2013-12-10 09:43:35 -05:00
Corey Richardson b6cf5f5af1 Fix tiny formatting error. 2013-12-10 09:43:35 -05:00
Corey Richardson 94e0a03f5d Add rustdoc documentation. 2013-12-10 09:43:33 -05:00
bors 487e58cca2 auto merge of #10882 : jhasse/rust/patch-1, r=metajack
typo
2013-12-10 05:26:35 -08:00
Corey Richardson 039a5933fb Fix grammar error. 2013-12-10 07:28:24 -05:00
Corey Richardson d86f8b2fca Add a link to the wiki's package list and refer to git 2013-12-10 07:28:24 -05:00
Corey Richardson 8ae340a026 Note that Rust can be embedded. 2013-12-10 07:28:24 -05:00
Corey Richardson 61e8268645 Fix span. 2013-12-10 07:28:24 -05:00
Corey Richardson 8a8cccd4b6 Explain potentially confusing string example.
Reported be @ElBaha
2013-12-10 07:28:24 -05:00
bors 0d9c0c9771 auto merge of #10822 : ezyang/rust/master, r=huonw
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-10 03:16:37 -08:00
bors 3c399f613d auto merge of #10862 : alexcrichton/rust/issue-10857, r=huonw
This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes #10857
2013-12-10 00:41:36 -08:00
Alex Crichton 9522a08cf0 Check the privacy of implemented traits
This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes #10857
2013-12-09 22:53:58 -08:00
Edward Z. Yang b3e54d5991 Add some more commentary to FFI tutorial.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-09 21:24:47 -08:00
bors ad292ac8fd auto merge of #10873 : pradeep90/rust/rust-mode-changes, r=pcwalton
Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
2013-12-09 20:36:29 -08:00
bors 29ca4350c8 auto merge of #10812 : alexcrichton/rust/lto, r=pcwalton
The first commit was approved from another pull request, but I wanted to rebase LTO on top of it.

LTO is not turned on by default at all, and it's hidden behind a `-Z` flag. I have added a few small tests for it, however.
2013-12-09 16:11:28 -08:00
Alex Crichton 2d7b690b2e Register new snapshots
Makes the `dead_code` lint a citizen of stage0 to silence the "unknown lint"
warnings.
2013-12-09 15:04:03 -08:00
Alex Crichton fce4a174b9 Implement LTO
This commit implements LTO for rust leveraging LLVM's passes. What this means
is:

* When compiling an rlib, in addition to insdering foo.o into the archive, also
  insert foo.bc (the LLVM bytecode) of the optimized module.

* When the compiler detects the -Z lto option, it will attempt to perform LTO on
  a staticlib or binary output. The compiler will emit an error if a dylib or
  rlib output is being generated.

* The actual act of performing LTO is as follows:

    1. Force all upstream libraries to have an rlib version available.
    2. Load the bytecode of each upstream library from the rlib.
    3. Link all this bytecode into the current LLVM module (just using llvm
       apis)
    4. Run an internalization pass which internalizes all symbols except those
       found reachable for the local crate of compilation.
    5. Run the LLVM LTO pass manager over this entire module

    6a. If assembling an archive, then add all upstream rlibs into the output
        archive. This ignores all of the object/bitcode/metadata files rust
        generated and placed inside the rlibs.
    6b. If linking a binary, create copies of all upstream rlibs, remove the
        rust-generated object-file, and then link everything as usual.

As I have explained in #10741, this process is excruciatingly slow, so this is
*not* turned on by default, and it is also why I have decided to hide it behind
a -Z flag for now. The good news is that the binary sizes are about as small as
they can be as a result of LTO, so it's definitely working.

Closes #10741
Closes #10740
2013-12-09 14:41:49 -08:00
bors f817ed3e6f auto merge of #10823 : rapha/rust/master, r=alexcrichton
Hi, first pull request here so let me know if I've missed any of the procedure.
2013-12-09 13:51:32 -08:00
Raphael Speyer 7168d715a5 Implement PortReader and ChanWriter 2013-12-10 04:20:39 +11:00
Jan Niklas Hasse 6de5b7ab1e Add missing .com 2013-12-09 17:40:10 +01:00
Alex Crichton 52b835c5e7 Store metadata separately in rlib files
Right now whenever an rlib file is linked against, all of the metadata from the
rlib is pulled in to the final staticlib or binary. The reason for this is that
the metadata is currently stored in a section of the object file. Note that this
is intentional for dynamic libraries in order to distribute metadata bundled
with static libraries.

This commit alters the situation for rlib libraries to instead store the
metadata in a separate file in the archive. In doing so, when the archive is
passed to the linker, none of the metadata will get pulled into the result
executable. Furthermore, the metadata file is skipped when assembling rlibs into
an archive.

The snag in this implementation comes with multiple output formats. When
generating a dylib, the metadata needs to be in the object file, but when
generating an rlib this needs to be separate. In order to accomplish this, the
metadata variable is inserted into an entirely separate LLVM Module which is
then codegen'd into a different location (foo.metadata.o). This is then linked
into dynamic libraries and silently ignored for rlib files.

While changing how metadata is inserted into archives, I have also stopped
compressing metadata when inserted into rlib files. We have wanted to stop
compressing metadata, but the sections it creates in object file sections are
apparently too large. Thankfully if it's just an arbitrary file it doesn't
matter how large it is.

I have seen massive reductions in executable sizes, as well as staticlib output
sizes (to confirm that this is all working).
2013-12-09 08:25:58 -08:00
bors b485e2b65d auto merge of #10881 : sanxiyn/rust/allocation-lint-2, r=alexcrichton 2013-12-09 08:21:32 -08:00
Seo Sanghyeon 3b14f25868 Extend allocation lint for boxing expressions 2013-12-10 01:17:32 +09:00
bors 4e0cb316fc auto merge of #10840 : cmr/rust/any_docs2, r=huonw 2013-12-09 05:51:29 -08:00
Corey Richardson 4051713625 Add some Any docs. 2013-12-09 07:23:14 -05:00
bors a417dbd1c7 auto merge of #10859 : huonw/rust/helper-dists, r=cmr
This moves `std::rand::distribitions::{Normal, StandardNormal}` to `...::distributions::normal`, reexporting `Normal` from `distributions` (and similarly for `Exp` and Exp1`), and adds:
- Log-normal
- Chi-squared
- F
- Student T

all of which are implemented in C++11's random library. Tests in https://github.com/huonw/random-tests/commit/0424b8aded5e608ae386c1f917934a726d9cac6a. Note that these are approximately half documentation & half implementation (of which a significant portion is boilerplate `}`'s and so on).
2013-12-09 03:41:27 -08:00
bors e5f2021202 auto merge of #10874 : vadimcn/rust/integrated-as, r=alexcrichton
Last LLVM update seems to have fixed whatever prevented LLVM integrated assembler from generating correct unwind tables on Windows.   This PR switches Windows builds to use internal assembler by default.
Compilation via external assembler can still be requested via the newly added `-Z no-integrated-as` option.

Closes #8809
2013-12-09 01:01:43 -08:00
bors 09db61fb4f auto merge of #10867 : sfackler/rust/unsugared-doc, r=huonw
Closes #10853
2013-12-08 22:06:25 -08:00
S Pradeep Kumar 04d852aeb1 Add defun motions for rust-mode.
Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
2013-12-09 14:36:56 +09:00