Commit Graph

2967 Commits

Author SHA1 Message Date
Eric Holk
9f287c211e Refcount tasks in packets to avoid races.
Revert "Once again, revert "Use pipes in compiletest""

Fixes #3098
2012-08-06 09:10:19 -07:00
Brian Anderson
025d86624d Switch alts to use arrows 2012-08-05 22:08:09 -07:00
Brian Anderson
a52f6d26db Fix closure pretty-print tests 2012-08-04 17:41:04 -07:00
Brian Anderson
a60f9c76f5 xfail-fast run-pass/trait-composition-trivial 2012-08-04 17:37:30 -07:00
Graydon Hoare
edfc79cc47 Translate const vecs, most of const slices. More for #2317. 2012-08-03 21:44:52 -07:00
Patrick Walton
f23674394f rustc: Merge fn& and fn in favor of fn&.
This is a step on the way to moving the function "proto" sigil out front.
2012-08-03 19:49:12 -07:00
Patrick Walton
51a5a4ad0e rustc: Translate repeated vector syntax 2012-08-03 18:49:44 -07:00
Graydon Hoare
488ece05b5 Implement &-expressions in consts. Part of #2317. 2012-08-03 18:07:58 -07:00
Ben Blum
f57760c609 Add task-perf-linked-failure.rs 2012-08-03 20:24:41 -04:00
Eric Holk
739e83d859 Xfailing until the pipe race is fixed. 2012-08-03 15:22:33 -07:00
Patrick Walton
5012abde8f test: Add a trivial test that trait composition parses 2012-08-03 15:03:19 -07:00
Eric Holk
2c06e7aac9 Fixing failing test cases 2012-08-03 12:48:14 -07:00
Patrick Walton
aa4683c181 test: Add a test case for bare static strings 2012-08-03 11:51:47 -07:00
Patrick Walton
4bfd4fb8ea test: Remove a fixed-length string from a test 2012-08-03 11:47:08 -07:00
Tim Chevalier
b0cf106e9a Test for issue 2904, which got fixed somewhere along the line 2012-08-03 11:39:39 -07:00
Eric Holk
b3933b8822 Adding a test case for #2548 2012-08-03 10:22:16 -07:00
Niko Matsakis
cc1a2f2128 fix compilation of 2214 2012-08-03 08:05:04 -07:00
Tim Chevalier
948172b93f Make comparisons between region pointers work
Region pointers were considered a scalar type, so compare_scalar_type would
get called to compare region pointers in trans. This would fail, since
compare_scalar_type has no case for region pointers.

Changed type_is_scalar to return false for region pointers. This had the side
effect of breaking casts to types of the form &T. To ameliorate that, I added
library functions ptr::assimilate (taking a &T to a *T) and ptr::to_uint
(taking a &T to a uint), both of which use reinterpret_cast.

While I was at it, I removed ty::type_has_resources, which is dead code.
2012-08-02 23:53:45 -07:00
Niko Matsakis
31c5cec55b Purge placement new; Make borrowck know about unary move.
cc #3071
2012-08-02 22:36:36 -07:00
Tim Chevalier
c2bb2f0837 When checking loop bodies and do-expr bodies, don't require the expected type to exist
If the expected type is none (due to a type error), we shouldn't fail with an ICE, but
rather, just print out another type error. Changed the do-expr type error message to
make sense in this context (see the test case for how it works).

