summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2013-12-10Macro definition is feature gated.Corey Richardson-1/+3
2013-12-10Fix tiny formatting error.Corey Richardson-1/+1
2013-12-10Clarify `as`, mention transmute.Corey Richardson-6/+10
2013-12-10Clarify that strings aren't magical.Corey Richardson-1/+2
2013-12-10Fix tiny formatting error.Corey Richardson-1/+1
2013-12-10Add rustdoc documentation.Corey Richardson-3/+84
2013-12-10auto merge of #10882 : jhasse/rust/patch-1, r=metajackbors-1/+1
typo
2013-12-10Fix grammar error.Corey Richardson-1/+2
2013-12-10Add a link to the wiki's package list and refer to gitCorey Richardson-4/+12
2013-12-10Note that Rust can be embedded.Corey Richardson-1/+1
2013-12-10Fix span.Corey Richardson-1/+1
2013-12-10Explain potentially confusing string example.Corey Richardson-4/+5
Reported be @ElBaha
2013-12-10auto merge of #10822 : ezyang/rust/master, r=huonwbors-9/+26
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-10auto merge of #10862 : alexcrichton/rust/issue-10857, r=huonwbors-35/+63
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-09Check the privacy of implemented traitsAlex Crichton-35/+63
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-09Add some more commentary to FFI tutorial.Edward Z. Yang-9/+26
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-09auto merge of #10873 : pradeep90/rust/rust-mode-changes, r=pcwaltonbors-25/+269
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-10Vim keyword highlighting improvements.Chris Morgan-5/+7
- Removed the `log` keyword; - Removed keyword duplicates; - Highlighted `const` as `Error` rather than `StorageClass`; and - Highlighted all the reserved keywords as `Error` rather than as `Keyword`. (As usual, these highlightings can be overridden if desired.)
2013-12-10Fix up float highlighting in Vim.Chris Morgan-5/+6
This fixes a regression introduced in #10793. Having a colorscheme which highlights Float the same as Number (I believe most do), I hadn't noticed that having the special case of "5." floats (which was one of the added features in #10793) last made it take precedence, and so it was left to @thestinger to notice it. The regression meant that in `5.0`, the `5.` was a `rustFloat` (linked by default to `Float`) and the `0` was a `rustDecNumber` (linked by default to `Number`), and for `5.0f32` the `5.` was a `rustFloat` and the `0f32` was a second `rustFloat` (and thus appeared correctly, though for the wrong reason).
2013-12-09auto merge of #10812 : alexcrichton/rust/lto, r=pcwaltonbors-152/+538
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-09Register new snapshotsAlex Crichton-0/+8
Makes the `dead_code` lint a citizen of stage0 to silence the "unknown lint" warnings.
2013-12-09Implement LTOAlex Crichton-124/+432
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-09auto merge of #10823 : rapha/rust/master, r=alexcrichtonbors-11/+172
Hi, first pull request here so let me know if I've missed any of the procedure.
2013-12-09Make main pub in test case (cc #9629)Niko Matsakis-1/+1
2013-12-09Address nits for PR for #9629Niko Matsakis-2/+2
2013-12-10Implement PortReader and ChanWriterRaphael Speyer-11/+172
2013-12-09Add missing .comJan Niklas Hasse-1/+1
2013-12-09Store metadata separately in rlib filesAlex Crichton-78/+156
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-09auto merge of #10881 : sanxiyn/rust/allocation-lint-2, r=alexcrichtonbors-23/+62
2013-12-10Extend allocation lint for boxing expressionsSeo Sanghyeon-23/+62
2013-12-09auto merge of #10840 : cmr/rust/any_docs2, r=huonwbors-1/+8
2013-12-09Add some Any docs.Corey Richardson-1/+8
2013-12-09auto merge of #10859 : huonw/rust/helper-dists, r=cmrbors-246/+568
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-09auto merge of #10874 : vadimcn/rust/integrated-as, r=alexcrichtonbors-8/+9
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-08auto merge of #10867 : sfackler/rust/unsugared-doc, r=huonwbors-1/+29
Closes #10853
2013-12-09Add defun motions for rust-mode.S Pradeep Kumar-25/+269
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-08Disable failing test.Vadim Chugunov-0/+1
2013-12-08Use LLVM integrated assembler on Windows too.Vadim Chugunov-8/+8
2013-12-08Accept unsugared docs in missing-doc lintSteven Fackler-1/+29
Closes #10853
2013-12-08auto merge of #10866 : ktt3ja/rust/edit-doc, r=huonwbors-3/+8
A comment that I previously added to ast::DefStruct is incorrect. Here's the modification.
2013-12-08Fix comment on ast::DefStructKiet Tran-3/+8
2013-12-08auto merge of #10813 : dwrensha/rust/xcrate-lifetime-param, r=huonwbors-0/+41
Before applying this patch, the included testcase fails with: ``` src/test/run-pass/xcrate-trait-lifetime-param.rs:20:10: 20:28 error: wrong number of lifetime parameters: expected 0 but found 1 src/test/run-pass/xcrate-trait-lifetime-param.rs:20 impl <'a> other::FromBuf<'a> for Reader<'a> { ^~~~~~~~~~~~~~~~~~ ``` There's another example in my comments to #10506.
2013-12-08encode trait lifetime params in metadata to allow cross-crate usageDavid Renshaw-0/+41
2013-12-08auto merge of #10477 : ktt3ja/rust/dead-code, r=alexcrichtonbors-1183/+722
PR for issue #1749 mainly to get some feedback and suggestion. This adds a pass that warns if a function, struct, enum, or static item is never used. For the following code, ```rust pub static pub_static: int = 0; static priv_static: int = 0; static used_static: int = 0; pub fn pub_fn() { used_fn(); } fn priv_fn() { let unused_struct = PrivStruct; } fn used_fn() {} pub struct PubStruct(); struct PrivStruct(); struct UsedStruct1 { x: int } struct UsedStruct2(int); struct UsedStruct3(); pub enum pub_enum { foo1, bar1 } enum priv_enum { foo2, bar2 } enum used_enum { foo3, bar3 } fn foo() { bar(); let unused_enum = foo2; } fn bar() { foo(); } fn main() { let used_struct1 = UsedStruct1 { x: 1 }; let used_struct2 = UsedStruct2(1); let used_struct3 = UsedStruct3; let t = used_static; let e = foo3; } ``` it would add the following warnings: ```rust /home/ktt3ja/test.rs:2:0: 2:28 warning: code is never used: `priv_static`, #[warn(dead_code)] on by default /home/ktt3ja/test.rs:2 static priv_static: int = 0; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ktt3ja/test.rs:6:0: 6:48 warning: code is never used: `priv_fn`, #[warn(dead_code)] on by default /home/ktt3ja/test.rs:6 fn priv_fn() { let unused_struct = PrivStruct; } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ktt3ja/test.rs:10:0: 10:20 warning: code is never used: `PrivStruct`, #[warn(dead_code)] on by default /home/ktt3ja/test.rs:10 struct PrivStruct(); ^~~~~~~~~~~~~~~~~~~~ /home/ktt3ja/test.rs:16:0: 16:29 warning: code is never used: `priv_enum`, #[warn(dead_code)] on by default /home/ktt3ja/test.rs:16 enum priv_enum { foo2, bar2 } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ktt3ja/test.rs:19:0: 22:1 warning: code is never used: `foo`, #[warn(dead_code)] on by default /home/ktt3ja/test.rs:19 fn foo() { /home/ktt3ja/test.rs:20 bar(); /home/ktt3ja/test.rs:21 let unused_enum = foo2; /home/ktt3ja/test.rs:22 } /home/ktt3ja/test.rs:24:0: 26:1 warning: code is never used: `bar`, #[warn(dead_code)] on by default /home/ktt3ja/test.rs:24 fn bar() { /home/ktt3ja/test.rs:25 foo(); /home/ktt3ja/test.rs:26 } ``` Furthermore, I would like to solicit some test cases since I haven't tested extensively and I'm still unclear about some of the things in here. For example, I'm not sure how reexports would affect this and just assumed that LiveContext (which is a copy of reachable::ReachableContext) does enough work to handle it. Also, the test case above doesn't include any impl or methods, etc.
2013-12-08auto merge of #10855 : alexcrichton/rust/snapshots, r=pcwaltonbors-76/+12
This transitions the snapshot dependency process to understand that our snapshots are now a single static binary rather than an array of files.
2013-12-08std::rand: implement the student t distribution.Huon Wilson-1/+52
2013-12-08std::rand: implement the F distribution.Huon Wilson-1/+60
2013-12-08std::rand: implement the chi-squared distribution.Huon Wilson-2/+99
2013-12-08Remove dead codesKiet Tran-1130/+150
2013-12-08Add dead-code warning passKiet Tran-53/+572