Commit Graph

382 Commits

Author SHA1 Message Date
Brian Anderson
3b396d17d6 Merge remote-tracking branch 'thestinger/old_map' into incoming
Conflicts:
	src/test/bench/core-map.rs
2013-02-03 17:56:49 -08:00
Patrick Walton
04eb9b4eb0 librustc: Fix bugs regarding to impl privacy. rs=bugfix 2013-02-03 17:50:27 -08:00
Marvin Löbel
eb19462104 Converted libcore/uint-template.rs to the new string functions.
- Moved ToStr implementation of unsigned integers to uint-template.rs.
- Marked the `str()` function as deprecated.
- Forwarded all conversion functions to `core::num::to_str_common()`
  and `core::num::from_str_common()`.
- Fixed most places in the codebase where `to_str()` is being used.
- Added uint-template to_str and from_str overflow tests.
2013-02-03 15:37:24 -08:00
Marvin Löbel
26e72bf92b Converted libcore/int-template.rs to the new string functions.
- Moved ToStr implementation of integers to int-template.rs.
- Marked the `str()` function as deprecated.
- Forwarded all conversion functions to `core::num::to_str_common()`
  and `core::num::from_str_common()`.
- Fixed most places in the codebase where `to_str()` is being used.
- Added int-template to_str and from_str overflow tests.
2013-02-03 15:37:24 -08:00
Daniel Micay
4fd9264875 oldmap: &K instead of K for the remove parameter 2013-02-03 18:20:59 -05:00
Daniel Micay
81b4f36d49 oldmap: remove legacy each method 2013-02-03 15:55:11 -05:00
Daniel Micay
2e496818a5 oldmap: get rid of the legacy each_key method 2013-02-03 15:55:10 -05:00
Daniel Micay
88d9d417a1 oldmap: remove the legacy each_value method 2013-02-03 15:55:10 -05:00
Daniel Micay
1b4eb145f9 oldmap: implement core::container::Container 2013-02-03 15:55:10 -05:00
Daniel Micay
f4a27b2c7d oldmap: get rid of the legacy contains_key method 2013-02-03 15:55:10 -05:00
Daniel Micay
319eeb1c79 rename map -> oldmap and mark it as deprecated
LinearMap is quite a bit faster, and is fully owned/sendable without
requiring copies. The older std::map also doesn't use explicit self and
relies on mutable fields.
2013-02-03 15:55:10 -05:00
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
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
Seo Sanghyeon
d10b5c725b Add is_mutbl field to def_arg 2013-01-22 23:34:34 -08:00
Seo Sanghyeon
9a5d617092 Add is_mutbl field to arg 2013-01-22 23:34:33 -08:00
Seo Sanghyeon
3ed39ce26f Handle divide by zero in constant evaluator 2013-01-23 15:07:00 +09:00
Daniel Micay
9cdcd9bff9 migrate gather_loans.rs to LinearSet 2013-01-22 22:10:04 -05:00
Daniel Micay
342cb602db migrate coherence.rs to LinearSet 2013-01-22 22:10:00 -05:00
Graydon Hoare
bcaeb20800 long line police 2013-01-22 17:53:27 -08:00
Josh Matthews
72259e0772 Translate const references to extern functions as *i8 instead of the typical closure pair. Fixes #4522. 2013-01-22 16:22:55 -08:00
Tim Chevalier
9d672671e2 Make borrowck's notion of scopes consistent with trans's notion of scopes
This eliminates an ICE in trans where the scope for a particular
borrow was a statement ID, but the code in trans that does cleanups
wasn't finding the block with that scope. As per #3860

preserve looks at a node ID to see if it's for a statement -- if it
is, it uses the enclosing scope instead when updating the map that
trans looks at later.

I added a comment noting that this is not the best fix (since it may
cause boxes to be frozen for longer than necessary) and referring
to #3511.

r=nmatsakis
2013-01-22 15:59:45 -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