Commit Graph

979 Commits

Author SHA1 Message Date
Eric Holk
877ebed6cf Visit item macros. 2012-07-10 22:00:48 -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
Patrick Walton
019d4291c7 rustc: Introduce a coherence checker, behind a compile switch for now 2012-07-10 17:35:18 -07:00
Michael Sullivan
a7897b3ef3 Eliminate some obsolete upcalls. 2012-07-10 16:33:21 -07:00
Michael Sullivan
260f73ed85 Get rid of unused fields in tydescs. Closes #2351. 2012-07-10 16:33:21 -07:00
Michael Sullivan
e430a699f2 Fix take glue for slices. 2012-07-10 16:32:54 -07:00
Michael Sullivan
baebccd2c8 Don't fail when emitting free glue for fixed and region evecs. 2012-07-10 15:57:48 -07:00
Graydon Hoare
f2b8ab0ad3 Mop up merge collision. 2012-07-10 15:25:58 -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
ef9a64709e Make old_vecs an error. 2012-07-10 15:12:13 -07:00
Michael Sullivan
bf06deafe6 Disallow implicitly binding methods in typechecker. Closes #2189. 2012-07-10 15:12:13 -07:00
Michael Sullivan
e4362a59b9 Remove the empty tuple of tydescs from closures. Closes #2531. 2012-07-10 15:12:13 -07:00
Michael Sullivan
95dd9f3204 Get rid of a lot of bind related cruft as part of Issue #2189. 2012-07-10 15:12:12 -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
25b152397d Clean up the tydesc handling code in trans. 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
Patrick Walton
a6ee46db0b rustc: Resolve expressions in literal and range patterns 2012-07-10 12:30:02 -07:00
Patrick Walton
f0fe08f1c8 rustc: Handle foreign item purity correctly in resolve3 2012-07-09 18:39:10 -07:00
Paul Stansifer
579768baa5 Allow folds to drop items. 2012-07-09 17:44:46 -07:00
Patrick Walton
7d90edcb3b rustc: Switch over to resolve3 2012-07-09 17:44:16 -07:00
Patrick Walton
6912b11089 rustc: Fix the collision with Tim's change 2012-07-09 17:44:15 -07:00
Patrick Walton
ad673daa6c Revert "rustc: Switch over to resolve3" due to Linux failures
This reverts commit 2c0aa257e2.
2012-07-09 16:50:19 -07:00
Patrick Walton
2c0aa257e2 rustc: Switch over to resolve3 2012-07-09 16:29:25 -07:00
Patrick Walton
2edc4195d5 rustc: Allow import resolutions to be inferred from external crates in resolve3 2012-07-09 16:29:25 -07:00
Tim Chevalier
271da617cb Tag re-exports differently in metadata
so that the "list metadata" command doesn't print out anything
about intrinsics, but other code can see them.

Closes #2771
2012-07-09 15:21:29 -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
Brian Anderson
b7a418e194 rustc: Conditionally compile view items. #2357 2012-07-09 14:09:03 -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
4d8113725d rustc: Add some changes I missed 2012-07-09 11:05:48 -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
ea03315cf4 Revert "change borrowck error msg: 'declared in outer block' -> 'captured in a closure'"
This change requires some tests to be updated.

