Commit Graph

80 Commits

Author SHA1 Message Date
Huon Wilson
6e50515530 syntax/ext: migrate build.rs functions to AstBuilder methods. 2013-05-22 00:15:36 +10: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
Alex Crichton
030c666cc1 Re-implement lint with less emphasis on item ids
This way it's much easier to add lints throughout compilation correctly, and
functions on impls can alter the way lints are emitted.
2013-05-17 00:49:16 -04:00
Huon Wilson
5dc5efefd4 syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].
Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute
and remove the majority of the actual code, leaving stubs to refer the user to
the new syntax.
2013-05-16 08:55:57 +10:00
Alex Crichton
92d39fe4d5 syntax: Remove #[allow(vecs_implicitly_copyable)] 2013-05-14 12:24:43 -04:00
Patrick Walton
5d3559e645 librustc: Make self and static into keywords 2013-05-12 16:35:18 -07:00
Björn Steinbrink
1393c3a3f4 Use a specialized string interner to reduce the need for owned strings
&str can be turned into @~str on demand, using to_owned(), so for
strings, we can create a specialized interner that accepts &str for
intern() and find() but stores and returns @~str.
2013-05-09 14:40:19 +02:00
Patrick Walton
72868450df libcore: Fix more merge fallout. 2013-05-08 17:04:03 -07:00
Huon Wilson
b20eb970e1 libsyntax: extend generic deriving code to handle almost all possible traits.
This adds support for static methods, and arguments of most types, traits with
type parameters, methods with type parameters (and lifetimes for both), as well
as making the code more robust to support deriving on types with lifetimes (i.e.
'self).
2013-05-07 01:33:54 +10:00
Patrick Walton
f30f54e9d0 librustc: Remove the concept of modes from the compiler.
This commit does not remove `ty::arg`, although that should be
possible to do now.
2013-04-29 14:30:55 -07:00
Daniel Micay
f792baba42 only use #[no_core] in libcore 2013-04-27 21:34:24 -04:00
Marvin Löbel
e1be9ae224 Made fail! and assert! accept both &'static str and ~str, as well as a fmt! like format list.
Unwinding through macros now happens as a call to the trait function `FailWithCause::fail_with()`, which consumes self, allowing to use a more generic failure object in the future.
2013-04-25 17:32:25 +02:00
Alex Crichton
3c7aea3a6a syntax: de-mode and prepare for de-modeing rustc 2013-04-19 23:21:52 -04:00
Erick Tryzelaar
441df26f5a syntax: add support for #[deriving(Decodable)] 2013-04-10 16:32:09 -07:00
Erick Tryzelaar
5841564bf9 syntax: add support for #[deriving(Encodable)] 2013-04-10 16:32:09 -07:00
John Clements
48e7bda826 path -> Path 2013-04-10 09:15:04 -07:00
Niko Matsakis
d28f734412 Refactor so that references to traits are not represented using a type with a
bare function store (which is not in fact a kind of value) but rather
ty::TraitRef.  Removes many uses of fail!() and other telltale signs of
type-semantic mismatch.

cc #4183 (not a fix, but related)
2013-04-05 05:36:02 -04:00
Erick Tryzelaar
83e831bc22 syntax: Remove deprecated expr_vstore_fixed 2013-03-27 07:04:16 -07:00
Niko Matsakis
e11d13f3de Rip out old code that still structured method calls as a
expr_call(expr_field(...)) rather than an expr_method_call.
There is probably more such code in trans that should be removed.
2013-03-26 15:16:58 -04:00
Alex Crichton
1a0d212dd9 Build up the result of fmt! in a buffer instead of a vector 2013-03-22 11:49:45 -04:00
Patrick Walton
b1c699815d librustc: Don't accept as Trait anymore; fix all occurrences of it. 2013-03-13 20:07:09 -07:00
Patrick Walton
954ae9c975 libsyntax: Remove struct literal expressions from the compiler 2013-03-07 22:32:55 -08:00
Alex Crichton
dfb5c10dea Remove unused imports throughout src/ 2013-03-04 12:27:01 -05:00
Erick Tryzelaar
3953bdd812 Merge remote-tracking branch 'remotes/origin/incoming' into incoming 2013-02-28 07:25:31 -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
5271464cc0 libsyntax: remove vecs_implicitly_copyable from the syntax extensions 2013-02-26 20:48:12 -08:00
Luqman Aden
b02f5c2090 Get rid of structural records in libsyntax and the last bit in librustc. 2013-02-21 00:19:15 -08:00
Luqman Aden
0f09c106f0 libsyntax: Update view_item_use/import to reflect actual usage 2013-02-17 21:45:00 -05:00
Luqman Aden
e244f103c9 libsyntax: Get rid of uses of move and don't parse it. 2013-02-15 02:49:55 -08:00
Niko Matsakis
a32498d846 Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
correct handling of moves for struct-record update.

Part of #3678.  Fixes #2828, #3904, #4719.
2013-02-07 05:53:30 -08:00
John Clements
53688addaa test cases, cleanup 2013-01-31 23:05:12 -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
b070590564 libsyntax: De-export libsyntax. rs=deexporting 2013-01-29 14:42:23 -08:00
Niko Matsakis
d4fd30c6ac Link the lifetimes of regions resulting from borrows of the
contents of other borrowed pointers to the lifetimes of the
borrowed value.  Fixes #3148.

r=catamorphism
2013-01-28 10:00:23 -08:00
Erick Tryzelaar
90734a0d33 Convert extfmt::rt::Conv into a struct 2013-01-24 16:24:31 -08:00
Seo Sanghyeon
9a5d617092 Add is_mutbl field to arg 2013-01-22 23:34:33 -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
8cdc3fda11 convert ast::ty into a struct 2013-01-20 14:08:18 -08:00
Erick Tryzelaar
8a3a1fc148 convert ast::expr into a struct 2013-01-20 14:08:18 -08:00
Erick Tryzelaar
293cd3480c convert ast::{field_,capture_item_,mt} and middle::ty::mt into structs 2013-01-14 21:36:27 -08:00
Erick Tryzelaar
4bcd19f6be Convert ast::{pat,field_pat,local_,arm} into structs 2013-01-14 20:52:28 -08:00
Erick Tryzelaar
3ea3136e84 convert ast::blk_ into a struct 2013-01-14 19:35:08 -08:00
Erick Tryzelaar
4b0f702608 convert ast::attribute_ and ast::view_item to a struct 2013-01-14 18:15:54 -08:00
Erick Tryzelaar
e1f1a1204a change ast::ty_param into a struct. 2013-01-14 18:14:16 -08:00
Erick Tryzelaar
bea67bde21 Change ast::path into a struct. 2013-01-14 18:14:16 -08:00
Erick Tryzelaar
93c2ebf994 syntax: convert ast::spanned into a struct 2013-01-09 08:55:36 -08:00
Patrick Walton
2db3abddcd librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc 2013-01-08 22:02:35 -08:00
Patrick Walton
44ab00ee37 Revert "librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc"
This reverts commit a8d37af247.
2013-01-08 19:29:16 -08:00
Patrick Walton
a8d37af247 librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc 2013-01-08 19:27:57 -08:00