Commit Graph

18431 Commits

Author SHA1 Message Date
bors
1d3e84c5d6 auto merge of #6669 : yjh0502/rust/fix_6209, r=graydon
Fix issue #6209, and some related issues about constant expression
 - unmatched type between arms
 - unmatched type in range
2013-05-22 18:01:36 -07:00
bors
f517ed0b08 auto merge of #6686 : cmr/rust/fix-6596, r=catamorphism
The error message is extremely unideal.
2013-05-22 16:22:35 -07:00
Corey Richardson
5118d2f84a Add test 2013-05-22 19:19:00 -04:00
Corey Richardson
7ccc97e5b4 Fix ICE in macros 2013-05-22 19:18:50 -04:00
Graydon Hoare
ee1b419818 revert no-longer-required workaround for mystery bug, close #3396 2013-05-22 15:35:25 -07:00
bors
b17b3f9576 auto merge of #6483 : catamorphism/rust/issue-4107, r=catamorphism 2013-05-22 14:43:39 -07:00
Tim Chevalier
1aae163d44 testsuite: Make main fn public 2013-05-22 14:13:42 -07:00
Tim Chevalier
fd94bd984e testsuite: Add passing test for #4107 2013-05-22 14:13:22 -07:00
bors
4bbbae625d auto merge of #6672 : yjh0502/rust/fix_6342, r=graydon
Fix #6342
2013-05-22 11:43:35 -07:00
bors
3d82a0a0a7 auto merge of #6670 : cmr/rust/static_assert, r=graydon
This verifies that a static item evaluates to true, at compile time.
2013-05-22 10:16:33 -07:00
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