Commit Graph

20278 Commits

Author SHA1 Message Date
blake2-ppc
ff9b75f26d Fix warnings in libstd and librusti tests 2013-07-18 02:18:56 +02:00
blake2-ppc
e93dd34cd3 Fix warnings in libextra tests
Most of these are "unneccesary allocation" in bitv, for ~[false, ..] instead
of [false, ..].
2013-07-18 02:18:53 +02:00
Tim Chevalier
0ce9135d71 testsuite: Test for #6153, closes #6153 2013-07-17 16:58:43 -07:00
Daniel Micay
0c7b220f20 fix repr of unique vectors with stage0 libstd
Closes #7860
2013-07-17 19:09:18 -04:00
Tim Chevalier
2fbd9f0cb2 testsuite: Add compile-fail test for #5883 2013-07-17 15:32:02 -07:00
Patrick Walton
3d13d4b58d libextra: Add a stray deriving or two. 2013-07-17 15:15:34 -07:00
Patrick Walton
3f8d548914 librustc: Remove some extra "copy" keywords that came in before this change merged. 2013-07-17 14:58:12 -07:00
Patrick Walton
66a9b7d5bd libsyntax: Remove some multi-gigabyte clones that were preventing bootstrapping on Windows. 2013-07-17 14:57:56 -07:00
Patrick Walton
dc4bf173f8 test: Fix tests. 2013-07-17 14:57:55 -07:00
Patrick Walton
88fe4ae09c librustc: Remove the Copy bound from the language. 2013-07-17 14:57:54 -07:00
Patrick Walton
d57e8f8419 librustc: Change repeated vector expressions to use implicit copyability. 2013-07-17 14:57:54 -07:00
Patrick Walton
2dbb3c3887 test: Fix tests. 2013-07-17 14:57:54 -07:00
Patrick Walton
e20549ff19 librustc: Remove all uses of the Copy bound. 2013-07-17 14:57:53 -07:00
Patrick Walton
99d44d24c7 librustc: Remove copy expressions from the language. 2013-07-17 14:57:52 -07:00
Patrick Walton
99b33f7219 librustc: Remove all uses of "copy". 2013-07-17 14:57:51 -07:00
Patrick Walton
b4e674f6e6 librustc: Add a lint mode for unnecessary copy and remove a bunch of them. 2013-07-17 14:56:42 -07:00
Keegan McAllister
2d82d9364c rt: Print alloc backtraces for bad release_alloc with RUSTRT_TRACK_ALLOCATIONS
Probably the env var should be renamed from DETAILED_LEAKS but I'm leaving
aside that breaking change for now.
2013-07-17 14:04:03 -07:00
Keegan McAllister
dfa5595628 rt: Diagnose bad alloc index in release_alloc with RUSTRT_TRACK_ALLOCATIONS 2013-07-17 14:03:59 -07:00
bors
8c082658be auto merge of #7829 : graydon/rust/codegen-compiletests, r=cmr
This should get us over the hump of activating basic ratcheting on codegen tests, at least. It also puts in place optional (disabled by default) ratcheting on all #[bench] tests, and records all metrics from them to harvestable .json files in any case.
2013-07-17 13:07:24 -07:00
Graydon Hoare
6d78a367b1 extra: avoid possible divide-by-zero conditions test. 2013-07-17 12:28:48 -07:00
Graydon Hoare
4bf6b84a4d make: turn off --bench when running under valgrind 2013-07-17 11:52:21 -07:00
bors
060de1016b auto merge of #7844 : huonw/rust/no-implicit-prelude, r=alexcrichton
It disables the insertion of `use std::prelude::*;` into the top of
all the modules below the item on which it is placed (including that
item itself).

