Commit Graph

293 Commits

Author SHA1 Message Date
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
Tim Chevalier
cff4f1476e rustc: Less copy 2013-01-24 20:42:21 -08:00
Daniel Micay
e4337a9def remove remaining is_not_empty functions/methods 2013-01-24 23:24:57 -05:00
Daniel Micay
d95c9cbe38 replace ConstVector trait with the Container trait 2013-01-24 23:02:44 -05:00
Tim Chevalier
c3f4f654eb comments: Convert XXXes to FIXMEs 2013-01-24 18:49:51 -08:00
Tim Chevalier
9898485d4f Merge pull request #4613 from erickt/incoming
convert most of libcore and libstd to structs, work around tzset race
2013-01-24 17:24:45 -08:00
Tim Chevalier
f19e16881e syntax/rustc: Less copy 2013-01-24 16:45:20 -08:00
Erick Tryzelaar
e84576b888 convert most of libstd over to structs 2013-01-24 16:24:31 -08:00
Patrick Walton
ad25e208ee librustc: Allow &mut to be loaned; allow self to be loaned; make &mut loanable to &. r=nmatsakis 2013-01-24 13:52:22 -08:00
Patrick Walton
bbbb80559c librustc: Disallow &mut loans from overlapping with any other loans 2013-01-24 13:52:21 -08:00
Patrick Walton
163b97b7bb librustc: Make C functions unsafe 2013-01-24 13:52:21 -08:00
Tim Chevalier
f3ec278e46 Merge pull request #4609 from sonwow/keyword-super
Make `super` a keyword
2013-01-24 11:17:52 -08:00
Tim Chevalier
25f9fa0359 Merge pull request #4608 from ILyoan/entry_android
export entry point for android
2013-01-24 11:16:05 -08:00
Tim Chevalier
ce954d117f Merge pull request #4611 from ILyoan/i4482_more
Remove unnecessary code
2013-01-24 11:15:13 -08:00
Tim Chevalier
5b64c796a4 syntax/rustc: Improve error message for misuse of for loop
Print out a clearer error message when a `for` gets
used with the wrong type of iterator. Also fix spans on `for` loop
bodies, and suppress some more derived errors.

r=brson

Closes #3651
2013-01-24 11:04:54 -08:00
ILyoan
ce85837557 remove unnecessary code 2013-01-24 19:03:49 +09:00
Youngsoo Son
4b2aa286d8 Make super a keyword 2013-01-24 16:07:04 +09:00
ILyoan
718a0fcdc1 export entry point for android 2013-01-24 15:07:14 +09:00
Tim Chevalier
625405562c Revert "Merge pull request #4590 from crabtw/abi"
This reverts commit e4e5d986fa, reversing
changes made to ab8d77474c.
2013-01-23 20:38:20 -08:00
Tim Chevalier
a202dcccca Merge pull request #4594 from thestinger/map
more work on the map trait and TreeMap/LinearMap
2013-01-23 20:10:47 -08:00
Jyun-Yan You
b72d4d70a8 add ABIInfo trait and separate x86-64 ABI implementation from foreign trans
ABIInfo provides a method to translate the type of foreign function.
The foreign trans uses the method to get ABI-specific type and
uses the result to generate LLVM instructions for wrapper and shim functions.
2013-01-24 09:31:28 +08:00
Graydon Hoare
cb1f957f71 rustc: fix const enums to be packed, r=burningtree. 2013-01-23 16:25:57 -08:00
Patrick Walton
4f88ed36a1 librustc: Remove obsolete FIXME in item collection. rs=comments-only 2013-01-23 15:17:13 -08:00
Tim Chevalier
ab13beb05a Merge pull request #4587 from sanxiyn/divide-by-zero
Handle divide by zero in constant evaluator
2013-01-23 14:56:07 -08:00
Patrick Walton
54b2cad8b3 libsyntax: Remove fn() unsafe { ... }. r=graydon 2013-01-23 14:41:08 -08:00
Daniel Micay
b7ef28c33a rename send_map to hashmap
This makes the module much more discoverable, and is in line with the
'treemap' naming.
2013-01-23 14:25:01 -05:00
Tim Chevalier
995ccc0d82 Merge pull request #4596 from Trinick/tomutrename
core: Rename to_mut and from_mut to cast_to_mut and cast_from_mut
2013-01-23 10:56:08 -08:00
Trinick
9dc8e96c5f core: Rename to_mut and from_mut to cast_to_mut and cast_from_mut 2013-01-23 10:09:45 +00:00
Seo Sanghyeon
800b8a759d Implement mut in arguments 2013-01-22 23:34:34 -08:00