Armin Ronacher
1f80b9b90a
Added testcase for the missing do compile note
2012-07-02 17:33:57 -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
Brian Anderson
9743757113
syntax: Support dropping argument list from for/do
2012-07-01 22:36:24 -07:00
Brian Anderson
d1fc2b5995
Convert to new closure syntax
2012-07-01 19:19:32 -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
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
Michael Sullivan
98e161f00e
Switch the compiler over to using ~[] notation instead of []/~. Closes #2759 .
2012-06-29 17:41:45 -07:00
Graydon Hoare
697f1e38d6
Change 'native' and 'crust' to 'extern'.
...
This comes with a terminology change. All linkage-symbols are 'extern'
now, including rust syms in other crates. Some extern ABIs are
merely "foreign". The term "native" is retired, not clear/useful.
What was "crust" is now "extern" applied to a _definition_. This
is a bit of an overloading, but should be unambiguous: it means
that the definition should be made available to some non-rust ABI.
2012-06-26 16:18:37 -07:00
Tim Chevalier
cf69604551
Incorporate class fields into recursive-type check
...
Noticed while investigating issue 2718 that the typechecker allowed
some non-instantiable types involving classes. This wasn't the root of
2718, but fixed it anyway.
2012-06-26 11:14:39 -07:00
Michael Sullivan
329eca6044
Make vectors uglier ([]/~). Sorry. Should be temporary. Closes #2725 .
2012-06-25 20:00:46 -07:00
Tim Chevalier
da470ff5b8
Merge
2012-06-25 13:29:41 -07:00
Tim Chevalier
487cbf8e90
Remove resources
...
Also fixed shapes for classes with dtors, as well as handling
offsets for classes with dtors correctly in take glue.
Closes #2485
2012-06-24 15:09:57 -07:00
Graydon Hoare
f60cdf27e7
Remove 'implements' keyword in favour of :, part of #2301 .
2012-06-22 18:57:20 -07:00
Lindsey Kuper
ce7b803728
Minor capitalization/punctuation fixes in error messages
2012-06-22 16:48:03 -07:00
Lindsey Kuper
46809f7ab7
Nicer quoting in "attempted access of field" message. Issue #2358 .
2012-06-22 16:48:03 -07:00
Eric Holk
3246723bf7
Adding an issue number to vec-add.rs
2012-06-22 15:35:06 -07:00
Michael Sullivan
1d6fb24b70
Hack to make [] and []/~ the same type in preparation for switching to []/~.
2012-06-22 15:11:34 -07:00
Tim Chevalier
588c1eb41f
Remove resources from remaining test cases
2012-06-22 13:11:29 -07:00
Tim Chevalier
b8710de5ff
Add test cases
...
issue-912 is xfailed. issue-2111 is already fixed, but it's good to
have the test case.
2012-06-21 19:58:52 -07:00
Tim Chevalier
cc323d8637
Make liveness print out a proper error message for moves out of a self field
...
This was a call to span_bug() before. I'm not sure about the other cases,
but the test case shows that the `vk_self` case can certainly arise with
a bad program, so it should be a span_err() thing and not a span_bug() thing.
Closes #2590
2012-06-21 17:43:10 -07:00
Tim Chevalier
a06398214a
Add test for issue 2467
2012-06-21 16:58:35 -07:00
Lindsey Kuper
5710178081
Adding i
suffixes so cfail tests keep failing after suffix inference
2012-06-21 16:19:04 -07:00
Lindsey Kuper
0fe9c0a9d1
Add tests to exercise the "pattern has N field(s), but" error patterns.
2012-06-21 16:19:04 -07:00
Eric Holk
559c30ab17
xfailing vec-add.
2012-06-21 16:11:11 -07:00
Eric Holk
bb572b4234
Updating errors in vec-add.rs
2012-06-21 16:11:11 -07:00
Tim Chevalier
2a53640aa1
Test for issue 1896 (which appears to be fixed)
2012-06-21 14:08:02 -07:00
Niko Matsakis
9a2b60dfce
unxfail test for #2657
2012-06-21 10:20:46 -07:00
Niko Matsakis
287f163136
Issue #2657 : track mutability of bindings, also prevent move from bindings
2012-06-21 09:45:01 -07:00
Niko Matsakis
60603703ea
handle moves in let initializers and allow moves from unsafe ptrs
...
Related to issue #2657 , but this is not a complete fix.
2012-06-21 08:34:54 -07:00
Tim Chevalier
613deb0312
Change error to debug
...
IMO this is a better workaround than using the old-style
error-pattern: syntax :-)
2012-06-20 18:52:43 -07:00
Lindsey Kuper
1df6ddd08c
doc: add information about suffix inference to tutorial and manual.
2012-06-20 17:56:40 -07:00
Brian Anderson
4dcf84e4f4
Remove bind. Issue #2189
2012-06-20 17:27:28 -07:00
Michael Sullivan
bcd3942f41
Fix a test I messed up.
2012-06-20 17:08:36 -07:00
Michael Sullivan
8040fd86bf
Call the correct type formatting function for more typecheck diagnostics. Closes #2652 .
2012-06-20 15:44:58 -07:00
Eric Holk
e30a8b6f8c
Updating kind rules to make sure we don't sneakily send ports.
2012-06-19 17:37:51 -07:00
Lindsey Kuper
3cf582b529
Enable integer literal suffix inference.
2012-06-19 17:06:05 -07:00
Lindsey Kuper
3f56c0a42d
Add i
suffix to cfail test so it works after suffix inference
2012-06-19 16:57:13 -07:00
Lindsey Kuper
8cc1149130
Adding i
suffixes so cfail tests keep failing after suffix inference
2012-06-19 16:35:26 -07:00
Eric Holk
be664ddd29
Moved arc to libcore and added an arc that allows shared mutable state through mutual exclusion.
2012-06-19 10:31:12 -07:00
Brian Anderson
1ec5a5c635
Add 'do' expressions
2012-06-18 17:42:30 -07:00
Lindsey Kuper
85977ced3f
Adding i
suffixes so cfail tests keep failing after suffix inference
2012-06-18 15:36:14 -07:00
Tim Chevalier
0276a3376b
Revert "Moved arc to libstd and added an arc that allows shared mutable state through mutual exclusion."
...
This reverts commit 015527b0ce
.
2012-06-16 15:21:08 -07:00
Eric Holk
015527b0ce
Moved arc to libstd and added an arc that allows shared mutable state through mutual exclusion.
2012-06-15 22:00:58 -04:00
Patrick Walton
b6ed1de29e
Issue #2591 : Change "upvar" to "variable declared in an outer block" in tests
2012-06-15 12:24:12 -07:00
Lindsey Kuper
e3f73e443e
Tests for #1425 (xfail'd for now)
2012-06-14 21:04:53 -07:00
Lindsey Kuper
8a730a255d
Allow trailing comma in vectors. Closes #2482 .
2012-06-12 13:03:30 -07:00
Niko Matsakis
013fc92423
remove alias analysis and replace with borrowck
...
This reverts commit 7ef825bb60
.
2012-06-08 20:39:11 -07:00
Brian Anderson
7ef825bb60
Revert "remove alias analysis and replace with borrowck"
...
18s perf regression compiling rustc with opts
This reverts commit 7f6ee0ce0d
.
2012-06-07 19:42:27 -07:00
Niko Matsakis
7f6ee0ce0d
remove alias analysis and replace with borrowck
...
cc #2540
2012-06-07 16:46:57 -07:00
Tim Chevalier
0327dc0b18
Insert missing maybe_print_comment call for class destructors
...
While it wasn't the original issue, the first program from #2487
failed the pretty-printing test because of this, so it's still a good
test case :-)
It also turns out that the second program from #2487 now triggers a
kind error, so I figured I might as well add it as a test case.
2012-06-06 22:09:10 -07:00
Niko Matsakis
3b4cfdeee2
Merge remote-tracking branch 'mozilla/incoming'
...
Conflicts:
src/rustc/middle/tstate/auxiliary.rs
2012-06-06 19:00:34 -07:00
Niko Matsakis
dd37c0a41e
mask extra borrowck errors (should find out how to not report those)
2012-06-06 18:42:06 -07:00
Niko Matsakis
8ebbf464f5
minor changes to tests so they pass borrowck
2012-06-06 18:37:58 -07:00
Tim Chevalier
a5c9e8d59e
Fix tests to avoid empty classes
2012-06-06 15:08:24 -07:00
Tim Chevalier
5e8ef74e22
Revert "Revert "Forbid classes with no fields" due to test failures"
...
This reverts commit e56a6e8cb0
.
2012-06-06 15:08:24 -07:00
Niko Matsakis
77c470d183
Allow rcvrs to be borrowed; check rcvrs in borrowck properly
2012-06-02 10:08:04 -07:00
Niko Matsakis
cfac9b6833
improve borrowck to handle some frankly rather tricky cases
...
- receivers of method calls are also borrowed
- by-val arguments are also borrowed (needs tests)
- assignment to components can interfere with loans
2012-06-02 10:08:04 -07:00
Tim Chevalier
6e2aa3b998
Port more resource tests to classes
2012-06-01 20:40:35 -07:00
Tim Chevalier
de40318037
Tests for copyability and sendability rules for classes
...
Closes #2296
2012-06-01 20:40:35 -07:00
Tim Chevalier
11b4a92fc8
Port another resource test to use classes
2012-06-01 20:40:35 -07:00
Tim Chevalier
facb5c08c6
Enforce rule that classes with dtors aren't copyable
...
The test for this is copy-a-resource.
2012-06-01 20:40:35 -07:00
Tim Chevalier
b67f8e340b
Remove obsolete test
...
This test no longer makes sense with classes instead of resources,
since class types can't be dereferenced.
2012-06-01 20:40:35 -07:00
Lindsey Kuper
3c622a5b12
Clarifying comments in test.
2012-06-01 10:30:50 -07:00
Lindsey Kuper
43eb5f0a2e
More tests wrt #2263 .
2012-06-01 09:26:48 -07:00
Niko Matsakis
c2ce2741a7
allow mutable vectors and so forth to be used as immutable slices
2012-05-31 15:07:09 -07:00
Eric Holk
0470abe1d2
Allow some resources to be considered const.
2012-05-31 13:55:54 -07:00
Kevin Cantu
7dcbaedd32
Rename librustsyntax to libsyntax
...
Per issue #2418 .
2012-05-31 11:15:00 -07:00
Brian Anderson
615f532475
test: Update test with current error message
...
These errors where previously generated by typestate, but there seem to
be other passes that cover this now.
2012-05-31 00:06:10 -07:00
Niko Matsakis
dca11e1f99
test our some of the various combinations of fn subtyping
2012-05-30 12:02:01 -07:00
Niko Matsakis
5b8abec92f
test for pure fn vs impure fn etc subtyping
2012-05-30 11:56:50 -07:00
Niko Matsakis
79b3dedac3
allow for loop bodies
2012-05-30 11:26:15 -07:00
Niko Matsakis
653a1f8781
integrate purity into type
2012-05-30 11:26:15 -07:00
Niko Matsakis
22a10f0e4a
refactor region manip. to remove redundancy, get closer to fn subtyping
...
also: remove "auto-mode-matching" for implemented interfaces, as it
is complex and interacts poorly with classes
cc #2263
2012-05-30 11:04:12 -07:00
Michael Sullivan
b744f52620
Make heap closures always require a capture clause to capture mutable variables. Closes #2446 .
2012-05-30 10:46:22 -07:00
Tim Chevalier
3f3c9caf4d
Handle poststates of breaking loops correctly in typestate
...
The poststate should be one where all predicates are assumed false,
rather than the unchanged prestate.
Closes #2374
2012-05-29 18:22:38 -07:00
Niko Matsakis
f90228b8a8
make all arguments modes immutable
...
note: you can still move from copy/move mode args
2012-05-29 16:22:17 -07:00
Michael Sullivan
5d1c29912d
Fix an error message to not refer to "block type". Closes #2423 .
2012-05-29 12:18:59 -07:00
Brian Anderson
432c6cbde9
core: Make range follow the for loop protocol
2012-05-26 02:28:00 -07:00
Niko Matsakis
98740a59da
detect ambig. calls to iface bounds, use transactions
...
cc #2433
2012-05-25 17:04:05 -07:00
Niko Matsakis
62fe587f81
revisit error message; create spill map
2012-05-25 14:37:30 -07:00
Eric Holk
8b6bfc96cb
Const kind checking. The rules are almost certainly incomplete and unsound...
2012-05-24 15:06:56 -07:00
Niko Matsakis
ccd8d5573e
remove dead assignments
2012-05-24 13:35:57 -07:00
Niko Matsakis
f5c51b0a9c
remove initedness checking from typestate, as best I could
2012-05-24 09:52:16 -07:00
Niko Matsakis
0d3811e275
improve liveness so it reports unused vars / dead assignments
...
doesn't warn about pattern bindings yet though
2012-05-24 09:52:16 -07:00
Niko Matsakis
30b47649ea
new liveness pass to supercede last_use / initedness
2012-05-24 09:52:03 -07:00
Niko Matsakis
a3be0b1054
fix classes and parameterized ifaces; remove needless self check
...
ref #1726 , #2434
2012-05-24 06:49:40 -07:00
Niko Matsakis
bd573becf5
change region scope of call arguments, old one was unsound
...
improve error message to describe kind of deref'd ptr using sigil
2012-05-24 05:19:44 -07:00
Eric Holk
5f154770e2
Prevent capturing non-copyable things in closures.
2012-05-23 15:46:43 -07:00
Niko Matsakis
9773a22119
shuffle error messages in borrowck, and prevent it from spewing too many
...
also, fix a few minor issues it complains about
2012-05-23 12:01:27 -07:00
Eric Holk
8678baab12
Resources are once again not copyable.
2012-05-23 10:27:42 -07:00
Niko Matsakis
b93839408c
new test
2012-05-23 06:30:29 -07:00
Niko Matsakis
e0f59e835e
modify borrowck to allow arbitrary borrows in pure scopes
2012-05-23 06:30:29 -07:00
Eric Holk
0b2f2cabbe
Send is no longer a subkind of copy. This allows for sendable, but non-copyable resources. Closes #2420 .
2012-05-22 14:10:32 -07:00
Lindsey Kuper
248e439638
Region checking: this one currently passes, but only "by accident".
2012-05-21 13:05:06 -07:00
Niko Matsakis
8e73bb6ea0
detect and report shadows in nested bindings
2012-05-21 09:37:22 -07:00
Niko Matsakis
28d0ce9a8b
fix up handling of &x where x is an arg or &self (for now at least).
2012-05-19 10:33:14 -07:00
Paul Stansifer
9fe547d3a7
Make extracting syntax extension arguments easier.
2012-05-18 10:05:24 -07:00
Tim Chevalier
0343b0553b
Test that a class type name gets printed correctly in a...
...
"cannot be dereferenced" error message. Closes #2370
2012-05-17 09:40:43 -07:00
Niko Matsakis
21fc3af031
add xfail-fast directives for borrowck tests
2012-05-16 12:44:54 -07:00