Commit Graph

321 Commits

Author SHA1 Message Date
Brian Anderson
9dc6938292 Merge remote-tracking branch 'nickdesaulniers/issue4524' into nocomm1 2013-02-01 11:18:58 -08:00
Nick Desaulniers
7868b6bf55 Remove fail keyword from lexer & parser and clean up remaining calls to
fail

Fix merge conflicts - Issue 4524
2013-02-01 00:15:42 -08:00
John Clements
53688addaa test cases, cleanup 2013-01-31 23:05:12 -08:00
Nick Desaulniers
6fb4239bb3 Replace most invocations of fail keyword with die! macro 2013-01-31 22:25:12 -08:00
Daniel Micay
70855f5a07 move smallintmap to oldsmallintmap 2013-01-31 23:13:56 -05:00
Nick Desaulniers
aee7929469 Replace most invocations of fail keyword with die! macro 2013-01-31 20:12:49 -08:00
Tim Chevalier
2db3175c76 rustc: Stamp out XXXes in middle (comments only) 2013-01-31 19:48:43 -08:00
Brian Anderson
9673005afe Merge pull request #4703 from sanxiyn/remove-tps
Remove `tps` from `trans_enum_def` and `trans_struct_def`
2013-01-31 16:59:47 -08:00
Niko Matsakis
71478f9ce3 Workaround for #4717: pad contents of ast. rs=breakage 2013-01-31 16:56: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
Seo Sanghyeon
0d1058a62e Remove tps from trans_enum_def and trans_struct_def 2013-01-31 17:12:33 +09:00
Patrick Walton
366812a5c3 librustc: Change self as a type to Self everywhere. r=brson 2013-01-30 19:52:45 -08:00
Patrick Walton
49472ec4c9 librustc: Remove legacy exports from the language. r=brson 2013-01-30 18:11:43 -08:00
Graydon Hoare
4030aaff20 rustc: make integral type inference transactional, close #3211, close #4401, close #3398. 2013-01-30 16:21:19 -08:00
Patrick Walton
d2e1bfb123 librustc: Long line. rs=burning 2013-01-30 14:30:42 -08:00
Patrick Walton
ae50912875 librustc: De-export rustc. rs=deexporting 2013-01-30 13:44:24 -08:00
Patrick Walton
cc9999c609 librustc: De-record the type context. rs=derecordification 2013-01-30 13:14:58 -08:00
Patrick Walton
684aa2b7fd librustc: De-export ty. rs=deexporting 2013-01-30 12:18:08 -08:00
Patrick Walton
ba11e96289 librustc: De-export trans. rs=deexporting 2013-01-30 11:47:02 -08:00
Patrick Walton
28ed9dc09e librustc: Long lines. rs=burning 2013-01-29 22:40:13 -08:00
Patrick Walton
0c1d9befb3 librustc: Speed up byte copy operations. r=nmatsakis 2013-01-29 22:15:06 -08:00
Patrick Walton
97c593a1ce librustc: Stop zeroing out allocas so much. Cuts 300K off librustc. 2013-01-29 22:14:08 -08:00
Patrick Walton
1b613ff9fc librustc: Strdup unique strings instead of copying in byte by byte. Shaves 2MB off librustc at -O0. 2013-01-29 22:14:08 -08:00
Patrick Walton
a47fa9b32f librustc: De-export some of trans. rs=deexporting 2013-01-29 22:14:08 -08:00
Tim Chevalier
a30ea013f5 Handle supertrait calls in default methods
Add a new method_super origin for supertrait methods. Also make
coherence create a table that maps pairs of trait IDs and self types
to impl IDs, so that it's possible to check a supertrait method
knowing only its index in its trait's methods (without knowing all
supertraits for a given trait).

r=nmatsakis and graydon -- with hope, we'll revamp all of this code as
per #4678, but for now this fixes the bug.

Closes #3979
2013-01-29 20:33:22 -08:00
Patrick Walton
bae4821851 librustc: De-export typeck. rs=deexporting 2013-01-29 16:26:16 -08:00
Patrick Walton
c25703ccb8 librustc: De-export front, borrowck, and typeck/check. rs=deexporting 2013-01-29 16:05:13 -08:00
Patrick Walton
226cd68f13 librustc: De-implicit-self the visitor. r=graydon 2013-01-29 10:43:12 -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
Tim Chevalier
15871a7458 rustc: Check struct field types when heap memory lint checks are enabled 2013-01-28 19:41:56 -08:00
Tim Chevalier
6cbccc92b7 rustc: In lint, forbid structural records unless legacy_records is on 2013-01-28 19:41:55 -08:00
Tim Chevalier
db6af50d53 rustc: Add legacy_records field to the type context 2013-01-28 19:41:55 -08:00
Niko Matsakis
ef4c060594 Address @catamorphism's comments regarding docs 2013-01-28 10:01:59 -08:00
Niko Matsakis
4b15bfde81 loan: Track whether or not the current path owns the data being
lent.  We can be more liberal with respect to the scope of the loan
if we do not own the data being lent, which used to be impossible
but can now occur with `&mut`.

r=pcwalton
2013-01-28 10:01:59 -08:00
Niko Matsakis
b4acde3bf7 remove unused variable 2013-01-28 10:01:59 -08:00
Niko Matsakis
e6cadc4c03 remove hacks now that #3148 is fixed
r=brson
2013-01-28 10:01:59 -08:00
Niko Matsakis
2b67d88809 Rewrite the coercion code to be more readable, more sound, and to reborrow when
needed.

Regarding soundness: there was a subtle bug in how it was done before; see the
compile-fail test for an example.

Regarding reborrowing: reborrowing allows mut and const
slices/borrowed-pointers to be used with pure fns that expect immutable data.

r=brson
2013-01-28 10:01:59 -08:00
Niko Matsakis
c07ae16de1 rename assign to coerce, remove some bad copies
r=brson
2013-01-28 10:01:59 -08:00
Niko Matsakis
05b6df49b8 Refactor to make inference code around unification more readable
r=brson
2013-01-28 10:01:59 -08:00
Niko Matsakis
a4ba11189d Extend region guarantor logic to handle autoref, which will
be necessary for reborrowing.

r=catamorphism
2013-01-28 10:00:41 -08:00
Niko Matsakis
2e10ea58c3 Integrate vec patterns into borrow checker.
The tail portion of the pattern effectively borrows a vector,
but the borrow checker knew nothing about this.

r=catamorphism
2013-01-28 10:00:32 -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
Tim Chevalier
2c78169508 Merge pull request #4644 from martica/camel-case-option
Update more uses of Option, Some and None to camel case
2013-01-25 19:21:16 -08:00
Tim Chevalier
41adf9d8ef rustc: Make build_wrap_ret compile on Windows and unrevert ABI patch
This reverts commit 625405562c.
2013-01-25 18:57:01 -08:00
Tyler Bindon
633b40f75d Fix Option camel case in debug messages 2013-01-25 19:42:23 -07:00
Tyler Bindon
3a5d2cdbf3 Fix Option camel case in comments 2013-01-25 19:42:23 -07:00
Tyler Bindon
7ff7489dc6 Fix Option camel case in error message 2013-01-25 19:42:23 -07:00
Tim Chevalier
85a34c2898 Merge pull request #4625 from thestinger/container
more little container improvements
2013-01-25 11:57:51 -08:00
Tim Chevalier
e3daab7051 rustc: Address an XXX in middle::mode 2013-01-24 21:12:44 -08:00