Commit Graph

181 Commits

Author SHA1 Message Date
John Clements
1b4ced8bcb get rid of prec.rs
prec.rs no longer had much to do with precedence; the token->binop
function fits better in token.rs, and the one-liner defining the
precedence of 'as' can go next to the other precedence stuff in
ast_util.rs
2013-04-28 09:51:14 -07:00
John Clements
71c0bd5c5d simplify, based on invariant that items_allowed != foreign_items_allowed 2013-04-28 09:49:20 -07:00
Daniel Micay
f792baba42 only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
Patrick Walton
25129ee81c librustc: Remove use mod from the language 2013-04-22 12:32:59 -07:00
Brendan Zabarauskas
01eb5e8ad3 Rename Div operator trait to Quot and Modulo operator trait to Rem 2013-04-22 01:58:53 +10:00
Alex Crichton
3c7aea3a6a syntax: de-mode and prepare for de-modeing rustc 2013-04-19 23:21:52 -04:00
John Clements
7e4cd09e2e added MTWT functions 2013-04-16 10:06:06 -07:00
John Clements
48e7bda826 path -> Path 2013-04-10 09:15:04 -07:00
Niko Matsakis
007abe9352 Rather than storing a list of ty::method per trait, store one ty::method
per method and list of def-ids per trait.
2013-04-05 05:36:02 -04: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
Alex Crichton
be57d745d2 Removing unused imports 2013-03-28 23:56:46 -04:00
Patrick Walton
e7c60c141b librustc: Remove pure from libsyntax and librustc. 2013-03-22 12:57:27 -07:00
Andrew Paseltiner
e2abecd3ab syntax: replace uses of old deriving attribute with new one 2013-03-22 06:30:59 -04:00
Patrick Walton
d18f785457 librustc: Replace all uses of fn() with &fn(). rs=defun 2013-03-11 09:35:58 -07:00
Seo Sanghyeon
9e85589ad3 Implement vector destructuring from tail 2013-03-11 19:01:51 +09:00
Patrick Walton
0ea031bcb8 librustc: Remove record patterns from the compiler 2013-03-07 22:37:03 -08:00
Erick Tryzelaar
743cfce703 core: convert vec::{last,last_opt} to return references 2013-03-05 19:39:18 -08:00
bors
eddefbc893 auto merge of #5212 : thestinger/rust/iter, r=graydon
A small step towards fixing #2827
2013-03-05 02:06:50 -08:00
Alex Crichton
dfb5c10dea Remove unused imports throughout src/ 2013-03-04 12:27:01 -05:00
Daniel Micay
af645e8487 replace option::iter with a BaseIter impl 2013-03-03 11:01:17 -05:00
Patrick Walton
256afb8a10 libsyntax: Remove fn@, fn~, and fn& from libsyntax. rs=defun 2013-03-02 16:49:31 -08:00
Erick Tryzelaar
85fecd0ba7 Merge remote-tracking branch 'remotes/origin/incoming' into incoming 2013-03-01 07:01:48 -08:00
Alex Crichton
2df07ddc25 Fix implicit leaks of imports throughout libraries
Also touch up use of 'pub' and move some tests around so the tested functions
don't have to be 'pub'
2013-02-28 18:00:34 -05:00
Erick Tryzelaar
3953bdd812 Merge remote-tracking branch 'remotes/origin/incoming' into incoming 2013-02-28 07:25:31 -08:00
bors
d0a12347de auto merge of #5141 : nikomatsakis/rust/region-syntax-expl-lifetimes, r=nikomatsakis
Major changes are:
- replace ~[ty_param] with Generics structure, which includes
  both OptVec<TyParam> and OptVec<Lifetime>;
- the use of syntax::opt_vec to avoid allocation for empty lists;

cc #4846

r? @graydon
2013-02-27 17:36:41 -08:00
Niko Matsakis
c623d21e38 Introduce lifetime declarations into the lists of type parameters.
Major changes are:
- replace ~[ty_param] with Generics structure, which includes
  both OptVec<TyParam> and OptVec<Lifetime>;
- the use of syntax::opt_vec to avoid allocation for empty lists;