Closes #3044.
2012-08-02 21:44:14 -07:00
Eric Holk
f76a46242b Convert pfib to pipes. This is a useful stress test. 2012-08-02 18:55:44 -07:00
Eric Holk
1f2178e2d3 Removing an obsolete benchmark 2012-08-02 18:55:44 -07:00
Lindsey Kuper
2f832d4b2d test: "iface" -> "trait" in filenames. 2012-08-02 17:58:56 -07:00
Niko Matsakis
97452c0ca1 Remove modes from map API and replace with regions.
API is (for now) mostly by value, there are options to use it by
reference if you like.  Hash and equality functions must be pure
and by reference (forward looking to the day when something
like send_map becomes the standard map).
2012-08-02 15:53:28 -07:00
Paul Stansifer
7129883b51 Allow interpolations of all the nt_*s. 2012-08-02 11:58:16 -07:00
Ben Blum
8d7dfa44b0 Linked failure: Add '100 generations' bench test (#1868) 2012-08-02 00:07:12 -04:00
Brian Anderson
b355936b4d Convert ret to return 2012-08-01 19:16:06 -07:00
Brian Anderson
507fba57d1 syntax: Allow any block-like expr to be used as alt arm w/o comma separator 2012-08-01 17:57:03 -07:00
Graydon Hoare
7f60c56c3e Clean out transitional lint. 2012-08-01 13:35:40 -07:00
Niko Matsakis
a334deb5d5 change how we print and explain region types 2012-07-31 22:00:19 -07:00
Brian Anderson
c5437c0bbf Fix failing tests 2012-07-31 21:13:57 -07:00
Patrick Walton
82198c9925 test: Fix broken test that used "move" as an identifier 2012-07-31 19:27:23 -07:00
Brian Anderson
a841789a41 rustc: Add non_camel_case_types lint check 2012-07-31 18:58:23 -07:00
Graydon Hoare
2a3084b527 Start implementing structured constants. 2012-07-31 18:34:44 -07:00
Patrick Walton
c88933d714 rustc: Implement unary move. Closes #917. 2012-07-31 17:33:20 -07:00
Brian Anderson
c4bb8f8aaf test: Move two tests from run-pass into the libs 2012-07-31 17:30:54 -07:00
Brian Anderson
7b2026bf21 Introduce 'return', 'match' and 'module' as synonyms 2012-07-31 17:22:30 -07:00
Brian Anderson
7d18369804 syntax: Rename 'module' extension to 'module_path' 2012-07-31 17:22:30 -07:00
Brian Anderson
567f881fdf syntax: More tweaks to make alt arrows parse and print correctly 2012-07-31 15:41:26 -07:00
Niko Matsakis
c206d024eb accept naked exprs with commas in pattern arms
pretty printing will use them, but indentation is slightly off
if the expr is long
2012-07-31 15:41:26 -07:00
Lindsey Kuper
439afaa329 Change remaining "iface" occurrences to "trait"; deprecate "iface" 2012-07-31 11:52:16 -07:00
Paul Stansifer
bf8c773936 Update tests for macro syntax change. 2012-07-30 18:38:15 -07:00
Paul Stansifer
a9cc5066ee Change syntax extension syntax: #m[...] -> m!{...}. 2012-07-30 18:38:15 -07:00
Paul Stansifer
a7125971c6 Rename #mod -> #module to not collide with the keyword. 2012-07-30 18:04:18 -07:00
Brian Anderson
f6ce2bd831 test: Add a test for mods inside functions. Closes #493 2012-07-30 18:00:56 -07:00
Lindsey Kuper
f78776e9d8 rustc: "iface" -> "trait" in comments, error messages, and identifiers.
(Also "interface" -> "trait" in error messages.)
2012-07-30 17:26:14 -07:00
Brian Anderson
ef29f7ff36 syntax: Fix semicolon printing. Closes #3036 2012-07-30 16:09:52 -07:00
Elliott Slaughter
416584d339 Revert "Fix build by xfailing tests which produce irreducible CFGs."
This reverts commit 9ca2a11137.
2012-07-30 15:58:23 -07:00
Niko Matsakis
5d32d03b89 Fix #2979: inference for lifetimes of & expressions
What we now do is to create a region variable for each &
expression (and also each borrow).  The lifetime of this
variable will be checked by borrowck to ensure it is not greater
than the lifetime of the underlying data.  This both leads to
shorter lifetimes in some cases but also longer in others,
such as taking the address to the interior of unique boxes
tht are rooted in region pointers (e.g., returning a pointer
to the interior of a sendable map).

This may lead to issue #2977 if the rvalue is not POD, because
we may drop the data in trans sooner than borrowck expects us
to.  Need to work out precisely where that fix ought to occur.
2012-07-30 14:49:28 -07:00
Brian Anderson
6ef13e76e9 Reduce the difficulty of run-pass/bitv-perf-test. Valgrinds slowly 2012-07-30 12:04:58 -07:00
Tim Chevalier
082d8314da Rewrite bitv to use classes and optimize its representation
Rewrote bitv as a class that uses a 32-bit int as its representation
for bit vectors of 32 bits or less, and a vector (the old representation)
otherwise. I didn't benchmark very much, but a bit of informal benchmarking
suggested this is a win.

Closes #2341
2012-07-29 18:39:15 -07:00
Patrick Walton
93c2f5e0e4 rustc: Use coherence for operator overloading.
The only use of the old-style impls is now placement new.
2012-07-27 19:35:24 -07:00
Tim Chevalier
f7382c454f Forbid duplicate fields in record types and exprs
Closes #3033
2012-07-27 17:33:05 -07:00
Tim Chevalier
a0d05844ed Correctly forbid upvars in nested impls, traits and classes
Previously, resolve was allowing impls, traits or classes that were
nested within a fn to refer to upvars, as well as referring to type
parameters bound by the fn. Fixing this required adding a new kind of
def: def_typaram_binder, which can refer to any of an impl, trait or
class that has bound ty params. resolve uses this to enforce that
methods can refer to their parent item's type parameters, but not to
outer items' type parameters; other stages ignore it. I also made
sure that impl, trait and class methods get checked inside a
MethodRibKind thing so as to forbid upvars, and changed the definition
of MethodRibKind so that its second argument is an optional node_id
(so that required trait method signatures can be checked with a
MethodRibKind as well).
2012-07-27 17:31:42 -07:00
Niko Matsakis
638491712e change region inference to not consider & that appears in a fn
type as indicating region parameterization
2012-07-27 15:49:03 -07:00
Brian Anderson
2407373fa4 core: Make #fmt pure 2012-07-27 15:11:22 -07:00
Tim Chevalier
b6aadf56c8 In resolve, check for duplicate pattern-bound vars
Closes #3038
2012-07-27 13:35:17 -07:00
Tim Chevalier
300f54ebc0 Make alts on uninhabited enum types typecheck and translate properly
Possibly one of the silliest Rust commits ever.

Closes #3037
2012-07-27 13:14:03 -07:00
Eric Holk
3c731df890 re-xfailing pingpong 2012-07-26 17:11:04 -07:00
Eric Holk
79f5d62d47 Added .peek for recv_packets 2012-07-26 17:10:48 -07:00
Eric Holk
c918bd01b0 Fix borrow check errors in k-nucleotide. 2012-07-26 17:10:48 -07:00
Eric Holk
65beca4e01 Use iteration protocol for ebml, use vec::view in more places (issue #2880) 2012-07-26 17:10:48 -07:00
Graydon Hoare
dbbaa50290 Nomenclature fixes in the lint checker. Fewer double-negatives.
New style is allow(foo), warn(foo), deny(foo) and forbid(foo),
mirrored by -A foo, -W foo, -D foo and -F foo on command line.

These replace -W no-foo, -W foo, -W err-foo, respectively.

Forbid is new, and means "deny, and you can't override it".
2012-07-26 17:08:33 -07:00
Damian Gryski
74d60a619a shootout-mandelbrot: devnull writer needs get_type impl 2012-07-26 17:05:13 -07:00
Paul Stansifer
97422f0f0f Merge branch 'incoming' of github.com:mozilla/rust 2012-07-26 16:16:28 -07:00
Tim Chevalier
20c6f3c37a Add xfailed test case for #3029 2012-07-26 14:51:10 -07:00
Tim Chevalier
c8ea9fc4c3 Re-added test for Issue 935 -- not sure what happened to it 2012-07-26 14:47:30 -07:00
Tim Chevalier
d19b915bc4 Add test for issue 868 2012-07-26 14:29:47 -07:00
Paul Stansifer
f4c093c4af Change #macro to macro_rules! in some cases. 2012-07-26 10:14:01 -07:00
Graydon Hoare
f8dc9283ad Reject non-UTF-8 files when reading as str. Close #2918. 2012-07-25 15:34:18 -07:00
Eric Holk
531ea695f6 Remove shared_arc (unused) and fix trivial-message 2012-07-25 15:15:46 -07:00
Eric Holk
08a77e06a8 Rewrite task-comm-NN to use pipes 2012-07-25 15:15:46 -07:00
Graydon Hoare
43867bf6f3 Merge pull request #3014 from elliottslaughter/fix-failed-build-by-xfailing-tests
Fix build by xfailing tests which produce irreducible CFGs.
2012-07-25 14:50:02 -07:00
Elliott Slaughter
9ca2a11137 Fix build by xfailing tests which produce irreducible CFGs. 2012-07-25 14:42:37 -07:00
Eric Holk
6748f78cb1 Polymorphic protocols work well enough to do MapReduce.
I did some horrible things with type variable naming here. It should do the right thing in most cases, but we'll need to go through and make it correct someday.
2012-07-25 12:12:26 -07:00
Eric Holk
f5be06fa1f Added infrastructure to spin for a bit on recv. A spin count > 0 makes bench/pingpong.rs about 10x faster, but makes msgsend-ring-pipes unbearably slow. 2012-07-25 12:12:25 -07:00
Eric Holk
35576168dc Added a benchmark of bounded vs unbounded. Bounded is 8-12% faster. The macros currently don't work without pretty printing first. 2012-07-25 12:12:25 -07:00
Eric Holk
7f5f1f90a0 Compiled a bounded version of pingpong.
There are some failures in the other pipe tests, but these seem to just be a matter of generalizing the library code.

Updating pipes library so all tests pass again
2012-07-25 12:12:25 -07:00
Eric Holk
c28af26258 Refactor the bounded pingpong example to avoid needing to generate unsafe code.
Took some steps towards bounded codegen.
2012-07-25 12:12:25 -07:00
Eric Holk
4f29814f2a Hand-written bounded pingpong implementation. 2012-07-25 12:12:25 -07:00
Eric Holk
f65d6026ef Started playing with macros to make receiving easier 2012-07-25 12:12:25 -07:00
Graydon Hoare
1e241b5abd Merge pull request #3009 from elliottslaughter/utf8-idents-test-fix
Fix test floating point comparison to tolerate imprecise FPUs.
2012-07-25 10:20:40 -07:00
Niko Matsakis
99674dc52b avoid capture of bound regions when infering types for closure
expressions. cc #2981
2012-07-25 05:45:52 -07:00
Niko Matsakis
168306f11b correct treatment of mutability for deref'd components
Fixes #2980
2012-07-25 05:45:52 -07:00
Patrick Walton
22ef08293e test: Add a max/min classes test case 2012-07-24 16:39:26 -07:00
Elliott Slaughter
1e27d1994f Fix test floating point comparison to tolerate imprecise FPUs. 2012-07-24 16:15:30 -07:00
Eric Holk
d948254ccb Fix xfail comment 2012-07-24 14:56:59 -07:00
Eric Holk
22e3a8506f Test case for #3005 2012-07-24 14:56:02 -07:00
Graydon Hoare
8868b222c3 Fix whitespace. 2012-07-24 13:21:25 -07:00
Graydon Hoare
a63e0e47f0 Update some str functions to slices, merge as_buf and unpack_slice. 2012-07-24 12:35:52 -07:00
Erick Tryzelaar
6d042c0f2d tests: Rename to avoid colliding with real rust-zmq. 2012-07-23 17:15:30 -07:00
Ben Blum
b30a58abe2 Convert bench and run-pass tests to new task_builder interface 2012-07-23 20:09:17 -04:00
Ben Blum
80f4e9f2ec Oops, xfail-win32 task-killjoin-rsrc 2012-07-23 17:36:03 -04:00
Ben Blum
81f108154a Fix and un-xfail task-killjoin-rsrc.rs 2012-07-23 16:15:12 -04:00
Ben Blum
d0fb85359a Add task::spawn_unlinked and start migrating away from task::unsupervise 2012-07-23 16:06:29 -04:00
Elliott Slaughter
de82a9be61 Move fail upcall into rust libcore. 2012-07-23 10:45:58 -07:00
Niko Matsakis
f676547c97 Fix intersection of two region params in infer, cc #2962 2012-07-19 10:14:16 -07:00
Patrick Walton
978ca03cb2 Revert "accept naked exprs with commas in pattern arms" due to pretty-printing failures
This reverts commit f712b2d76b.

In alt arms, the parser needs to do a little lookahead to determine
whether it's looking at a record literal or a block.

Also there are some indentation issues in the expected source.
2012-07-19 07:53:55 -07:00
Patrick Walton
00aa5f163f test: XFAIL some more in an effort to unbreak the tree 2012-07-19 07:30:37 -07:00
Patrick Walton
f82db5d136 test: Change the expected error message on iface-test.rs to contain "trait" instead of "interface" 2012-07-18 20:42:14 -07:00
Patrick Walton
6cb38aeb43 test: XFAIL issue-1466.rs due to cycle collector crashes.
I don't want to do this, but the tree has been in a state of chaos for days
and it's not clear what can be backed out to fix this test.
2012-07-18 20:39:56 -07:00
Niko Matsakis
f712b2d76b accept naked exprs with commas in pattern arms
pretty printing will use them, but indentation is slightly off
if the expr is long
2012-07-18 20:16:41 -07:00
Tim Chevalier
35bd579f66 Remove nonexistent imports 2012-07-18 18:32:34 -07:00
Tim Chevalier
3119afc6e8 In resolve3, error on non-existent imports
Closes #2937
2012-07-18 18:02:07 -07:00
Ben Blum
5506bf1480 xfail issue-506 - broken on darwin 2012-07-18 19:55:18 -04:00
Niko Matsakis
e0ea67a2a6 prevent regions from escaping in ifaces; remove &r.T syntax 2012-07-18 11:48:58 -07:00
Niko Matsakis
eb0a34c398 iterate only over immutable vectors; use newer region notation
Unfortunately, right now iterating over const vectors is
not safe.  This is because the callback expects an *immutable*
reference (in region terms: &T), not a const reference (&const T).
This was not being caught by the type system due to the use of
unsafe operations.  To fix this, we need to either (1) find a way
to parameterize over mutability or (2) add each_const, each_mut
etc
2012-07-18 11:48:58 -07:00
Ben Blum
30d94fe9a2 finish fixing broken un-unsupervise windows tests 2012-07-17 22:16:55 -04:00
Ben Blum
93bb030a8c fix no-longer-unsupervise test cases on windows 2012-07-17 21:48:15 -04:00
Ben Blum
03cdc2476d Change all test/run-pass uses of rustrt::unsupervise() to something else 2012-07-17 21:19:23 -04:00
Eric Holk
7b8171ef2d Added liveness analysis for protocols, and removed warnings about empty states. 2012-07-17 17:46:31 -07:00
Michael Sullivan
aa5b5ab886 Create some infrastructure for building up @-vectors. Work on #2921. 2012-07-17 17:09:25 -07:00
Patrick Walton
db020ab63c rustc: Implement and enforce instance coherence 2012-07-17 15:46:43 -07:00
Tim Chevalier
b5729bd600 Support attributes on class ctors and dtors
Closes #2660
2012-07-17 12:40:59 -07:00
Niko Matsakis
0e42004bab introduce an owned kind for data that contains no borrowed ptrs 2012-07-16 20:18:18 -07:00
Graydon Hoare
d809336d0f Fix reflection on vstore_fixed estrs and evecs. 2012-07-16 17:08:27 -07:00
Eric Holk
053bdcac2d Test case for #2930 2012-07-16 15:12:53 -07:00
Eric Holk
d39f6fc676 Add support for terminal states (issue #2862) 2012-07-16 14:50:47 -07:00
Gareth Daniel Smith
fe43d66613 replace core::tuple functions with methods 2012-07-16 22:33:20 +01:00
Niko Matsakis
3ef7ff8b89 infer the scope of borrows 2012-07-14 17:37:32 -07:00
Niko Matsakis
41a21f053c remove typestate from code, tests, and docs 2012-07-14 17:37:20 -07:00
Michael Sullivan
6822ec3eb4 Treat bare vector and string literals as fixed length vecs. Closes #2922. 2012-07-14 14:30:48 -07:00
Michael Sullivan
d884085f43 Tear out ty_str and ty_vec. 2012-07-14 12:19:36 -07:00
Michael Sullivan
92743dc2a6 Move the world over to using the new style string literals and types. Closes #2907. 2012-07-14 01:03:43 -07:00
Michael Sullivan
f5e69d611e Change the pretty printer to print vstores for strs in prefix notation. 2012-07-13 17:03:54 -07:00
Michael Sullivan
985b52be6d Support prefix notation for vstore strings. Closes #2906. 2012-07-13 17:03:49 -07:00
Eric Holk
9728d14bae Fix hang in pipe-select when RUST_THREADS=1 2012-07-13 16:03:02 -07:00
Lindsey Kuper
5a63b2100e More consistent use of backticks and "expected" in error messages.
Got some of the debug messages, here, too.  I figure it doesn't hurt
to get used to doing this even in places where users won't ever see
it.
2012-07-13 15:31:39 -07:00
Tim Chevalier
ee73b78e04 Test for #2288 2012-07-13 14:45:15 -07:00
Michael Sullivan
d7f4d8d12b Actually xfail the test properly. Argh. 2012-07-13 14:05:28 -07:00
Michael Sullivan
05ff4f416b xfail a broken seeming test. 2012-07-13 13:06:39 -07:00
Tim Chevalier
3c011aab74 Extra test for #2311 2012-07-13 13:03:21 -07:00
Tim Chevalier
cd31b7cf5c Un-xfail test that works. Closes #2883 2012-07-13 12:04:38 -07:00
Niko Matsakis
fa3dbb7f73 add xfail-fast directive due to aux-build 2012-07-13 10:47:20 -07:00
Niko Matsakis
4c463b78fb repair error msg 2012-07-13 10:20:51 -07:00
Niko Matsakis
9504778e2a add xfail-fast directive 2012-07-13 10:20:50 -07:00
Niko Matsakis
90e435e808 change region syntax to &r/T in place of &r.T 2012-07-13 10:20:50 -07:00
Eric Holk
05543fd04d Make tests pass 2012-07-12 20:09:30 -07:00
Tim Chevalier
78ec6fe30c Obliterate the callee_id hack
Exprs that could be applications of overloaded operators
(expr_unary, expr_binary, expr_index) relied on the previous node ID
being "reserved" to carry extra typechecking info. This was
incredibly error-prone. Fixed it; now all exprs have two node IDs
(which will be wasted in some cases; future work could make this
an option instead if the extra int field ends up being a performance
problem).

Closes #2804
2012-07-12 19:02:07 -07:00
Eric Holk
fec8059ed5 Move port_set and shared_chan into core. 2012-07-12 18:16:01 -07:00
Eric Holk
ba10819800 Added a message send that uses shared chans. They are slower than port selectors, but scale better. 2012-07-12 18:16:01 -07:00
Eric Holk
75e55c1b12 Faster select. This version gives us about a 4x speedup. 2012-07-12 18:16:01 -07:00
Eric Holk
c56a38ac2a Added a version of msgsend that uses pipes and select. Here, select is way too slow to be useful, but this can be optimized. 2012-07-12 18:16:00 -07:00
Eric Holk
1a276dba52 Switch map-reduce control protocol to use pipes. This exposed a bug in the pipe compiler, which is now fixed.
Use hashmaps in MapReduce

Tweak word-count difficulty
2012-07-12 18:16:00 -07:00
Tim Chevalier
a407f74d6d Update and un-xfail reflect-visit-data 2012-07-12 18:09:31 -07:00
Tim Chevalier
e8e143b9d7 Comments only: annotate FIXMEs in tests 2012-07-12 18:09:31 -07:00
Brian Anderson
dac4916cec rustc: Resolve bounds of trait type parameters 2012-07-12 18:04:40 -07:00
Graydon Hoare
18da7fef88 Merge remote-tracking branch 'origin/dist-snap' into incoming 2012-07-12 17:14:55 -07:00
Michael Sullivan
2ea9c8df0f Accept prefix notation for writing the types of str/~ and friends. 2012-07-12 16:52:26 -07:00
Michael Sullivan
1c62f5ff74 Get rid of all of the remaining /~s in the code base. 2012-07-12 15:13:18 -07:00
Brian Anderson
46fba10fe8 rustc: Make all impls even more reachable
With this we write metadata for all impls so that we can properly find
reexported impls.
2012-07-12 15:09:33 -07:00
Michael Sullivan
9d2e5f3a65 Merge branch 'rt-changes' into incoming 2012-07-12 15:03:54 -07:00
Michael Sullivan
7b26503566 Make str be treated as str/~. 2012-07-12 00:21:04 -07:00
Niko Matsakis
b9aa9def85 infer when types are region parameterized rather than requiring /&
- removes various fields from various variants in the AST
- also update tests not to use this notation
2012-07-11 14:41:41 -07:00
Tim Chevalier
c0961bb88f Test for #2723. Closes #2723 2012-07-11 12:34:21 -07:00
Paul Stansifer
650009f80c Test (but don't pretty-print) the new macro system. 2012-07-11 12:06:47 -07:00
Michael Sullivan
120773b2a7 Change the interface of placement new to take a tydesc as part of Issue #2831. 2012-07-11 11:42:49 -07:00
Eric Holk
bf88ff5217 Remove slow vec+=, and make word-count difficulty harder. 2012-07-11 11:36:37 -07:00
Eric Holk
a00478b7c9 word-count-generic now generates random words in benchmark mode. 2012-07-11 11:36:37 -07:00
Tim Chevalier
1806707dcb Add test case for #2869 (xfailed) 2012-07-11 11:18:43 -07:00
Graydon Hoare
aa7b3cc929 Fix some version numbers. 2012-07-11 09:09:08 -07:00
Eric Holk
424ae442c5 xfailing pipe-select on Windows, because it also uses fail. 2012-07-10 23:42:57 -07:00
Tim Chevalier
7b4190d4e9 Test for issue 2735
This probably doesn't test the actual bug, but the fix for
issue 2734 probably camouflages the actual bug (since the
effect of the #2734 test case is now "do nothing observable"
rather than "segfault").

Closes #2735
2012-07-10 23:10:21 -07:00
Tim Chevalier
e958cbe799 Un-xfail issue 2734 test
because I guess I forgot to do that when I fixed the bug.
2012-07-10 23:10:21 -07:00
Eric Holk
203da7e814 xfailing pipe-detect-term on Windows, because it requires failure. 2012-07-10 23:02:11 -07:00
Eric Holk
71339d9e69 Pipe code cleanup 2012-07-10 22:00:48 -07:00
Eric Holk
22e955a76a Move streams into core. 2012-07-10 22:00:48 -07:00
Eric Holk
594d9a0554 Use protocol compiler in future.rs. Also split recv into recv and try_recv. 2012-07-10 22:00:48 -07:00
Eric Holk
26e6eb3d14 Handle failure conditions correctly in pipes. 2012-07-10 22:00:47 -07:00
Eric Holk
d07e537fc3 Remember to wake up blocked task on sender terminate. 2012-07-10 22:00:46 -07:00
Eric Holk
1c1b3a3339 Added peek for pipes. 2012-07-10 22:00:46 -07:00
Eric Holk
69cd8b5fcb Added select2 for pipes. 2012-07-10 22:00:45 -07:00
Eric Holk
801e049617 Added a test case for issue #2834. 2012-07-10 22:00:41 -07:00
Tim Chevalier
f39477d926 In resolve, check that an or-pattern has the same number of bindings in each disjunct
resolve3 wasn't checking this. Added test cases. Also added a helpful informational
message in the case where you have a variable binding that you probably think
refers to a variant that you forgot to import.

This is easier to do in resolve than in typeck because there's code in typeck
that assumes that each of the patterns binds the same number of variables.
2012-07-10 18:24:41 -07:00
Graydon Hoare
0a4a602a23 Modify reflect interface to pass tydescs back to client, stop on false return.
These changes are required to prune type-recursion and admit early
returns in the visitor code. Changes to visitors in subsequent csets.
2012-07-10 15:16:48 -07:00
Michael Sullivan
bf06deafe6 Disallow implicitly binding methods in typechecker. Closes #2189. 2012-07-10 15:12:13 -07:00
Michael Sullivan
40fc1737b2 Get rid of places that expected foo.bar to implicitly bind. 2012-07-10 15:12:12 -07:00
Michael Sullivan
0070527383 Pretty print vectors as ~[] instead of []/~. Closes #2863. 2012-07-10 13:55:19 -07:00
Brian Anderson
71fd542f26 test: Fix shootout-binarytrees 2012-07-10 12:09:36 -07:00
Brian Anderson
1e8ae18ba1 test: Fix shootout-fasta 2012-07-10 12:05:23 -07:00
Tim Chevalier
78088fb813 Add test case for issue 2766, which resolve 3 fixes 2012-07-09 19:16:23 -07:00
Paul Stansifer
54741b9427 Allow defining token tree macros. They should work now! 2012-07-09 17:44:46 -07:00
Graydon Hoare
9b6e90d2b5 Xfail-fast a recent test that doesn't work on check-fast. 2012-07-09 16:08:11 -07:00
Graydon Hoare
3f9a3469c7 Catch one missing residual 'cont' -> 'again' change. 2012-07-09 15:15:39 -07:00
Graydon Hoare
f210deae3d Merge branch 'incoming' of github.com:/mozilla/rust into incoming
Conflicts:
	src/snapshots.txt
2012-07-09 14:38:37 -07:00
Graydon Hoare
c26d02557e Switch 'cont' to 'again' everywhere. Close #2229. 2012-07-09 14:37:48 -07:00
Niko Matsakis
f72487d196 Remove xfail-test from (now functional) test. Fixes #2323. 2012-07-09 14:24:25 -07:00
Michael Sullivan
5c914e4a9d Add clear methods to the tests that make maps. 2012-07-09 14:16:24 -07:00
Brian Anderson
b7a418e194 rustc: Conditionally compile view items. #2357 2012-07-09 14:09:03 -07:00
Brian Anderson
547bf7c350 test: xfail-fast extern-crosscrate 2012-07-09 13:41:32 -07:00
Josh Matthews
a7f6e00944 Fix metadata serialization of foreign functions. Properly take the value of foreign functions from other crates to fix #1840. 2012-07-09 13:13:49 -07:00
Patrick Walton
f3b50ae348 test: Remove failing parts of the failing test (requires intertwining of resolve and typechecking) 2012-07-09 12:55:00 -07:00
Ben Blum
8ffab392ab change borrowck error msg: 'declared in outer block' -> 'captured in a closure' (properly this time) 2012-07-09 14:01:39 -04:00
Patrick Walton
e41029d236 rustc: Switch to the new resolution pass 2012-07-09 10:27:13 -07:00
Brian Anderson
02ef651f95 Increase the difficulty of chameneos-redux under 'make perf' 2012-07-07 22:39:23 -07:00
Kevin Cantu
638ee23fcf Add improvements suggested by erickt and bblum 2012-07-07 22:27:00 -07:00
Kevin Cantu
2bd482ef11 Add the Alioth chameneos-redux benchmark
This adds a Rust implementation of the Alioth chameneos-redux benchmark:
http://shootout.alioth.debian.org/u64q/performance.php?test=chameneosredux

This version already seems faster than Clojure, Ruby, and OCaml. I'm running
with N=6,000,000 in about 1m 50s.  Further optimization would be good, though.

I'm talking right now with @eholk about how pipes could be used (this is 1:many)...
2012-07-07 22:27:00 -07:00
Niko Matsakis
a856bccdc6 Revert "rustc: Switch to the new resolution pass"
This reverts commit c4af6e92fb.

Branch was burning...many, many unresolved imports.
2012-07-06 20:45:06 -07:00
Patrick Walton
c4af6e92fb rustc: Switch to the new resolution pass 2012-07-06 19:07:26 -07:00
Michael Sullivan
038f925586 Be less eager about implicit borrowing when doing method resolution. Closes #2796. 2012-07-06 15:55:18 -07:00
Eric Holk
e20f63d095 Bank protocol example from blog post 2012-07-06 15:25:06 -07:00
Eric Holk
b925648ac7 Added a k-nucleotide version that uses pipes. 31% speedup. 2012-07-06 15:16:16 -07:00
Michael Sullivan
ee0177b908 Move string append to libraries. Closes #2710. 2012-07-06 13:37:56 -07:00
Eric Holk
604f7c66ff Removing locked queue port/chan prototype. 2012-07-06 11:05:28 -07:00
Eric Holk
7b03832c95 Updating tests to use pipes. 2012-07-06 10:42:41 -07:00
Eric Holk
f0ef4ef81b You can have any protocol you want, provided it's pingpong.
This integrates the pipe compiler into the proto syntax extension.
2012-07-06 10:42:40 -07:00
Eric Holk
05cdda3a2c Plumbing and parsing for item-position macros. 2012-07-06 10:42:40 -07:00
Eric Holk
a787f40013 Select on pipes.
Updating syntax and test cases.
2012-07-06 10:42:39 -07:00
Eric Holk
a4838c93aa Enabling pipes for all stages, and updating closure syntax. 2012-07-06 10:42:39 -07:00
Eric Holk
67b0760592 Moved pipes runtime support to libcore, and add a test that will help verify that busy waiting is no longer happening.
Fixing the result of a bad merge.
2012-07-06 10:42:39 -07:00
Eric Holk
5c3889a02f Contracts work well enough to do the message ring benchmark, and it's really fast.
Fixing old-style vector, and xfail-prettying th contracts test because the pretty printer is unhappy.
2012-07-06 10:42:38 -07:00
Eric Holk
5d35435fac send only takes one data argument. 2012-07-06 10:42:38 -07:00
Eric Holk
0ad7ae523c Macro and iface tricks to simulate self move. 2012-07-06 10:42:38 -07:00
Eric Holk
c2d3cdc3df Progress towards pipes. 2012-07-06 10:42:38 -07:00
Eric Holk
61be3cc19e An example using pipes with most of the synchronization code in place.
Fixed a bug in the atomic intrinsics where they wouldn't correctly return their old value.

Pipes currently busy wait. The next step is to teach the scheduler how to deal with them.
2012-07-06 10:42:38 -07:00
Eric Holk
4dbd10a702 First example of a program using pipes. 2012-07-06 10:42:37 -07:00
Brian Anderson
9b2d988df0 Fix test that was using rust_task_allow_kill incorrectly 2012-07-05 21:33:47 -07:00
Ben Striegel
d162fa26ba A new times method on numeric types
This method is intended to elegantly subsume two common iteration functions.
The first is `iter::range`, which is used identically to the method introduced
in this commit, but currently works only on uints. The second is a common case
of `{int, i8, uint, etc.}::range`, in the case where the inductive variable is
ignored. Compare the usage of the three:
```
for iter::range(100u) {
    // do whatever
}

for int::range(0, 100) |_i| {
    // do whatever
}

for 100.times {
    // do whatever
}
```
I feel that the latter reads much more nicely than the first two approaches,
and unlike the first two the new method allows the user to ignore the specific
type of the number (ineed, if we're throwing away the inductive variable, who
cares what type it is?). A minor benefit is that this new method will be
somewhat familiar to users of Ruby, from which we borrow the name "times".
2012-07-05 19:44:20 -07:00
Lindsey Kuper
47f61c5429 Clean up error message punctuation/capitalization 2012-07-05 16:18:58 -07:00
Tim Chevalier
889be71cb4 Comments only: change TODOs to FIXMEs and annotate them 2012-07-05 16:10:29 -07:00
Michael Sullivan
b0d4f09201 Consider slices to be a structural type. Closes #2748. 2012-07-05 14:48:23 -07:00
Eric Holk
d93f3c5d83 Arc requires send trait (issue #2788) 2012-07-05 10:25:38 -07:00
Gareth Daniel Smith
be0141666d convert doc-attributes to doc-comments using ./src/etc/sugarise-doc-comments.py (and manually tweaking) - for issue #2498 2012-07-04 19:18:13 -07:00
Brian Anderson
bfa43ca301 Add tests for various ways to write 'do' and 'for' without args 2012-07-04 17:30:46 -07:00
Ben Striegel
f2e2a14f36 Remove empty argument lists from do expressions 2012-07-04 17:21:29 -07:00
Patrick Walton
3f06a8c8d5 test: Try to work around a resolve1 bug in class-cast-to-iface-cross-crate-2 2012-07-03 20:12:01 -07:00
Patrick Walton
139d843dce test: Make run-fail/zip-different-lengths not rely on resolve bugs 2012-07-03 19:09:31 -07:00
Patrick Walton
d66948604a test: Fix cyclic import in class-cast-to-iface-cross-crate-2 2012-07-03 18:32:47 -07:00
Patrick Walton
25e0455d04 test: Make tag-exports not use the obsolete tag export syntax 2012-07-03 18:32:47 -07:00
Brian Anderson
41bca84dd9 core: Convert iter::repeat to the for protocol 2012-07-03 17:31:31 -07:00
Brian Anderson
ae6ea068a1 Revert "Remove rule requiring non-nil block-style statements to be semi-terminated"
This reverts commit 0f5eaef5fb.
2012-07-03 17:30:25 -07:00
Brian Anderson
0f5eaef5fb Remove rule requiring non-nil block-style statements to be semi-terminated
This is a subtle rule that no longer seems to be required.
2012-07-03 17:03:52 -07:00
Graydon Hoare
be2c92078b Change crust -> extern. 2012-07-03 16:49:46 -07:00
Graydon Hoare
7762c80d1b Fix more future::future breakage. 2012-07-03 16:16:45 -07:00
Graydon Hoare
debb7e4641 Switch 'native' to 'extern' (or 'foreign' in some descriptions) 2012-07-03 16:11:00 -07:00
Patrick Walton
f093d374ed rustc: Implement a new resolve pass behind a compile flag 2012-07-02 18:30:12 -07:00
Brian Anderson
0b1edb7f0e Update compile-fail/missing-do for new error-comment syntax 2012-07-02 17:39:52 -07:00
Armin Ronacher
1f80b9b90a Added testcase for the missing do compile note 2012-07-02 17:33:57 -07:00
Lindsey Kuper
d90a1dee43 Start sketching some traitorous code (xfail'd) 2012-07-02 17:12:30 -07:00
Brian Anderson
47f43da376 Merge branch 'doc-comments' 2012-07-02 15:31:33 -07:00
Brian Anderson
569467eb0d Merge remote-tracking branch 'Dretch/prettydocs'
Conflicts:
	src/compiletest/errors.rs
	src/libsyntax/parse/attr.rs
	src/libsyntax/parse/comments.rs
	src/test/compile-fail/ambig_impl_unify.rs
	src/test/compile-fail/assign-super.rs
	src/test/compile-fail/bad-for-loop.rs
	src/test/compile-fail/bad-var-env-capture-in-block-arg.rs
	src/test/compile-fail/block-arg-as-stmt-with-value.rs
	src/test/compile-fail/borrowck-assign-comp-idx.rs
	src/test/compile-fail/borrowck-lend-flow.rs
	src/test/compile-fail/borrowck-loan-blocks-move-cc.rs
	src/test/compile-fail/borrowck-loan-blocks-mut-uniq.rs
	src/test/compile-fail/borrowck-loan-rcvr.rs
	src/test/compile-fail/borrowck-loan-vec-content.rs
	src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs
	src/test/compile-fail/cap-clause-with-stack-closure.rs
	src/test/compile-fail/do1.rs
	src/test/compile-fail/do2.rs
	src/test/compile-fail/empty-vec-trailing-comma.rs
	src/test/compile-fail/evec-subtyping.rs
	src/test/compile-fail/issue-1896.rs
	src/test/compile-fail/issue-2149.rs
	src/test/compile-fail/issue-2150.rs
	src/test/compile-fail/issue-2487-b.rs
	src/test/compile-fail/kindck-implicit-close-over-mut-var.rs
	src/test/compile-fail/liveness-issue-2163.rs
	src/test/compile-fail/liveness-use-in-index-lvalue.rs
	src/test/compile-fail/no-reuse-move-arc.rs
	src/test/compile-fail/no-send-res-ports.rs
	src/test/compile-fail/non-const.rs
	src/test/compile-fail/pure-higher-order.rs
	src/test/compile-fail/pure-loop-body.rs
	src/test/compile-fail/regions-addr-of-upvar-self.rs
	src/test/compile-fail/regions-escape-loop-via-vec.rs
	src/test/compile-fail/regions-scoping.rs
	src/test/compile-fail/seq-args.rs
	src/test/compile-fail/tstate-unsat-in-called-fn-expr.rs
	src/test/compile-fail/tstate-unsat-in-fn-expr.rs
	src/test/compile-fail/vec-add.rs
	src/test/compile-fail/vec-concat-bug.rs
	src/test/compile-fail/vector-no-ann.rs
2012-07-02 15:23:41 -07:00
Lindsey Kuper
7a4ebcefcb Update nbody benchmark to more idiomatic Rust; nix obsolete comments 2012-07-02 15:20:59 -07:00
Brian Anderson
9743757113 syntax: Support dropping argument list from for/do 2012-07-01 22:36:24 -07:00
Brian Anderson
fa6a446e6c Add two tests, one xfailed, for inferring lambda kinds in return position 2012-07-01 19:19:36 -07:00
Brian Anderson
d1fc2b5995 Convert to new closure syntax 2012-07-01 19:19:32 -07:00
Brian Anderson
3155d170ad syntax: Fix lambda parsing following 'ret' 2012-06-30 21:20:36 -07:00
Brian Anderson
ed834f0629 syntax: Add support for new lambda syntax 2012-06-30 16:01:52 -07:00
Brian Anderson
a3382b6f26 Eliminate usages of old sugared call syntax 2012-06-30 16:01:49 -07:00
Brian Anderson
8b2491160d syntax: Pretty-print 'do' correctly 2012-06-30 14:24:24 -07:00
Gareth Daniel Smith
6d86969260 change the test suite //! kind syntax to //~ kind in order to avoid a
conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
2012-06-30 12:23:59 +01:00