Commit Graph

146 Commits

Author SHA1 Message Date
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
Erick Tryzelaar
8cdc3fda11 convert ast::ty into a struct 2013-01-20 14:08:18 -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
df7d376d25 Convert ast::def_id 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
Tim Chevalier
cfa62cd5ee Make ast_util::path_name_i take a slice vector, eliminate a bad copy 2013-01-11 15:19:05 -08:00
Niko Matsakis
2b92962aa2 A collection of refactorings that I found it hard/tiresome to divide:
- Make `extern fn()` assignable to any closure type, rather than
  a subtype.
- Remove unused int_ty_set and float_ty_set
- Refactor variable unification and make it more DRY
- Do fn sub/lub/glb on the level of fn_sig
- Rename infer::to_str::ToStr to infer::to_str::InferStr
- Capitalize names of various types
- Correct hashing of FnMeta
- Convert various records-of-fns into structs-of-fns.  This is both
  eliminating use of deprecated features and more forwards compatible
  with fn reform.

r=pcwalton
2013-01-09 14:59:07 -08:00
Erick Tryzelaar
2891a49f0d core: rename vec.filter to vec.filtered 2013-01-09 08:55:37 -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
Patrick Walton
57c599914a librustc: Terminate name searches at the nearest module scope for paths that contain at least two components. r=graydon 2012-12-27 10:02:54 -08:00
Erick Tryzelaar
8650c6f683 Switch from serialization to std::serialize. (snapshot) 2012-12-17 20:00:36 -08:00
Jakub Wieczorek
1968cb315a Add support for destructuring vectors in match expressions 2012-12-17 16:50:40 -08:00
Patrick Walton
cd120736cb librustc: Allow moves out of self. r=nmatsakis 2012-12-13 15:49:07 -08:00
Tim Chevalier
0046ed9462 Remove un-needed code for obsolete classes
and rename "class" to "struct" everywhere possible (except local
vars, I was too lazy for that) -- that is why this commit is so
big.

No review, just dead code removal and renaming.

Closes #3515
2012-12-10 18:45:01 -08:00
Patrick Walton
56ece46f7d librustc: Remove all legacy pattern bindings from libsyntax and librustc. rs=refactoring 2012-12-04 14:19:19 -08:00
Graydon Hoare
00c856c0b1 Update license, add license boilerplate to most files. Remainder will follow. 2012-12-03 17:12:14 -08:00
Tim Chevalier
daf28a421a Disallow dereferencing enum types when the variant is private
If an enum type's only variant is private, disallow dereferencing
values of its type.

Due to #4082, this only applies to enums that are in the same crate.

r=pcwalton

Closes #818
2012-11-30 12:45:10 -08:00
Graydon Hoare
d783f4d7bb libs: Remove transitionary material on iter_bytes, add workcache to build. 2012-11-30 10:33:16 -08:00
Patrick Walton
a0617eae68 librustc: Eliminate most expressions of the form a.b() that are not method calls. rs=refactoring 2012-11-29 17:51:56 -08:00
Paul Stansifer
0f707f42c8 Distinguish stmt_macs that are followed by semicolons and those that aren't. 2012-11-29 12:09:10 -08:00
Paul Stansifer
ee076f63f9 Allow for macros to occur in statement position. 2012-11-29 12:09:10 -08:00
Patrick Walton
669fbddc44 librustc: Add explicit self to IterBytes. r=nmatsakis 2012-11-28 11:36:04 -08:00
Brian Anderson
81d20156cd Change spans to use byte offsets instead of char offsets 2012-11-16 12:06:44 -08:00
Brian Anderson
f67bfe9738 Add types for character position and byte position in the codemap 2012-11-14 15:18:29 -08:00
Brian Anderson
4c68084963 Convert most codemap types from records to structs 2012-11-12 16:21:39 -08:00
Patrick Walton
0fc952372a rustc: Support irrefutable patterns in function arguments. r=nmatsakis 2012-11-07 19:29:30 -08:00
Patrick Walton
599b4208fb rustc: Translate tuple struct constructors 2012-10-25 11:49:26 -07:00
Patrick Walton
91ae5412d8 rustc: Merge module and type namespaces. r=brson 2012-10-15 15:35:36 -07:00
Niko Matsakis
98887cc7ee remove ctor from ast (take 2) (no review: just dead code removal) 2012-10-12 19:46:37 -07:00
Niko Matsakis
cb55e246ba Use the Nth impl when translating a static method call, instead
of the 0th.  0th is only correct when there are no bound tps
on the trait.

Fixes #3741.
2012-10-12 17:46:43 -07:00
Tim Chevalier
6854265161 Remove comment that is now false 2012-10-11 16:00:30 -07:00
Tim Chevalier
22efa39382 Revert "Revert "Remove old auto_serialize2 code (needs snapshot)""
This reverts commit a33535e441.
2012-10-08 17:43:45 -07:00