cc #4846
2013-02-27 19:42:09 -05:00
Erick Tryzelaar
7d0ec86c4a Merge remote-tracking branch 'remotes/origin/incoming' into incoming 2013-02-27 11:03:21 -08:00
Patrick Walton
07c3f5c0de librustc: Forbid pub or priv before trait implementations 2013-02-27 09:40:16 -08:00
Erick Tryzelaar
bff22cf166 libsyntax: add some explicit copies 2013-02-25 23:37:45 -08:00
Erick Tryzelaar
f14409c528 libsyntax: progress on making syntax::visit vecs_implicitly_copyable-free 2013-02-25 07:49:34 -08:00
Erick Tryzelaar
9ac5262bdf libsyntax: convert visit to pass ty_params by reference 2013-02-25 07:27:01 -08:00
Luqman Aden
cd82c4566b librustc: Get rid of structural records save for front/test.rs. 2013-02-20 18:45:50 -08:00
Erick Tryzelaar
bc62bd3782 libsyntax: make enum variants take refs 2013-02-19 10:02:51 -08:00
Luqman Aden
0f09c106f0 libsyntax: Update view_item_use/import to reflect actual usage 2013-02-17 21:45:00 -05:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
Patrick Walton
31f6534952 libsyntax: Add explicit self to ast_util. rs=explicit-selfing 2013-02-04 09:07:00 -08:00
John Clements
53688addaa test cases, cleanup 2013-01-31 23:05:12 -08:00
Nick Desaulniers
aee7929469 Replace most invocations of fail keyword with die! macro 2013-01-31 20:12:49 -08:00
Niko Matsakis
0682ad0eb9 Finalize moves-based-on-type implementation.
Changes:

- Refactor move mode computation
- Removes move mode arguments, unary move, capture clauses
  (though they still parse for backwards compatibility)
- Simplify how moves are handled in trans
- Fix a number of illegal copies that cropped up
- Workaround for bug involving def-ids in params
  (see details below)

Future work (I'll open bugs for these...):

- Improve error messages for moves that are due
  to bindings
- Add support for moving owned content like a.b.c
  to borrow check, test in trans (but I think it'll
  "just work")
- Proper fix for def-ids in params

Def ids in params:

Move captures into a map instead of recomputing.

This is a workaround for a larger bug having to do with the def-ids associated
with ty_params, which are not always properly preserved when inlining.  I am
not sure of my preferred fix for the larger bug yet.  This current fix removes
the only code in trans that I know of which relies on ty_param def-ids, but
feels fragile.
2013-01-31 12:09:00 -08:00
Patrick Walton
49472ec4c9 librustc: Remove legacy exports from the language. r=brson 2013-01-30 18:11:43 -08:00
Patrick Walton
95b892c8a7 libsyntax: De-export a lot of libsyntax. rs=deëxporting 2013-01-29 13:55:30 -08:00
Patrick Walton
eb4d39e1fe libstd: Remove "dual impls" from the language and enforce coherence rules. r=brson
"Dual impls" are impls that are both type implementations and trait
implementations. They can lead to ambiguity and so this patch removes them
from the language.

This also enforces coherence rules. Without this patch, records can implement
traits not defined in the current crate. This patch fixes this, and updates
all of rustc to adhere to the new enforcement. Most of this patch is fixing
rustc to obey the coherence rules, which involves converting a bunch of records
to structs.
2013-01-29 10:42:45 -08:00
Seo Sanghyeon
d10b5c725b Add is_mutbl field to def_arg 2013-01-22 23:34:34 -08:00
Tim Chevalier
10260bee38 Change debuginfo to not use an option for the output type...
...now without a random libuv change.
2013-01-22 15:13:23 -08:00
Tim Chevalier
a36eacc4f9 Revert "Clean up previous commit to not require an Option"
I made a mistake and included some submodule weirdness.
About to re-push the patch without that.

This reverts commit 17ea548275.
2013-01-22 15:12:35 -08:00
Tim Chevalier
17ea548275 Clean up previous commit to not require an Option 2013-01-22 14:28:05 -08:00
Erick Tryzelaar
7f2c399f3a Convert many libsyntax records into structs
Specifically:

ast_map::ctx
ast_util::id_range
diagnostic::{handler_t,codemap_t}
auto_encode::field
ext::base::{macro_def,syntax_expander_tt,syntax_expander_tt_item}
ext::pipes::proto::next_state
2013-01-20 14:08:18 -08:00
Erick Tryzelaar
d5d77b9351 convert the remaining ast record types into structs
These are: region,arg,fn_decl,method,_mod,foreign_mod,
variant_arg,enum_def_,variant_,trait_ref.
2013-01-20 14:08:18 -08:00
Erick Tryzelaar
5ba7e55a4c convert ast::{ty_field_,ty_method} into a struct 2013-01-20 14:08:18 -08:00