Commit Graph

14851 Commits

Author SHA1 Message Date
Marvin Löbel
df66e8d4a1 Fix underflow in char_range_at_reverse
Added char_range_at_reverse underflow test
2013-03-31 10:03:52 +02:00
bors
75d615d6f6 auto merge of #5637 : luqmana/rust/5423, r=brson
Fixes #5423.
2013-03-30 22:06:41 -07:00
bors
042a66514d auto merge of #5638 : luqmana/rust/5405, r=brson
#5405

Also, renames the confusingly named `use_new_rt` in `libcore/unstable/lang.rs`
2013-03-30 20:45:42 -07:00
Luqman Aden
74d20b46c5 Rename confusing var, use_new_rt -> use_old_rt. 2013-03-30 20:00:19 -07:00
Luqman Aden
eadd358b2a Correct type signature for start lang item. 2013-03-30 19:59:21 -07:00
Luqman Aden
02700e0e8d libsyntax: Update abi constants. Fixes #5423. 2013-03-30 19:28:50 -07:00
Daniel Micay
258a36738e move dlist from core -> std
Closes #3549
2013-03-30 21:06:26 -04:00
bors
8e30d3fc0b auto merge of #5636 : thestinger/rust/vim, r=luqmana 2013-03-30 16:33:41 -07:00
bors
6dd20c8186 auto merge of #5630 : erickt/rust/serial, r=erickt
@nikomatsakis and I were talking about how the serializers were a bit too complicated. None of the users of With the `emit_option` and `read_option` functions, the serializers are now moving more high level. This patch series continues that trend. I've removed support for emitting specific string and vec types, and added support for emitting mapping types.
2013-03-30 15:42:43 -07:00
Daniel Micay
47011e3b71 vim: use Operator group for 'as' 2013-03-30 18:19:47 -04:00
Daniel Micay
6442b1c0e7 vim: separate the conditional keywords 2013-03-30 18:17:13 -04:00
Daniel Micay
b0f66c4732 vim: mark Todo as contained and rm unsafe from it
It's nice to make unsafe stand out, but this way isn't correct because it
highlights it in comments.
2013-03-30 18:17:13 -04:00
Daniel Micay
7142cdef1e vim: highlight ref + static as storage specifiers
lifetimes and globals are now the only two places static is used, and
'static isn't matched by this
2013-03-30 18:16:53 -04:00
Erick Tryzelaar
810c4d8a1e rustc: fix astencode test 2013-03-30 15:04:24 -07:00
Daniel Micay
0224eb3d32 vim: assert and pure keywords were removed 2013-03-30 17:54:24 -04:00
Erick Tryzelaar
5b7d608bf6 std: add more json decoder tests. 2013-03-30 13:31:03 -07:00
Erick Tryzelaar
f364cf5463 syntax: fix auto_encode test. 2013-03-30 13:24:52 -07:00
Erick Tryzelaar
9bbf384058 std: clean up the json pretty printer tests 2013-03-30 11:08:57 -07:00
Niko Matsakis
6965fe4bce Add AbiSet and integrate it into the AST.
I believe this patch incorporates all expected syntax changes from extern
function reform (#3678). You can now write things like:

    extern "<abi>" fn foo(s: S) -> T { ... }
    extern "<abi>" mod { ... }
    extern "<abi>" fn(S) -> T

The ABI for foreign functions is taken from this syntax (rather than from an
annotation).  We support the full ABI specification I described on the mailing
list.  The correct ABI is chosen based on the target architecture.

Calls by pointer to C functions are not yet supported, and the Rust type of
crust fns is still *u8.
2013-03-29 18:36:20 -07:00
Erick Tryzelaar
909d8f0eac std: Add Deque::eachi and a Deque serializer support 2013-03-29 18:02:44 -07:00
Erick Tryzelaar
0de7635f53 Merge remote-tracking branch 'remotes/origin/incoming' into serial 2013-03-29 17:48:44 -07:00
Erick Tryzelaar
e5c7a9e342 std: add serialization support for dlist, linearset, triemap, trieset, treemap, and treeset 2013-03-29 17:44:28 -07:00
Erick Tryzelaar
529ae38605 Merge remote-tracking branch 'remotes/origin/incoming' into serial 2013-03-29 17:41:32 -07:00
Patrick Walton
1e91595520 librustc: Remove fail_unless! 2013-03-29 16:39:08 -07:00
Brian Anderson
518c295a03 Register snapshots 2013-03-29 11:30:42 -07:00
John Clements
f2e47cddf8 change to parsing using tts
also, updates test cases a bit
2013-03-29 10:53:00 -07:00
John Clements
556143c488 commenting parser 2013-03-29 10:53:00 -07:00
John Clements
2b07f0fb00 field renaming 2013-03-29 10:53:00 -07:00
Erick Tryzelaar
bdef3f1930 std: fix json deserializing vectors and a test 2013-03-29 09:10:31 -07:00
Erick Tryzelaar
31563f53d9 Merge remote-tracking branch 'remotes/origin/incoming' into serial 2013-03-29 09:06:36 -07:00
Erick Tryzelaar
d1a83e6986 std: add Encoder::emit_map and Decoder::read_map 2013-03-29 09:04:35 -07:00
Erick Tryzelaar
ed62f6dfe0 core: add consume_reverse 2013-03-29 09:04:26 -07:00
Erick Tryzelaar
90b3658cd6 std: remove Encoder::read_rec and Decoder::emit_rec 2013-03-29 07:05:54 -07:00
Erick Tryzelaar
e99cdcfba8 std: remove Encoder::emit_tup{,_elt} and Decoder::read_tup{,_elt} 2013-03-29 07:05:54 -07:00
Erick Tryzelaar
590bbcebe9 std: remove Encoder::emit_{owned,managed}_vec and Decoder::read_{owned,managed}_vec 2013-03-29 07:05:54 -07:00
Erick Tryzelaar
63fc88757f std: remove Encoder::emit_{owned,managed} and Decoder::read_{owned,managed} 2013-03-29 07:05:54 -07:00
Erick Tryzelaar
8b43c620b9 std: remove Encoder::emit_{owned,managed}_str and Decoder::read_{owned,managed}_str 2013-03-29 07:05:54 -07:00
Erick Tryzelaar
1dd11c7179 core: add LinearMap::with_capacity 2013-03-29 07:05:54 -07:00
Erick Tryzelaar
2c658fabed std: remove prettyprint
Everyone uses fmt!("%?", ...) instead of the prettyprint
module, so I'm removing this file.
2013-03-29 07:05:54 -07:00
bors
5da9e12778 auto merge of #5570 : alexcrichton/rust/fix-unused-imports, r=sanxiyn
Before it wouldn't warn about unused imports in the list if something in the list was used. These commits fix that case, add a test, and remove all unused imports in lists of imports throughout the compiler.
2013-03-29 05:57:44 -07:00
bors
7f2788112d auto merge of #5622 : yichoi/rust/pull-0329, r=catamorphism
libcore: language change minor fix for ARM & MIPS

fix context.rs
2013-03-29 04:42:43 -07:00
bors
848ffe2dac auto merge of #5620 : catamorphism/rust/issue-4325, r=catamorphism 2013-03-29 03:42:46 -07:00
bors
318d926854 auto merge of #5619 : catamorphism/rust/issue-4333, r=catamorphism 2013-03-29 02:45:46 -07:00
bors
4e830d11ba auto merge of #5618 : pcwalton/rust/print-in-prelude, r=brson
r? @brson
2013-03-29 01:09:49 -07:00
bors
16445c5418 auto merge of #5617 : catamorphism/rust/issue-4335, r=catamorphism 2013-03-29 00:03:48 -07:00
Young-il Choi
e6f2d7a48c libcore: language change minor fix for ARM & MIPS 2013-03-29 15:46:13 +09:00
bors
a985bc52cd auto merge of #5616 : pcwalton/rust/parenthesized-trait, r=brson
r? @brson
2013-03-28 23:00:50 -07:00
bors
f7a2371c17 auto merge of #5614 : graydon/rust/static-linkage-bug, r=catamorphism
re bug that @nikomatsakis was hitting: when you define a `static` (old: `const`) containing a `&` or `&[]` expression, it will create temporaries (the underlying pointee) by creating a throwaway symbol for each temporary, each with _global_ linkage, and each named `"const"`. LLVM will helpfully rename multiple copies of this throwaway symbol to `"const1"` and `"const2"` and so forth in the _same_ library. But if you have _2 libraries_ -- say, libcore and librustc -- that both do this, the dynamic linker (at least on linux) will happily do horrible things like make the slice in one library point to the bytes of the vector from the other library. This is obviously a recipe for much hilarity and head-scratching.

The solution is to change the linkage to something else, internal or (in the case of this patch) _private_.

It will require a snapshot to integrate this into stage0 and thereby fix the problem / unblock patches that were hitting this in stage1.
2013-03-28 21:48:49 -07:00
Alex Crichton
be57d745d2 Removing unused imports 2013-03-28 23:56:46 -04:00
Alex Crichton
cc83049a56 Fix warning about unused imports in import lists
Before, if anything in a list was used, the entire list was considered to be
used. This corrects this and also warns on a span of the actual unused import
instead of the entire list.
2013-03-28 23:56:45 -04:00
Erick Tryzelaar
b05e148dc9 std: change Decoder::read_option to return a generic type
This allows read_option to be used with a custom option type instead
of just core::Option.
2013-03-28 20:34:33 -07:00
Erick Tryzelaar
bdf81e1184 core: Inline mallocing wrapper functions
As far as I can tell, this doesn't make rust compile any
faster, but it does at least remove one level of indirection
on malloc, which might help speed up some operations.
2013-03-28 20:34:33 -07:00
Tim Chevalier
ae7e072af7 testsuite: Add test case for #4325 2013-03-28 19:24:17 -07:00
Patrick Walton
ef56aa62fb libcore: Add print and println to the prelude 2013-03-28 19:16:06 -07:00
Tim Chevalier
499f96dca1 testsuite: Add test for #4333 2013-03-28 19:15:24 -07:00
bors
7a6cd2b21e auto merge of #5608 : erickt/rust/incoming, r=catamorphism
@nikomatsakis pointed out that `fn read_option<T>(&self, f: &fn() -> T) -> Option<T>` should have this syntax so it can work with custom option types: `fn read_option<T>(&self, f: &fn(bool) -> T) -> T`.

Also, this also includes some `#[inline(always)]` on the memory functions in `src/libcore/unstable/lang.rs` to reduce one level of indirection when allocating memory.
2013-03-28 19:06:48 -07:00
Tim Chevalier
bf519dad6b testsuite: Update and un-xfail test for #4335 2013-03-28 19:00:49 -07:00
Patrick Walton
36909c7575 libsyntax: Don't allow impl (Trait) for Type (with the parentheses). 2013-03-28 18:56:36 -07:00
bors
f81459211d auto merge of #5593 : luqmana/rust/inline-asm, r=catamorphism
Clean things up a bit. Also, allow selecting intel syntax in addition to the default AT&T dialect.
2013-03-28 18:18:46 -07:00
Graydon Hoare
1163f69c84 rustc: fix linkage of internal static nodes. 2013-03-28 18:15:35 -07:00
Luqman Aden
a3996c1626 Tidy. 2013-03-28 16:34:10 -07:00
bors
5a97c484b1 auto merge of #5609 : Kimundi/rust/incoming, r=catamorphism 2013-03-28 14:42:49 -07:00
Marvin Löbel
eac2f3b93e Unbreak 'rustc --help' 2013-03-28 21:44:46 +01:00
bors
e16f94f6a1 auto merge of #5607 : brson/rust/shapshot3, r=brson 2013-03-28 13:36:53 -07:00
Erick Tryzelaar
aa779c1240 std: change Decoder::read_option to return a generic type
This allows read_option to be used with a custom option type instead
of just core::Option.
2013-03-28 13:11:24 -07:00
Erick Tryzelaar
ce9e5ecb6c core: Inline mallocing wrapper functions
As far as I can tell, this doesn't make rust compile any
faster, but it does at least remove one level of indirection
on malloc, which might help speed up some operations.
2013-03-28 13:11:24 -07:00
Brian Anderson
145f66fdf0 Register snapshots 2013-03-28 12:40:57 -07:00
Patrick Walton
0a002d79b4 librustc: Remove common fields and nested enums from the language 2013-03-28 11:30:01 -07:00
bors
09dc38eda5 auto merge of #5596 : luqmana/rust/unit-struct, r=catamorphism
Fixes #5449.
2013-03-28 06:12:47 -07:00
bors
b1c0a6628b auto merge of #5595 : catamorphism/rust/demoding, r=catamorphism 2013-03-28 04:54:45 -07:00
bors
3dbf2c3c5c auto merge of #5592 : pcwalton/rust/xc-extern-statics, r=pcwalton 2013-03-28 03:51:51 -07:00
bors
e549b80e3c auto merge of #5587 : thestinger/rust/total, r=pcwalton
This is needed so that hash tables can require strict equality but not require types to be ordered. It's a subset of the functionality of `TotalOrd` so I made that inherit from `TotalEq`.
2013-03-28 02:36:49 -07:00
bors
d31053277a auto merge of #5586 : pcwalton/rust/expr-repeat-vstore, r=graydon
r? @graydon
2013-03-28 01:33:48 -07:00
bors
d7ba0acbf5 auto merge of #5579 : dbaupp/rust/rustc-typo-limit, r=catamorphism
Impose a limit so that the typo suggester only shows reasonable
suggestions (i.e. don't suggest `args` when the error is `foobar`).

A tiny bit of progress on #2281.
2013-03-27 23:10:19 -07:00
bors
84ddff3909 auto merge of #5578 : erickt/rust/incoming, r=jbclements,erickt
Hey folks,

This patch series does some work on the json decoder, specifically with auto decoding of enums. Previously, we would take this code:

```
enum A {
    B,
    C(~str, uint)
}
```

and would encode a value of this enum to either `["B", []]` or `["C", ["D", 123]]`. I've changed this to `"B"` or `["C", "D", 123]`. This matches the style of the O'Caml json library [json-wheel](http://mjambon.com/json-wheel.html). I've added tests to make sure all this work.

In order to make this change, I added passing a `&[&str]` vec to `Decode::emit_enum_variant` so the json decoder can convert the name of a variant into it's position. I also changed the impl of `Encodable` for `Option<T>` to have the right upper casing.

I also did some work on the parser, which allows for `fn foo<T: ::cmp::Eq>() { ... }` statements (#5572), fixed the pretty printer properly expanding `debug!("...")` expressions, and removed `ast::expr_vstore_fixed`, which doesn't appear to be used anymore.
2013-03-27 21:51:53 -07:00
Andrew Paseltiner
f02ee42a86 derive Eq and Clone impls where applicable 2013-03-27 22:04:23 -04:00
Luqman Aden
09255dbe2d libsyntax: error on struct Foo {}. 2013-03-27 18:17:58 -07:00
bors
f7f6013a62 auto merge of #5574 : thestinger/rust/docstring, r=sanxiyn 2013-03-27 17:48:56 -07:00
Tim Chevalier
b0d1643fa6 core/std: Remove uses of ++ mode
from stackwalk::frame_address and net_tcp::on_tcp_read_cb
As per #4425
2013-03-27 17:14:10 -07:00
Tim Chevalier
31f8093037 core: Remove unused import 2013-03-27 17:14:06 -07:00
Luqman Aden
63df1e9085 librustc: remove already addressed XXX 2013-03-27 16:29:32 -07:00
Luqman Aden
778f84524b librustc: add default per arch clobbers for asm. 2013-03-27 15:41:58 -07:00
Luqman Aden
b867fe41de libsyntax: Allow selecting intel style asm. 2013-03-27 15:41:58 -07:00
Luqman Aden
203d691a6b libsyntax: use a struct for inline asm in ast. 2013-03-27 15:41:58 -07:00
Luqman Aden
727a565f1e librustc: Move inline asm stuff to different mod. 2013-03-27 15:41:58 -07:00
Patrick Walton
58338dd3d0 librustc: Fix ICE with cross-crate extern statics. rs=bugfix 2013-03-27 15:41:43 -07:00
bors
30b1957cd4 auto merge of #5569 : thestinger/rust/map, r=catamorphism 2013-03-27 14:31:03 -07:00
Daniel Micay
d2b267bcb5 add a TotalEq trait 2013-03-27 17:29:10 -04:00
Patrick Walton
70b56fa5e9 librustc: Allow expr_repeat to be used with any vstore 2013-03-27 14:13:07 -07:00
Patrick Walton
e5dda811a9 librustc: Allow expr_repeat to be used with any vstore 2013-03-27 13:53:03 -07:00
bors
995425badb auto merge of #5558 : nikomatsakis/rust/issue-4920-autoref-index-operator, r=nikomatsakis
Per discussion on IRC.

r? @pcwalton
2013-03-27 13:27:58 -07:00
Niko Matsakis
2a74fda316 Fix pretty-printer test failure by carrying the bound lifetime names through
the types.  Initially I thought it would be necessary to thread this data
through not only the AST but the types themselves, but then I remembered that
the pretty printer only cares about the AST.  Regardless, I have elected to
leave the changes to the types intact since they will eventually be needed.  I
left a few FIXMEs where it didn't seem worth finishing up since the code wasn't
crucial yet.
2013-03-27 11:35:04 -07:00
Graydon Hoare
83aa70d7e3 another pub fn for check-fast 2013-03-27 11:30:38 -07:00
Daniel Micay
91cb6687a8 cmp: rm TotalOrd impl code duplication 2013-03-27 14:17:16 -04:00
Tim Chevalier
fad05591e5 testsuite: more pub fn main 2013-03-27 10:09:03 -07:00
Tim Chevalier
e23fad0e6a Oh, cool, I xfailed the wrong test, neat 2013-03-27 10:09:02 -07:00
Tim Chevalier
e01cf3caf5 testsuite: Add various test cases
Some are xfailed, some not, some existing ones get un-xfailed.
2013-03-27 10:09:02 -07:00
Niko Matsakis
069529bc5c Autoref the argument to the index operator (#4920) 2013-03-27 13:04:03 -04:00
Huon Wilson
ab5346d119 librustc: Limit the typo suggestions to reasonable suggests.
Impose a limit so that the typo suggester only shows reasonable
suggestions (i.e. don't suggest `args` when the error is `foobar`).
2013-03-28 02:19:40 +11:00
Patrick Walton
b93393e907 test: xfail-pretty one of the run-pass tests. rs=burningtree 2013-03-27 07:35:49 -07:00