Commit Graph

18671 Commits

Author SHA1 Message Date
Corey Richardson
acf920fe4b Add static_assert doc blurb 2013-05-22 13:13:29 -04:00
Corey Richardson
e64339645b Implement static_assert attribute
This verifies that a static item evaluates to true, at compile time.
2013-05-22 13:13:24 -04:00
Benjamin Herr
5a42481366 declare that "///" is still a doc comment, just not "////+" (fixes #5838) 2013-05-22 15:53:26 +02:00
Jihyun Yu
06685bacf8 add smallintset 2013-05-22 21:01:21 +09:00
bors
b6a0d40c1d auto merge of #6671 : kud1ing/rust/patch-1, r=z0w0 2013-05-22 04:16:26 -07:00
Jihyun Yu
6c33f5044b Fix #6342 2013-05-22 16:11:48 +09:00
kud1ing
da94580ddc "Type :help for help", similar to ghci 2013-05-22 10:03:51 +03:00
bors
8a4bffc7ee auto merge of #6667 : crabtw/rust/arm-rt, r=brson
This fixes segmentation fault of new rt tests.
For example
```
use core::rt::test::*;
use core::rt::comm::*;
use core::cell::Cell;

fn main() {
    do run_in_newsched_task {
        let (port, chan) = oneshot::<~int>();
        let port_cell = Cell(port);
        do spawntask_immediately {
            assert!(port_cell.take().recv() == ~10);
        }
        chan.send(~10);
    }
}
```
2013-05-21 23:25:17 -07:00
Jihyun Yu
f8af2b50ee fix issue #6209 2013-05-22 14:06:25 +09:00
Jyun-Yan You
499b02213d fix arm stack alignment 2013-05-22 08:49:16 +08:00
bors
15e44381af auto merge of #6665 : catamorphism/rust/issue-5741, r=nikomatsakis
r? @nikomatsakis The way we deal with unreachable expressions in trans is pretty ad hoc,
but this at least doesn't make it worse, and eliminates the LLVM
assertion failure reported in #5741.
2013-05-21 16:13:15 -07:00
bors
799f281b43 auto merge of #6664 : catamorphism/rust/issue-3796, r=catamorphism 2013-05-21 15:07:24 -07:00
bors
02c59bcc02 auto merge of #6662 : catamorphism/rust/issue-4780, r=catamorphism 2013-05-21 14:04:27 -07:00
Tim Chevalier
8c68c4a52c rustc: Don't generate code for unreachable expressions
The way we deal with unreachable expressions in trans is pretty ad hoc,
but this at least doesn't make it worse, and eliminates the LLVM
assertion failure reported in #5741.
2013-05-21 13:15:48 -07:00
Tim Chevalier
1df8a543f1 testsuite: Add xfailed test cases 2013-05-21 13:12:31 -07:00
Tim Chevalier
1fadb97b68 testsuite: Update test for #2478. Still xfailed 2013-05-21 12:58:27 -07:00
Tim Chevalier
b6cf84f3e0 testsuite: Test for #4780 2013-05-21 12:55:54 -07:00
bors
0252c30443 auto merge of #6658 : sanxiyn/rust/static-string-2, r=thestinger 2013-05-21 12:49:33 -07:00
bors
73597a5bd5 auto merge of #6657 : sanxiyn/rust/allocation, r=thestinger 2013-05-21 11:40:41 -07:00
Seo Sanghyeon
743e4b044c Use static strings 2013-05-22 02:48:56 +09:00
bors
64963d6cba auto merge of #6611 : huonw/rust/syntax-ext-no-dup, r=jbclements
Fixes https://github.com/mozilla/rust/issues/6578 by merging the 3 different ways to build an AST into a single `AstBuilder` trait, creating a more uniform and briefer interface.

Also, converts the `ext_ctxt` trait-object to be a plain struct, as well as renaming it to `ExtCtxt`.

Seems to make expansion slightly faster for the normal case (e.g. `libcore` and `libstd`), but slower for `librustc` (slightly) and `libsyntax` (0.3s -> 0.8s! I'm investigating this, but I'd prefer this patch to land relatively quickly.).

`git blame` suggests maybe @graydon or @erickt are familiar with this area of the code. r?
2013-05-21 10:43:17 -07:00
Seo Sanghyeon
6b525ecbda Take string slices 2013-05-22 02:32:29 +09:00
Huon Wilson
a59bec43e3 syntax/ext: convert all AstBuilder methods to a uniform syntax. 2013-05-22 00:30:52 +10:00
Huon Wilson
6e50515530 syntax/ext: migrate build.rs functions to AstBuilder methods. 2013-05-22 00:15:36 +10:00
Seo Sanghyeon
70222b7e86 Remove unnecessary allocations flagged by lint from fuzzer 2013-05-21 23:05:45 +09:00
Huon Wilson
8c15a0ec4c syntax/ext: collect the ast building traits into a single trait. 2013-05-22 00:04:10 +10:00
Huon Wilson
4045da9f4f syntax/ext: modernise ext_ctxt to be CamelCase and use new. 2013-05-22 00:04:10 +10:00
Huon Wilson
eea265ea16 syntax/ext: Remove the trait-object indirection of the ext_ctxt object. 2013-05-22 00:02:37 +10:00
Seo Sanghyeon
d4724c1a17 Remove unnecessary allocations flagged by lint from rustpkg 2013-05-21 23:00:34 +09:00
Seo Sanghyeon
d543354d6c Remove unnecessary allocations flagged by lint from rustdoc 2013-05-21 22:55:07 +09:00
Huon Wilson
8e9eba8013 syntax/ext: remove the ~str dependence of the deriving code. 2013-05-21 23:33:58 +10:00
bors
808aada1fb auto merge of #6654 : sanxiyn/rust/accurate-span-2, r=bstrie 2013-05-21 05:37:17 -07:00
Seo Sanghyeon
258d20ea84 Correct span for unused_import 2013-05-21 19:09:22 +09:00
Seo Sanghyeon
9390cdaa8b Correct span for expr_vec 2013-05-21 19:08:34 +09:00
bors
dc7b83d186 auto merge of #6650 : crabtw/rust/mips-rt, r=sanxiyn
Results of libcore and libstd tests

```
failures:
    rand::tests::test_rng_seeded_custom_seed2
    time::tests::run_tests
    uv_ll::test::test_uv_ll_struct_size_addrinfo
    uv_ll::test::test_uv_ll_struct_size_uv_timer_t

segfaults:
    stackwalk::test_simple
    stackwalk::test_simple_deep
```
2013-05-21 03:01:17 -07:00
bors
329d8e2622 auto merge of #6648 : alexcrichton/rust/issue-6633, r=graydon
Resolves #6633 and removes an unnecessary import in libcore
2013-05-21 01:04:16 -07:00
bors
5a3e320514 auto merge of #6647 : alexcrichton/rust/unnecessary-alloc, r=graydon
This adds a lint mode for detecting unnecessary allocations on the heap. This isn't super fancy, currently it only has two rules

1. For a function's arguments, if you allocate a `[~|@]str` literal, when the type of the argument is a `&str`, emit a warning.
2. For the same case, emit warnings for boxed vectors when slices are required.

After adding the lint, I rampaged through the libraries and removed all the unnecessary allocations I could find.
2013-05-20 23:55:20 -07:00
bors
d49a9dbc7f auto merge of #6646 : dotdash/rust/method_lookup, r=brson 2013-05-20 22:52:22 -07:00
bors
7abcc142e5 auto merge of #6626 : brson/rust/io-upstream, r=graydon
r?

Mostly refactoring, and adding some of the remaining types described in #4419.

The [`Local`](3b4ff41511/src/libcore/rt/local.rs (L17)) trait collects some common, often unsafe patterns around task-local and thread-local values. Making all these types safe is largely the aim of #6210.
2013-05-20 21:40:27 -07:00
Jyun-Yan You
d86a32bbb2 fix mips stack alignment 2013-05-21 11:58:30 +08:00
bors
adaae45c3e auto merge of #6604 : bjz/rust/ptr-to-option, r=brson 2013-05-20 20:31:26 -07:00
bors
6c0a4693c9 auto merge of #6649 : brson/rust/atomic-load-align, r=graydon 2013-05-20 19:25:29 -07:00
bors
32e30aaa00 auto merge of #6576 : nikomatsakis/rust/issue-5362-tuple-indices, r=graydon
r? @pcwalton
2013-05-20 18:04:39 -07:00
Brian Anderson
474d9983be rustllvm: Use target alignment for atomic load/store 2013-05-20 17:28:06 -07:00
bors
24609675eb auto merge of #6528 : brson/rust/docs, r=brson
Remove the uncommon term 'object tree' in favor of 'value'.
2013-05-20 16:55:36 -07:00
bors
6d4845668f auto merge of #6372 : brson/rust/intrinsics, r=catamorphism
...s
2013-05-20 15:49:45 -07:00
Brian Anderson
a246e8faf3 core::rt: Convert unsafe_borrow_io to a Local impl 2013-05-20 15:21:29 -07:00
Brian Anderson
2042696236 core::rt: Implement Local for Task 2013-05-20 15:21:29 -07:00
Brian Anderson
2f99fb8efa core::rt: Remove local_sched module 2013-05-20 15:21:29 -07:00
Brian Anderson
06f1a64bd6 core::rt: Convert users of local_sched to Local trait 2013-05-20 15:21:09 -07:00