Commit Graph

354 Commits

Author SHA1 Message Date
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
Tim Chevalier
0aef28dd6d De-capitalize "note" to get rid of spurious tidy warnings 2013-01-29 19:26:55 -08:00
Patrick Walton
b070590564 libsyntax: De-export libsyntax. rs=deexporting 2013-01-29 14:42:23 -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
6ce74460e6 librustc: Disallow trait bounds in types, enumerations, and structure definitions. r=tjc 2013-01-29 10:42:58 -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
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
5085eb3c28 Convert pipes::Buffer into a struct 2013-01-24 16:24:31 -08:00
Erick Tryzelaar
90734a0d33 Convert extfmt::rt::Conv into a struct 2013-01-24 16:24:31 -08:00
Erick Tryzelaar
6e2ae2c2c1 remove support for records from auto_encode 2013-01-24 16:24:30 -08:00
Patrick Walton
154488df19 libsyntax: Implement assert as a macro (called fail_unless! on a transitionary basis to avoid conflicting with the keyword right now). r=brson 2013-01-23 14:46:24 -08:00
Tim Chevalier
d77f8d5554 Long lines 2013-01-23 13:34:22 -08:00
John Clements
0b958e74ac renaming to adhere to conventions 2013-01-23 11:46:19 -08:00
Seo Sanghyeon
9a5d617092 Add is_mutbl field to arg 2013-01-22 23:34:33 -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
8a3a1fc148 convert ast::expr into a struct 2013-01-20 14:08:18 -08:00
Graydon Hoare
84825ee310 librustc: Make the default sigil for block lambdas & instead of @. 2013-01-15 17:57:45 -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
1f5e9ff362 convert ast::struct_def to a struct 2013-01-14 18:15:54 -08:00
Erick Tryzelaar
530a113bfa convert ast::item into a struct 2013-01-14 18:15:53 -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
Brian Anderson
fc582bcfce Merge remote-tracking branch 'mneumann/f-serialize' 2013-01-14 12:56:31 -08:00
Andrew Paseltiner
92810089b5 libsyntax: Fix name generation in condition! macro 2013-01-11 21:32:10 -05:00
Patrick Walton
2a1b6c4de9 librustc: Implement &static as the replacement for Durable. r=nmatsakis 2013-01-10 11:16:54 -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
Lindsey Kuper
816cb8c535 Rename identifiers that still use 'alt' to use 'match'
This'll be less confusing for anyone who works on match in future.
2013-01-08 14:31:58 -05:00
Patrick Walton
e26ca35b08 librustc: Fix the test runner, the condition system, and core test. rs=bustage 2012-12-27 17:53:04 -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
Michael Neumann
2b6c456bf6 Enhance auto_encode to take number of struct fields
emit_struct and read_struct takes an additional len:uint parameter which tells
us how many fields the struct we are working on has.

This is required to implement an Encoder for the msgpack [1] serialization
format. To serialize a struct with msgpack you have to use arrays and the size
of the array has to be know before each of the elements are written out. JSON
as an example doesn't have this problem as it uses '[' and ']' delimiters for
arrays.

[1]: www.msgpack.org
2012-12-27 06:16:16 -06:00
Erick Tryzelaar
c14105bb8a Remove serialize::traits submodule. 2012-12-19 18:16:20 -08:00
Erick Tryzelaar
9c673b246c Remove the old serialization code
Closes #3713.
2012-12-19 18:16:20 -08:00
Graydon Hoare
8e28f23c60 core: add macro_rules! for "condition! { c: in -> out; }". 2012-12-18 17:22:27 -08:00
Brian Anderson
a59747cd7f Another tweak to auto_encode to only use trait-qualified static methods 2012-12-18 15:38:34 -08:00
Brian Anderson
b46e25bdc8 Merge commit 'erickt/incoming^' into kind-names 2012-12-18 12:22:59 -08:00
Brian Anderson
c704d26c8c Change auto_encode to call 'std::serialize::traits::Decode::decode' 2012-12-18 12:04:26 -08:00
Erick Tryzelaar
85bb1fc2c4 Change iter::find's closure to take a ref 2012-12-17 22:01:38 -08:00
Erick Tryzelaar
8650c6f683 Switch from serialization to std::serialize. (snapshot) 2012-12-17 20:00:36 -08:00
Erick Tryzelaar
786c143a70 Begin renaming serialization to std::serialize. (snapshot) 2012-12-13 18:16:31 -08:00