This reverts commit b5b8f5efcc.
2012-07-08 00:07:15 -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
Ben Blum
b5b8f5efcc change borrowck error msg: 'declared in outer block' -> 'captured in a closure' 2012-07-06 22:30:50 -04: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
Graydon Hoare
ceac155211 For #2229, recognize 'again' in place of 'cont', final change pending snapshot. 2012-07-06 15:46:39 -07:00
Michael Sullivan
9e6b43fb33 Rip out a bunch more append code from trans. 2012-07-06 15:04:57 -07:00
Eric Holk
0e1a6cf3d9 Remove tvec::trans_add 2012-07-06 14:13:52 -07:00
Niko Matsakis
11d868e925 paper over #2586 by not failing when the key is not found 2012-07-06 14:10:40 -07:00
Michael Sullivan
ee0177b908 Move string append to libraries. Closes #2710. 2012-07-06 13:37:56 -07:00
Eric Holk
05cdda3a2c Plumbing and parsing for item-position macros. 2012-07-06 10:42:40 -07:00
Lindsey Kuper
47f61c5429 Clean up error message punctuation/capitalization 2012-07-05 16:18:58 -07:00
Tim Chevalier
a0dbf58245 Remove duplicate, un-used copy of astencode 2012-07-05 16:11:51 -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
Lindsey Kuper
33334f3c43 Change 'iface' to 'trait' internally; parse trait as iface synonym 2012-07-05 11:01:43 -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
Ben Striegel
f2e2a14f36 Remove empty argument lists from do expressions 2012-07-04 17:21:29 -07:00
Graydon Hoare
195dd54d61 Fix trans typo noticed by fuzzer. Close #2148. 2012-07-04 14:07:03 -07:00
Patrick Walton
cc3b6bf2f0 rustc: Make the error names in resolve3 conform more closely to what the compile-fail tests expect 2012-07-03 19:10:45 -07:00
Patrick Walton
dbbffbea9a rustc: Make a note of the fact that each_path doesn't handle path nesting properly 2012-07-03 18:32:47 -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
Patrick Walton
af38333f75 rustc: Speed up def ID parsing in the metadata 2012-07-03 17:12:02 -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
Patrick Walton
742c05f87d rustc: Avoid a lot of copying in metadata when reading impls 2012-07-03 16:38:35 -07:00
Graydon Hoare
debb7e4641 Switch 'native' to 'extern' (or 'foreign' in some descriptions) 2012-07-03 16:11:00 -07:00
Patrick Walton
bfbc847f63 rustc: Add X-ray functionality to resolve3 so the test runner works 2012-07-03 15:56:27 -07:00
Patrick Walton
db8d9ddcbb rustc: Record the main function in the session in resolve3 2012-07-03 12:20:15 -07:00
Michael Sullivan
d52f0f79bc Fix some indentation in check::vtable. 2012-07-03 10:57:17 -07:00
Brian Anderson
ab193b9508 rustc: Remove some comments from resolve3 that are being misparsed as attributes 2012-07-02 20:06:07 -07:00
Patrick Walton
f093d374ed rustc: Implement a new resolve pass behind a compile flag 2012-07-02 18:30:12 -07:00
Armin Ronacher
5bd9d6e05c Implemented better error message for missing do statements.
This fixes #2783 for the case where an empty double pipe
symbol is being used without a do keyword.
2012-07-02 17:33:57 -07:00
Brian Anderson
9fe22a4ab7 Mark -g as experimental (#2767) 2012-07-02 17:22:49 -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
d1fc2b5995 Convert to new closure syntax 2012-07-01 19:19:32 -07:00
Brian Anderson
a3382b6f26 Eliminate usages of old sugared call syntax 2012-06-30 16:01:49 -07:00
Tim Chevalier
172fb1756b Check in changes I forgot to check in 2012-06-30 09:12:45 -07:00
Gareth Daniel Smith
0b653ab953 initial draft of fix for issue #2498:
1. make /// ... and //! ... and /** ... */ and /*! ... */ into sugar for #[doc = ...] attributes.
2. add a script in etc/ to help converting doc-attributes to doc-comments
3. add some functions to core::str to help with (1)
2012-06-30 11:54:54 +01:00
Tim Chevalier
f64c23fdfd Descend into ty_boxes in type_use
type_use was failing to look into ty_boxes, which caused monomorphize
to coalesce instances that shouldn't have been coalesced (because they
should actually use different type glue)

