Commit Graph

2413 Commits

Author SHA1 Message Date
Tim Chevalier
6f0bede97c testsuite: Remove call to set_buffer_, use set_buffer 2013-01-31 19:35:57 -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
42b462e076 test: Attempt to fix Windows check-fast resolve bustage. rs=bustage 2013-01-30 21:57:23 -08:00
Ben Striegel
3e2ed18a4c RIMOV: fix issue-3563-3 test 2013-01-30 23:21:57 -05:00
Ben Striegel
bb642350e1 Repair RIMOV damage to run-pass 2013-01-30 23:21:57 -05:00
Ben Striegel
0336a8633f RIMOV, round 10
find ./ -type f -name "*.rs" -exec sed -i "s/~\[mut /~\[/g" {} \;
2013-01-30 23:19:08 -05:00
Ben Striegel
f08af9a7a5 RIMOV, round 5
find ./ -type f -name "*.rs" -exec sed -i "s/\&\[mut /\&mut \[/g" {} \;
2013-01-30 23:18:08 -05:00
Ben Striegel
12e8151fb0 RIMOV, round 4
find ./ -type f -name "*.rs" -exec sed -i "s/let mut \(.*\)\[mut[
]\?/let mut \1\[/g" {} \;
2013-01-30 23:16:56 -05:00
Ben Striegel
5577ce635f RIMOV, round 3
find ./ -type f -name "*.rs" -exec sed -i "s/let \(.*\)\[mut[ ]\?/let
mut \1\[/g" {} \;
2013-01-30 23:16:56 -05:00
Patrick Walton
366812a5c3 librustc: Change self as a type to Self everywhere. r=brson 2013-01-30 19:52:45 -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
592c2e1db4 test: Remove export from the tests, language, and libraries. rs=deexporting 2013-01-30 15:56:40 -08:00
Tim Chevalier
d73bf62952 testsuite: Add xfailed test for #4542 2013-01-30 14:07:08 -08:00
Tim Chevalier
d5c6d94e7e Test case 2013-01-30 14:06:16 -08:00
Brian Anderson
02e907b648 Remove oldcomm from the test suite 2013-01-30 00:48:10 -08:00
Tim Chevalier
90cee95e51 xfail transitive inheritance test -- I guess this doesn't work yet 2013-01-29 20:33:22 -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
Tim Chevalier
7bc919909a testsuite: Xfail file that I added by mistake 2013-01-29 13:42:21 -08:00
Patrick Walton
4ead38bae7 libsyntax: Implement the impl Trait for Type syntax 2013-01-29 11:48:21 -08:00
Tim Chevalier
1b021d5868 Long line 2013-01-29 11:44:46 -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
93043baab4 testsuite: Add #[allow(structural_records)] to pipes tests
These will require a snapshot.
2013-01-28 19:41:56 -08:00
Daniel Micay
8eaf0737b7 get rid of LinearMap's find_copy method 2013-01-28 16:06:09 -05: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
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
Brian Anderson
83ca034d2e Merge remote-tracking branch 'brson/nocommupstream2' 2013-01-26 14:57:58 -08:00
Tim Chevalier
6d4907a742 testsuite: Eliminate uses of structural records from most run-pass tests
Except the pipes tests (that needs a snapshot)
2013-01-26 11:35:17 -08:00
Tyler Bindon
5a69cd75fb Fix Option camel case in commented portion of test 2013-01-25 19:42:24 -07:00
Tyler Bindon
edc94f5c23 Fix Option camel case in xfailed/ignored tests 2013-01-25 19:42:23 -07:00
Brian Anderson
1ef83945c1 Merge remote-tracking branch 'brson/nocommupstream'
Conflicts:
	src/libcore/private.rs
	src/libcore/task/mod.rs
	src/libcore/task/spawn.rs
	src/libstd/net_tcp.rs
	src/libstd/uv_global_loop.rs
	src/libstd/uv_iotask.rs
2013-01-25 18:06:30 -08:00
Tim Chevalier
d753ad4ee4 testsuite: Fix Windows breakage harder in x86stdcall2 2013-01-25 16:58:04 -08:00
Graydon Hoare
d1f771ca34 test: fix x86stdcall test, r=burningtree. 2013-01-25 15:18:45 -08:00
Daniel Micay
e4337a9def remove remaining is_not_empty functions/methods 2013-01-24 23:24:57 -05:00
Erick Tryzelaar
5085eb3c28 Convert pipes::Buffer 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
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
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
Daniel Micay
bba5520d62 fix tests 2013-01-23 21:46:33 -05:00
Brian Anderson
b9608fe423 std: Convert uv_global_loop to use pipes 2013-01-23 17:35:34 -08:00
Patrick Walton
d9c842847d libsyntax: Fix parsing of pub unsafe fn inside extern blocks. rs=bugfix 2013-01-23 15:14:12 -08:00
Patrick Walton
54b2cad8b3 libsyntax: Remove fn() unsafe { ... }. r=graydon 2013-01-23 14:41:08 -08:00
John Clements
0b958e74ac renaming to adhere to conventions 2013-01-23 11:46:19 -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
Patrick Walton
778aec998b libsyntax: Implement the + syntax for multiple trait bounds. r=tjc 2013-01-23 11:15:10 -08: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
Tim Chevalier
54344c2468 testsuite: Add tests for mutable function arguments 2013-01-22 23:34:35 -08:00
Tim Chevalier
14d721388b Add test case for change in 039bfe 2013-01-22 16:22:55 -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
885f0a2eab testsuite: Un-xfail test for #3029 and move to run-fail 2013-01-20 20:35:24 -08:00
Tim Chevalier
b9920b052b testsuite: Tweak tests for #3888 2013-01-20 19:51:33 -08:00
Graydon Hoare
e51ec26dd7 xfail-fast the #[main] tests, r=burningtree 2013-01-18 17:44:26 -08:00
Niko Matsakis
532c94d0f1 Propagate expected types through block expressions.
r=graydon
2013-01-17 18:45:48 -08:00
Niko Matsakis
9fed56ed90 When decoding types, indicate to the def-id conversion function what kind of
def-id we have, so that the inliner can distinguish between external and
internal def-ids.  Also add some comments explaining the distinction!

Fixes #4516.

r=graydon
2013-01-17 18:45:45 -08:00
Patrick Walton
f405e41d7a librustc: Implement write guards for borrowing @mut to & or &mut. r=nmatsakis 2013-01-17 11:50:20 -08:00
Graydon Hoare
84825ee310 librustc: Make the default sigil for block lambdas & instead of @. 2013-01-15 17:57:45 -08:00
ILyoan
b7cefd0c96 allowing the entry point name to be something other than main
add build tests
2013-01-14 13:58:13 -08:00
Jed Davis
3aca4a1663 Regression tests for passing enum-typed consts by reference.
If the PointerCast in trans_def_lvalue is removed, these cases cause
LLVM assertion failures.
2013-01-11 23:42:51 -08:00
Jed Davis
79f0d67d28 Add more tests for enum constants.
The tests have consts defined both before and after their uses in order
to prevent bugs that depend on the order in which they are translated.
2013-01-11 23:42:51 -08:00
Andrew Paseltiner
ea937dca89 test: add test for overloading logical negation operator 2013-01-11 16:27:12 -05:00
Patrick Walton
a82c8b3da2 test: XFAIL issue_3882 due to strange Windows failure. rs=failure 2013-01-11 10:57:24 -08:00
Tim Chevalier
ae0ca9c646 Add working test for issue 3935 and xfailed test for issue 3888 2013-01-10 14:38:37 -08:00
Tim Chevalier
e0850d11ec Add test cases: one xfailed, one not 2013-01-10 14:16:02 -08:00
Tim Chevalier
8a687dd8e4 tests: Add two test cases, one xfailed 2013-01-10 13:44:27 -08:00
Niko Matsakis
737e115646 mode: reset mode on entry to fn body.
This is an interim fix to address the "Beware!" unsoundness.  I have a
more comprehensive rewrite of mode.rs in the pipeline.

r=pcwalton
2013-01-10 13:17:25 -08:00
Patrick Walton
2a1b6c4de9 librustc: Implement &static as the replacement for Durable. r=nmatsakis 2013-01-10 11:16:54 -08:00
Patrick Walton
982830c836 librustc: Allow the type parameter version of Self to be spelled with a capital S 2013-01-10 10:37:22 -08:00
Graydon Hoare
61210e01f9 test: fix check-fast breakage. 2013-01-10 10:24:18 -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
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
Tim Chevalier
80435ad429 Make self visible when typechecking nested functions
Necessary to allow supertrait methods to be called in default methods.

r=nikomatsakis
2013-01-08 13:56:26 -08:00
Patrick Walton
722d670c85 test: Fix botched regex. rs=bustage 2013-01-08 10:35:20 -08:00
Patrick Walton
1f667e7995 test: Regular expression mistake. rs=bustage 2013-01-07 22:13:34 -08:00
Patrick Walton
fcc470c0ee test: Fix check-fast for resolve changes. rs=bustage 2013-01-07 18:55:12 -08:00
Niko Matsakis
16ec9aa6e7 Support assignability for struct fields. r=pcwalton 2013-01-07 18:46:37 -08:00
Tim Chevalier
7b433d098a Revert "Change the self def_id to a self_info in typeck, and inherit"
This reverts commit 921393c568.
2013-01-07 18:18:22 -08:00
Tim Chevalier
921393c568 Change the self def_id to a self_info in typeck, and inherit
That is, treat `self` as if it has dynamic scope. This seems to
be harmless, and prevents an ICE as per #3563
2013-01-07 18:08:19 -08:00
Jed Davis
3e7ab3a443 Add a test for nullary univariant enums. 2013-01-05 00:49:01 -08:00
Tim Chevalier
1330b1cdf5 Add test cases (one xfailed, one not)
as per #3601 and #3609
2013-01-03 14:55:51 -08:00
Patrick Walton
19dfb47564 test: Fix test/run-pass/class-cast-to-trait-cross-crate-2. rs=fire 2012-12-28 18:04:41 -08:00
Patrick Walton
40eaecbd47 test: Fix a couple more tests. rs=bustage 2012-12-28 18:02:20 -08:00
Patrick Walton
c42d5e2747 test: Fix test/run-pass/pipe-pingpong-proto. rs=bustage 2012-12-28 17:33:28 -08:00
Patrick Walton
31b07ae8c5 test: Fix test/run-pass/pipe-pingpong-bounded. rs=bustage 2012-12-28 17:32:42 -08:00
Patrick Walton
f67c37263e test: Fix a bunch of run-pass tests. rs=bustage 2012-12-28 17:17:05 -08:00
Tim Chevalier
c880d0ab76 Add an xfailed test case and a CONTRIBUTING.md file 2012-12-27 14:58:45 -08:00
Tim Chevalier
0873553680 Merge pull request #4298 from JensNockert/byteswap
Add support for byteswap intrinsics
2012-12-27 10:47:15 -08:00
Jens Nockert
a51661e8c1 Add support for byteswap intrinsics
Adds support for the llvm.bswap.i{8,16,32} intrinsics, which swaps the
byte order from little endian to big endian, or the reverse.
2012-12-27 19:07:05 +01: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
efb8711f90 Merge branch 'master' of github.com:mozilla/rust into incoming 2012-12-27 10:34:27 -05:00
Tim Chevalier
8d438747a5 Remove xfail-fast from trait-composition-trivial 2012-12-24 18:29:01 -08:00
Tim Chevalier
d722217a68 tests: Add test case. Closes #3250 2012-12-24 18:29:01 -08:00
Graydon Hoare
329316ce15 bump 0.5 => 0.6, redirect some URLs in docs. 2012-12-24 18:29:01 -08:00