(Similar to GHC's `-XNoImplicitPrelude`.)
2013-07-17 11:28:46 -07:00
Daniel Micay
0bc204e74d rm unnecessary stage0 zero_memory fn 2013-07-17 14:08:54 -04:00
Brian Anderson
b17141370f std::rt: Rename RUST_TEST_THREADS to RUST_RT_TEST_THREADS 2013-07-17 10:47:05 -07:00
Daniel Micay
0239a06a64 rm unused visit_str method from TyVisitor 2013-07-17 13:30:32 -04:00
Daniel Micay
8d561587b2 stop initializing ref_count for stack closures
the only part of the header ~fn and &fn should be touching right now is
the tydesc
2013-07-17 13:30:32 -04:00
bors
9c1e530bde auto merge of #7826 : michaelwoerister/rust/end_of_spanned, r=cmr
This is the first of a series of refactorings to get rid of the `codemap::spanned<T>` struct (see this thread for more information: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004798.html).

The changes in this PR should not change any semantics, just rename `ast::blk_` to `ast::blk` and add a span field to it. 95% of the changes were of the form `block.node.id` -> `block.id`. Only some transformations in `libsyntax::fold` where not entirely trivial.
2013-07-17 09:49:43 -07:00
Alex Crichton
8885b740f6 Add documentation about mutable statics to rust.md 2013-07-17 08:57:08 -07:00
Björn Steinbrink
15ea4a8dd8 Generate better code for intrinsics
Currently, our intrinsics are generated as functions that have the
usual setup, which means an alloca, and therefore also a jump, for
those intrinsics that return an immediate value. This is especially bad
for unoptimized builds because it means that an intrinsic like
"contains_managed" that should be just "ret 0" or "ret 1" actually ends
up allocating stack space, doing a jump and a store/load sequence
before it finally returns the value.

To fix that, we need a way to stop the generic function declaration
mechanism from allocating stack space for the return value. This
implicitly also kills the jump, because the block for static allocas
isn't required anymore.

Additionally, trans_intrinsic needs to build the return itself instead
of calling finish_fn, because the latter relies on the availability of
the return value pointer.

With these changes, we get the bare minimum code required for our
intrinsics, which makes them small enough that inlining them makes the
resulting code smaller, so we can mark them as "always inline" to get
better performing unoptimized builds.

Optimized builds also benefit slightly from this change as there's less
code for LLVM to translate and the smaller intrinsics help it to make
better inlining decisions for a few code paths.

Building stage2 librustc gets ~1% faster for the optimized version and 5% for
the unoptimized version.
2013-07-17 17:21:41 +02:00
Björn Steinbrink
3e572511af Remove duplicated code from trans_intrinsics
Most arms of the huge match contain the same code, differing only in
small details like the name of the llvm intrinsic that is to be called.
Thus the duplicated code can be factored out into a few functions that
take some parameters to handle the differences.
2013-07-17 17:18:29 +02:00
Niko Matsakis
782853c658 Issue #7444 - Update neg test and pos test for move by capture 2013-07-17 09:02:52 -04:00
bors
93c270c63d auto merge of #7843 : alexcrichton/rust/better-lint-help, r=huonw
Closes #7818
2013-07-17 05:55:42 -07:00
Niko Matsakis
81c576cd5b Issue #7444 - Borrowck permits moved values to be captured 2013-07-17 07:19:43 -04:00
bors
9da42dce27 auto merge of #7835 : omasanori/rust/l10n-improvement, r=pnkfelix
Adding options for `po4a` in `mk/docs.mk` and updating .pots.
2013-07-17 04:16:42 -07:00
bors
c032dddf6f auto merge of #7841 : alexcrichton/rust/tls++, r=huonw
Simulates borrow checks for '@mut' boxes, or at least it's the same idea. This allows you to store owned values, but mutate them while they're owned by TLS.

This should remove the necessity for a `pop`/`set` pattern to mutate data structures in TLS.
2013-07-17 02:37:43 -07:00
Alex Crichton
a468869e2a Remove --quiet from git submodule operations 2013-07-17 01:50:22 -07:00
bors
a93244dbf6 auto merge of #7839 : graydon/rust/new-codegen-tests, r=pcwalton
Add some codegen tests. Nothing too surprising.
2013-07-17 00:52:48 -07:00
gifnksm
827a6d26e6 tutorial: remove unused link references. 2013-07-17 15:38:26 +09:00
Michael Woerister
0cc70743d2 Made ast::blk not use spanned<T> anymore. 2013-07-17 08:21:46 +02:00
bors
af54f633fd auto merge of #7828 : alexcrichton/rust/lang-opt, r=graydon
Whenever a lang_item is required, some relevant message is displayed, often with
a span of what triggered the usage of the lang item.

Now "hello word" is as small as:

```rust
#[no_std];

extern {
    fn puts(s: *u8);
}

extern "rust-intrinsic" {
    fn transmute<T, U>(t: T) -> U;
}

#[start]
fn main(_: int, _: **u8, _: *u8) -> int {
    unsafe {
        let (ptr, _): (*u8, uint) = transmute("Hello!");
        puts(ptr);
    }
    return 0;
}
```
2013-07-16 23:10:44 -07:00
Huon Wilson
040e470f47 rustc: implement a #[no_implicit_prelude] attribute.
It disables the insertion of `use std::prelude::*;` into the top of
all the modules below the item on which it is placed (including that
item itself).
2013-07-17 15:01:02 +10:00
Alex Crichton
88a1b71305 Make all lang_items optional
Whenever a lang_item is required, some relevant message is displayed, often with
a span of what triggered the usage of the lang item
2013-07-16 21:37:52 -07:00
bors
4bd716ac8e auto merge of #7831 : ozten/rust/issues-7764-swap_unwarp-take-unwrap, r=pcwalton
Fixes Issue #7764

Running `make check` I do get a failure:

    test rt::io::extensions::test::push_bytes ... ok
    rustest rt::comm::test::oneshot_single_thread_send_port_close ... t: task failed at 'Unhandled condition:
     read_error: {kind: OtherIoError, desc: "Placeholder error. You shouldn\'t be seeing this", detail: None}',
     /Users/shout/Projects/rust/src/libstd/condition.rs:50
    /bin/sh: line 1: 35056 Abort trap: 6           x86_64-apple-darwin/stage2/test/stdtest-x86_64-apple-darwin --logfile
     tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.log
    make: *** [tmp/check-stage2-T-x86_64-apple-darwin-H-x86_64-apple-darwin-std.ok] Error 134
2013-07-16 21:31:48 -07:00
gifnksm
5d4b990fc6 tutorial: remove duplicate link references.
`pandoc` issues warnings.

```
pandoc: Duplicate link reference `[macros]' "source" (line 2151, column 1)
pandoc: Duplicate link reference `[tasks]' "source" (line 2150, column 1)
pandoc: Duplicate link reference `[wiki-start]' "source" (line 92, column 1)
```
2013-07-17 13:29:10 +09:00
Alex Crichton
0fd4d5d778 Sort lint attributes to print them in a more sane way
Closes #7818
2013-07-16 21:28:10 -07:00
Alex Crichton
948a62401e Add a get_mut method for TLS
Simulates borrow checks for '@mut' boxes, or at least it's the same idea.
2013-07-16 20:33:04 -07:00
Alex Crichton
d5f53c780e Provide more useful messages when tests are given -h or --help
Progress on #7824
2013-07-16 20:08:01 -07:00
Graydon Hoare
40f74341f3 test: new codegen tests, rename hello. 2013-07-16 17:44:57 -07:00
bors
8a1002fbd9 auto merge of #7827 : jdm/rust/enumlength, r=graydon
Allowing them in type signatures is a significant amount of extra work, unfortunately. This also doesn't apply to static values, which takes a different code path.
2013-07-16 16:19:37 -07:00
OGINO Masanori
ad3a69739f Add project information to l10n templates. 2013-07-17 07:48:30 +09:00