Closes #2734
2012-06-30 00:34:03 -07:00
Eric Holk
328fd30cf4 Allow empty enums to be sent (#2737) 2012-06-29 18:39:27 -07:00
Eric Holk
0a99912cdd Adding a bunch of atomic intrinsics.
Adding a test cases for the atomic intrinsics.
2012-06-29 18:37:29 -07:00
Michael Sullivan
98e161f00e Switch the compiler over to using ~[] notation instead of []/~. Closes #2759. 2012-06-29 17:41:45 -07:00
Eric Holk
c9e8b7de82 Merge branch 'master' of github.com:mozilla/rust into incoming 2012-06-28 17:30:36 -07:00
Michael Sullivan
d91e310982 Don't use literal info from the original source when pretty printing expanded ASTs. 2012-06-28 15:33:15 -07:00
Eric Holk
87eaf91be3 Replaced almost all vector+ in rustc (#2719)
Didn't update shape because the changes were causing segfaults.
2012-06-28 15:11:09 -07:00
Eric Holk
59221e9ac8 replace more vector + (issue #2719) 2012-06-28 13:52:23 -07:00
Brian Anderson
9f7e62ea20 rustc: Fix a missing application of the operator in fold_ty 2012-06-27 20:11:59 -07:00
Patrick Walton
c1157161d9 rustc: Don't give variables the same name as enums in trans
Conflicts:

	src/rustc/middle/trans/alt.rs
	src/rustc/middle/trans/base.rs
	src/rustc/middle/trans/closure.rs
	src/rustc/middle/trans/impl.rs
	src/rustc/middle/trans/uniq.rs
2012-06-27 14:11:02 -07:00
Patrick Walton
6cf5910de2 rustc: Don't allow multiple candidate methods from impls with the same def ID 2012-06-27 14:11:02 -07:00
Lindsey Kuper
f0565be49a Better error message instead of bare "fail" in infer 2012-06-27 12:37:50 -07:00
Eric Holk
133fdc1148 Remove unnecessary bounds checks in vec::push_all (issue #2719)
Don't needlessly drop closures (issue #2603)
2012-06-27 11:32:22 -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
Michael Sullivan
51468b65a4 Properly cleanup slice literals. Closes #2705. 2012-06-26 14:05:43 -07:00
Michael Sullivan
f17ca3f73e Some box cleanup that doesn't break the build. 2012-06-26 13:58:21 -07:00
Patrick Walton
481267299d rustc: Make trans no longer insist that there be exactly one impl scope per module
Conflicts:

	src/rustc/middle/trans/base.rs
2012-06-26 13:45:18 -07:00
Michael Sullivan
f85fbcb67f Revert "Clean up a bunch of box related code."
This reverts commit bacf9e9887.
2012-06-26 12:58:58 -07:00
Tim Chevalier
91e44ea056 Be a little more clever about calculating sizes for class types
We could try to calculate the size of a partially-converted class type,
and run into an LLVM error because we were trying to calculate the size
of a named struct whose fields hadn't yet be filled in. The issue can be
dodged by extending simplify_type to convert classes to isomorphic
structural records, just for the purposes of size calculations.

(for real this time) Closes #2718
2012-06-26 11:14:39 -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
Tim Chevalier
d513d9893e Typos in a comment and an error message 2012-06-26 11:14:38 -07:00
Michael Sullivan
bacf9e9887 Clean up a bunch of box related code. 2012-06-26 10:03:10 -07:00
Eric Holk
b9d3ad0736 Getting rid of lots more vector +=. (issue #2719) 2012-06-26 00:39:18 -07:00
Michael Sullivan
15b60ac56b Comments only: fix some comments that got spurious /~s 2012-06-25 20:35:32 -07:00
Michael Sullivan
329eca6044 Make vectors uglier ([]/~). Sorry. Should be temporary. Closes #2725. 2012-06-25 20:00:46 -07:00
Michael Sullivan
c087aaf56b When we cons up vector asts, generate evecs. 2012-06-25 20:00:39 -07:00
Michael Sullivan
a71a49faa8 Split deprecated str and vec warnings into two flags, enable old_vecs by default. 2012-06-25 19:29:27 -07:00
Brian Anderson
c2751c5640 rustc: Make 'do' work with effects the same as 'for' 2012-06-25 17:46:06 -07:00
Tim Chevalier
f1acc69a2a Add class fields to the global index
Closes #2192
2012-06-25 17:25:54 -07:00