Erick Tryzelaar
501201a431
Remove executable bit from lock_and_signal.cpp.
2011-06-09 12:30:57 -07:00
Marijn Haverbeke
1146136fa8
Fix double import that now somehow gets caught by resolve
2011-06-09 20:48:06 +02:00
Marijn Haverbeke
4ab862a50d
Switch resolve pass to use visit.rs rather than walk.rs
2011-06-09 20:44:04 +02:00
Marijn Haverbeke
d8516178e5
Pass ty params to visit::visit_fn
2011-06-09 20:44:04 +02:00
Tim Chevalier
d1819fb747
Improve an error message in resolve
2011-06-09 11:37:52 -07:00
Tim Chevalier
b34a97de39
Start to check expr_check and expr_call constraints in typestate
...
Start writing the cases for expr_check and expr_call to take
predicates into account, but this isn't working yet.
2011-06-09 11:37:52 -07:00
Tim Chevalier
17ff2a0d79
Further support for predicate constraints
...
Changed function types to include a list of constraints. Added
code for parsing and pretty-printing constraints. This necessitated
splitting pprust into two files (pprust and ppaux) to break a
circulate dependency, as ty_to_str now needs to print out constraints,
which may include literals, but pprust depended on ty.
2011-06-09 11:37:52 -07:00
Rafael Ávila de Espíndola
46920e073b
Remove hack now that stage0 doesn't use it.
2011-06-09 14:26:10 -04:00
Patrick Walton
a4663d2845
rustc: Add fast paths for vars and param folds. 3x typechecking speedup.
2011-06-09 11:20:47 -07:00
Patrick Walton
73ae684536
rustc: Don't resolve all type variables eagerly for paths
2011-06-09 10:51:51 -07:00
Patrick Walton
80f86d1e9b
stdlib: Make union-find not create loops when unifying two already-unified sets
2011-06-09 10:51:51 -07:00
Marijn Haverbeke
537d879dc1
Properly handle lifetime of aliases in nested blocks
...
There was a bug that would cause the alias analyser to allow you to
invalidate an alias that was no longer directly referred to, even if
another alias was rooted in it. It now properly tracks dependencies
between live aliases.
Required another case of copying values in map.rs.
2011-06-09 14:19:13 +02:00
Marijn Haverbeke
beda82ddf1
A revised, improved alias-checker
...
The old system tried to ensure that the location an alias pointed at
would retain its type. That turned out to not be strong enough in the
face of aliases to the inside of tags.
The new system instead proves that values pointed to by aliases are
not replaced (or invalidated in some other way) at all. It knows of
two sufficient conditions for this, and tries to prove at least of
them:
A) The alias is 'immutably rooted' in a local, and this local is not
reassigned for the lifetime of the alias. Immutably rooted means
the alias refers to the local itself, or to something reachable
from the local through immutable dereferencing.
B) No value whose type might include the type of the 'inner mutable
element' of the thing the alias refers to (for example, the box in
rec(mutable x = @mutable int)) is from the outer scope is accessed
for the lifetime of the alias. This means for functions, no other
argument types may include the alias's inner mutable type. For alt,
for each, and for, it means the body does not refer to any locals
originating from outside their scope that include this type.
The lifetime of an alias in an alt, for each, or for body is defined
as the range from its definition to its last use, not to the point
where it goes out of scope. This makes working around these
restrictions somewhat less annoying. For example, you can assign to
your alt-ed value you don't refer to any bindings afterwards.
2011-06-09 13:11:29 +02:00
Marijn Haverbeke
43fbb07126
Add vec::member
2011-06-09 13:11:28 +02:00
Marijn Haverbeke
77c1b9650f
Some more workarounds to please the alias checker
...
Some of the vec utilities now only work on immutable vecs, since they
would have to be rewritten to do a lot more copying to be alias-safe.
Some forced copying was added to map.rs, showing a weakness in the
alias checker (or maybe the alias system): when fn args are passed
into a function, calling them must assume all aliases that are not
immutably rooted (directly connected to a local or temporary without
any mutable edges) become invalid. This will be a drag on functional
programming in Rust.
Work around alias issues in the stdlib
2011-06-09 13:08:39 +02:00
Marijn Haverbeke
bd90c7a3cb
Add new visitor framework
2011-06-09 13:08:38 +02:00
Patrick Walton
6feb1dfd76
rustc: Don't eagerly resolve type variables after unification
2011-06-08 18:42:34 -07:00
Patrick Walton
537d4ac65a
rustc: Fix error pattern in compile-fail/arg-count-mismatch.rs
2011-06-08 18:42:34 -07:00
Patrick Walton
cc7a8b668f
rustc: Make resolve_all_vars() check to see whether the type actually has vars before folding over it; also remove some debug code. 2x typechecking speedup.
2011-06-08 18:05:45 -07:00
Patrick Walton
7527084e62
rustc: Don't generate so many variables when typechecking functions; remove mo_either
2011-06-08 18:05:45 -07:00
Graydon Hoare
8691a1a1e5
Tidy up 'export meta' situation now that snapshot understands it.
2011-06-08 15:58:03 -07:00
Patrick Walton
99c72b98b5
rustc: Use cnames in ty_to_str again; debugging code crept in
2011-06-08 15:49:46 -07:00
Patrick Walton
cc06bd4aa5
rustc: Add some miscellaneous demands that pushdown had previously caught; put out burning tinderbox
2011-06-08 15:33:16 -07:00
Graydon Hoare
b02b50c695
Register new snapshots.
2011-06-08 14:58:58 -07:00
Patrick Walton
2f853ddb8d
test: Add a test case for issue #362 , "ret none".
2011-06-08 12:52:36 -07:00
Patrick Walton
4571172c03
rustc: Remove pushdown. 15 second improvement.
2011-06-08 12:24:05 -07:00
Graydon Hoare
f54f2799c3
Merge pull request #403 from espindola/newllvm
...
Update rust to build with newer llvm versions.
2011-06-08 11:41:01 -07:00
Rafael Ávila de Espíndola
698022d351
Update rust to build with newer llvm versions.
2011-06-08 14:08:24 -04:00
Patrick Walton
08dcb9306b
rustc: Remove all traces of the unification cache
2011-06-08 10:52:12 -07:00
Rafael Ávila de Espíndola
d360c481e8
Don't force the fetch of main.o from main.a, we are not using main.a anymore.
2011-06-08 13:47:21 -04:00
Josh Matthews
2235fb73ef
Add optional message to fail.
2011-06-08 04:02:55 -04:00
Patrick Walton
0857d22c04
rustc: Print out a real error message on unresolved types. Puts out burning tinderbox.
2011-06-07 23:03:41 -07:00
Patrick Walton
ddec6b5f47
rustc: Use a set-based approach to unification; remove ty_bound_param and ty_local.
...
Sorry, big perf regression; will fix soon.
2011-06-07 19:33:18 -07:00
Graydon Hoare
721c5bbee8
More work on proper linkage name-mangling. Almost right, aside from version numbers.
2011-06-07 18:08:17 -07:00
Rafael Ávila de Espíndola
7034a28241
Update the snapshot.
2011-06-07 20:40:31 -04:00
Lindsey Kuper
a4ca75e6af
For consistency, use ctxt instead of ty_ctxt outside of unify.
2011-06-07 15:18:30 -07:00
Lindsey Kuper
ab69c4a98f
Removing dead code and redundant fails; changing fails to sess.bug
...
calls (issue #444 ).
2011-06-07 14:12:34 -07:00
Rafael Ávila de Espíndola
b1d6f12a05
Don't put a copy of main (the C one) in each binary we produce. This is a step
...
in getting a driver that works on all linux systems.
Sorry for the linker hacks, I will remove them after snapshotting a new compiler.
2011-06-07 16:56:27 -04:00
Josh Matthews
df9cf0be9b
Add multiline, whitespace-eating strings.
2011-06-07 11:21:10 +02:00
Graydon Hoare
319156c8d1
Begin tidying up name-mangling rules.
2011-06-06 15:48:47 -07:00
Rafael Ávila de Espíndola
ee54fa5c7d
Implement enough support for pointer to get an identity function working.
2011-06-06 16:36:01 -04:00
Marijn Haverbeke
4bd5f834b0
First take on an alias-safety checker
...
The alias checker works by ensuring that any value to which an alias
is created is rooted in some way that ensures it outlives the alias.
It is now disallowed to create an alias to the content of a mutable
box, or to a box hanging off a mutable field. There is also machinery
in place to prevent assignment to local variables whenever they are
the root of a live alias.
2011-06-06 21:24:03 +02:00
Marijn Haverbeke
2b334f061a
Change unsafe aliases
...
This litters aberrations like 'alt({foo.bar}) { ... }' and f({*baz})
though the code (mostly in trans.rs). These are a way to explicitly
copy the given value so that it can be safely aliased. At some point
we'll probably want a more explicit copy operator.
2011-06-06 21:09:55 +02:00
Brian Anderson
4d8f715dab
rustc: Make resolve::unresolved return !. Remove redundant fails
2011-06-05 00:11:44 -04:00
Lindsey Kuper
2736d63db0
Adding comments; removing dead code.
2011-06-04 19:38:11 -07:00
Lindsey Kuper
5f95766a40
Remove redundant 'fail' exprs and dead code; use sess.bug or
...
sess.span_err instead of 'fail'. (issue #444 )
2011-06-04 18:34:40 -07:00
Brian Anderson
53ea2a4751
stdlib: Use spans for #fmt errors originating in std
...
Issue #444
2011-06-04 19:48:19 -04:00
Brian Anderson
a177dc485b
rustc: Reenable debug logging in extfmt
...
This is not obnoxious now that logging is off by default
2011-06-04 17:57:53 -04:00
Brian Anderson
4b566fe7f9
rustc: Hide the parser from syntax extensions
...
Eventually extensions will probably need access to the parser again, but it'll
be in a different form.
2011-06-04 17:51:59 -04:00
Brian Anderson
c88fa92de4
rustc: Generate extension annotations from ext_ctxt instead of parser
2011-06-04 17:44:24 -04:00
Brian Anderson
1d6f1dc58d
rustc: Add a next_ann method to ext_ctxt
...
After this we can remove the parser from the syntax extensions, at least for
now.
2011-06-04 17:31:44 -04:00
Brian Anderson
3ca5fff195
rustc: Use spans for #env errors
...
Issue #444
2011-06-04 17:14:32 -04:00
Brian Anderson
ac83e34dc6
rustc: Report unimplemented #fmt features with spans
2011-06-04 17:10:08 -04:00
Brian Anderson
dd588519bd
rustc: Add a span_unimpl method to ext_ctxt
2011-06-04 17:10:08 -04:00
Brian Anderson
ecf1bd7651
rustc: Use spans on extfmt error messages
...
Issue #444
2011-06-04 17:10:04 -04:00
Brian Anderson
794221b353
rustc: Return the correct span from parse_seq
2011-06-04 16:36:08 -04:00
Brian Anderson
c18f2e2dac
rustc: Pass the correct span to syntax extensions
2011-06-04 15:57:13 -04:00
Brian Anderson
af46f3ed0d
rustc: Introduce ext module. Move some things from parser to ext.
...
Introduce an ext_ctxt record to provide a span_err method for use while
expanding syntax extensions. Hopefully it will be useful for other things.
2011-06-04 15:49:42 -04:00
Paul Stansifer
dbd066a02a
"macro" -> "syntax extension" for now
2011-06-03 18:47:11 -07:00
Paul Stansifer
79fcd51b46
Make the macro system more modular.
2011-06-03 18:47:11 -07:00
Graydon Hoare
cfc75695a5
Register new snapshots.
2011-06-03 18:47:08 -07:00
Graydon Hoare
f29d04672b
Remove zerobreak between foo and ( on a call expr. Never looks right.
2011-06-03 17:32:29 -07:00
Graydon Hoare
f34d19a242
Make pp more conservative about inserting trailing comments mid-list.
2011-06-03 17:32:29 -07:00
Lindsey Kuper
69325f815d
More comments.
2011-06-03 17:16:28 -07:00
Lindsey Kuper
dcf7fbf833
Comments and cleanup.
2011-06-03 17:09:50 -07:00
Patrick Walton
cb4c969ba6
rustc: Add a "smallintmap" implementation
2011-06-03 16:15:14 -07:00
Graydon Hoare
088ab03fdb
Add spans to fields, args, methods. Improve pp of same.
2011-06-03 15:42:42 -07:00
Graydon Hoare
8235e76a47
Tidy up printing of ty_fn.
2011-06-03 15:42:42 -07:00
Rafael Ávila de Espíndola
429e21414b
Parse pointers in metadata.
2011-06-03 15:13:10 -04:00
Rafael Ávila de Espíndola
ba74c6cfdc
Boilerplate for pointers. Sorry for missing this on the first patch.
2011-06-03 15:02:58 -04:00
Rafael Ávila de Espíndola
18b63865ce
Accept *foo as a pointer to foo.
...
This is accepted everywhere, since just passing a pointer is safe.
2011-06-03 14:34:19 -04:00
Marijn Haverbeke
07667d29aa
Temporarily xfail compile-fail/pattern-tyvar
...
So that the tinderboxes can go green again. Patrick, please look into
this at some point.
2011-06-03 10:23:13 +02:00
Lindsey Kuper
dc29dead2e
Removing redundant "fail"s.
2011-06-02 18:15:29 -07:00
Patrick Walton
ad9afefa10
rustc: Typecheck patterns from the top down; remove pushdown_pat
2011-06-02 18:11:26 -07:00
Tim Chevalier
76bcbfd269
Un-XFAIL break-value
...
It passes thanks to the previous two commits.
2011-06-02 17:52:04 -07:00
Tim Chevalier
ba377c043d
Handle _|_ values properly in trans
...
Generate an LLVMUndef value of the proper type for an argument of
type _|_. Otherwise we get an LLVM assertion failure.
2011-06-02 17:52:04 -07:00
Tim Chevalier
468786e36d
Fix unification bug
...
Hello from SFO Terminal 3!
unify_fn_common had the expected and actual types reversed in one
place. This was causing the type of an occurence of a function f
with type fn(int) -> T to be set to fn(_|_) -> T at a call site like
f(fail); I think this was also making some of the type error messages
come out backwards, but I haven't checked.
Also: ty_bot does not contain pointers
2011-06-02 17:52:04 -07:00
Patrick Walton
c515ed13de
Merge pull request #450 from paulstansifer/quick_error_message_fix_2
...
Flatten functions and objects in trans::simplify_type.
2011-06-02 17:43:11 -07:00
Paul Stansifer
20bd927c3f
Flatten functions and objects in trans::simplify_type.
2011-06-02 17:40:12 -07:00
Graydon Hoare
cb61d7b38e
Pretty-print literals exactly as we saw them in the source.
2011-06-02 17:18:49 -07:00
Lindsey Kuper
3a6b5576ac
Refactor make_fp_cmp_glue and make_integral_cmp_glue into one.
2011-06-02 16:35:25 -07:00
Paul Stansifer
1377e9b341
Implement pcwalton's code review suggestions.
2011-06-02 15:12:17 -07:00
Paul Stansifer
5cd10d2fef
Error message, instead of segfault, when recursive types are used.
2011-06-02 14:03:17 -07:00
Patrick Walton
12f86e6f2f
rustc: Print node IDs for more types of nodes
2011-06-02 11:29:17 -07:00
Patrick Walton
7c6a0f189e
rustc: Tiny style fix in pprust::rust_printer
2011-06-02 11:29:17 -07:00
Graydon Hoare
f919af0f8f
Remove offending hyphen.
2011-06-02 10:34:19 -07:00
Marijn Haverbeke
fd5428a95e
Re-xfail lib-io test. Seems to only work on Linux
2011-06-02 17:58:49 +02:00
Marijn Haverbeke
5144f790fe
Fix and un-xfail vec-append test
2011-06-02 16:45:26 +02:00
Marijn Haverbeke
75ffe657db
Un-xfail multi test
2011-06-02 16:21:14 +02:00
Marijn Haverbeke
8ac94d59e8
Un-xfail lib-io test
2011-06-02 16:19:30 +02:00
Marijn Haverbeke
830c58b651
Un-xfail obj-dtor-2
2011-06-02 16:12:20 +02:00
Patrick Walton
78374d11ce
rustc: Add a new mode to the pretty printer that prints out node IDs, for debugging
2011-06-01 18:53:52 -07:00
Patrick Walton
eae3036179
rustc: Remove else-after-return in main
2011-06-01 18:38:00 -07:00
Patrick Walton
d43f60e5d4
rustc: Fold --pretty and --typed-pretty into a single option with an optional argument
2011-06-01 18:32:05 -07:00
Patrick Walton
8c3809afd0
stdlib: Add some functions to getopts to deal with optional arguments more easily
2011-06-01 18:32:05 -07:00
Tim Chevalier
24c9d7e5f8
Improve type error message for non-constructor in pattern
2011-06-01 18:15:12 -07:00
Tim Chevalier
1402cd101b
Redo typestate-related data structures to support predicate constraints. No actual support yet, just infrastructure.
2011-06-01 18:14:48 -07:00
Tim Chevalier
af4554aadf
Add a few more to_str functions
2011-06-01 17:47:59 -07:00
Tim Chevalier
ac4ef1741e
Allow constraint args to be literals
2011-06-01 17:45:13 -07:00
Lindsey Kuper
528c6516f0
Use span_err instead of err. Fixes issue #444 .
2011-06-01 17:22:23 -07:00
Patrick Walton
af9272f70e
rustc: Remove rustboot workaround from walk::default_visitor()
2011-06-01 16:52:22 -07:00
Patrick Walton
8851ae0423
rustc: Allow walking over patterns
2011-06-01 16:47:24 -07:00
Graydon Hoare
6e058ff54e
Register new snapshots.
2011-06-01 16:39:31 -07:00
Graydon Hoare
1f915ef7ce
Permit breaking before fn args block.
2011-06-01 16:39:31 -07:00
Lindsey Kuper
dba9caeba9
Comments.
2011-06-01 16:39:52 -07:00
Graydon Hoare
1b67fbdfd3
More tweaks to comment preservation rules.
2011-06-01 15:29:38 -07:00
Graydon Hoare
198f6a247e
Print iters as iters not fns.
2011-06-01 13:18:16 -07:00
Graydon Hoare
023bbc0449
Add a space after @mutable.
2011-06-01 13:12:12 -07:00
Graydon Hoare
19f85cc9c4
Print ty_bot properly.
2011-06-01 13:08:08 -07:00
Rafael Ávila de Espíndola
a6ca9c2922
Don't create an empty section.
2011-06-01 15:59:28 -04:00
Rafael Ávila de Espíndola
30efdeeca1
Visibility is an ELF concept and protected visibility is not very well implemented,
...
avoid using it for now.
Instead, mark pairs that are not needed elsewhere as internal.
2011-06-01 15:45:31 -04:00
Graydon Hoare
2ef2bda276
Move brace/if/for/while/do/alt/spawn exprs into bottom_expr rule.
2011-06-01 12:42:28 -07:00
Graydon Hoare
4eef7b613c
Bug fixes to pprust.
2011-06-01 12:26:42 -07:00
Graydon Hoare
e5dc138dfa
Buffer pending whitespace in printer so as not to introduce trailing whitespace lines.
2011-06-01 12:01:42 -07:00
Graydon Hoare
681f0c7a2b
Support printing globs.
2011-06-01 11:39:20 -07:00
Graydon Hoare
ae16639dfa
Slightly more aggressive about inserting whitespace. Getting frustrated with comments.
2011-06-01 11:39:20 -07:00
Lindsey Kuper
649a7bf38a
Comments and cleanup.
2011-06-01 11:34:52 -07:00
Paul Stansifer
9f5dddf08c
Now imports are not re-exported unless 'export' is explicitly used.
2011-05-31 18:43:26 -07:00
Graydon Hoare
0235e742f6
Give up on use of huge_word for comments. Still not formatting quite right, but closer.
2011-05-31 17:39:15 -07:00
Michael Sullivan
f4df2e4974
Fix pretty printer for move.
2011-05-31 17:39:14 -07:00
Michael Sullivan
78b0d33c35
More tests for <-.
2011-05-31 17:39:14 -07:00
Michael Sullivan
fd1029e6dd
Support move as an initializer.
2011-05-31 17:39:14 -07:00
Michael Sullivan
68b4688875
Add some simple tests for move.
2011-05-31 17:39:14 -07:00
Michael Sullivan
c232964301
Implement move semantics.
2011-05-31 17:39:14 -07:00
Michael Sullivan
5e7bba3d23
Insert plumbing for move that behaves just like assign.
2011-05-31 17:39:14 -07:00
Eric Holk
43342e9a66
Updating snapshot
2011-05-31 17:40:17 -07:00
Eric Holk
84a56ed7cd
Teach the compiler to understand yield and join, as well as using task as a type name.
2011-05-31 16:28:13 -07:00
Brian Anderson
9daa00bf83
rustc: Teach rustc to use block results as fn return values. Closes #372
2011-05-31 19:18:55 -04:00
Graydon Hoare
223c7dfb11
Fix comment-scanning logic in lexer.
2011-05-31 15:31:50 -07:00
Graydon Hoare
2de1a4bb1b
Handle pretty-printing else-if properly.
2011-05-31 12:58:02 -07:00
Rafael Ávila de Espíndola
cc96eeafca
Move rust_vec_append_glue to rt.
2011-05-31 14:32:08 -04:00
Graydon Hoare
b6971d94df
Consolidate formatting functions a bit more.
2011-05-31 11:00:47 -07:00
Graydon Hoare
55e3cd41de
Fix utility printers to flush eof in common.rs.
2011-05-31 11:00:47 -07:00
Graydon Hoare
1811513552
Fix long lines
2011-05-31 11:00:47 -07:00
Graydon Hoare
371c25683c
Break methods in obj types.
2011-05-31 11:00:47 -07:00
Graydon Hoare
1676c67446
Tighten up comment rules a little more.
2011-05-31 11:00:47 -07:00
Graydon Hoare
cf57553679
Improve handling of trailing comments.
2011-05-31 11:00:47 -07:00
Graydon Hoare
b48cab962a
Add span to field to catch per-field comments in rec exprs.
2011-05-31 11:00:47 -07:00
Graydon Hoare
d12ea39896
Improve comment handling in pp.
2011-05-31 11:00:47 -07:00
Graydon Hoare
30f8348473
Differentiate consistency of commasep boxes
2011-05-31 11:00:47 -07:00
Graydon Hoare
21313d623a
new pretty printer
2011-05-31 11:00:47 -07:00
Rafael Ávila de Espíndola
697be84d61
Fix the bots.
2011-05-31 13:50:16 -04:00
Rafael Ávila de Espíndola
3dc6c3b737
Remove code that is now dead.
2011-05-31 13:38:10 -04:00
Rafael Ávila de Espíndola
ebe055c307
Merge remote-tracking branch 'upstream/master'
2011-05-31 13:19:15 -04:00
Tim Chevalier
18a1cce2bc
change fn to pred in pred-on-wrong-slots (but it's still xfailed
2011-05-31 10:13:25 -07:00
Rafael Ávila de Espíndola
b0a5c09986
New snapshot.
2011-05-31 13:11:59 -04:00
Rafael Ávila de Espíndola
e66f9e46f6
Start finishing up the rust_start signature transition.
2011-05-31 11:17:17 -04:00
Marijn Haverbeke
7d68cbdff0
Have blocks return their result by writing to a reserved space
...
This makes it possible to pass the location of that space through to
nested blocks, resulting in less copying, taking, and dropping.
This makes the compiler slightly faster and 19k smaller.
A FIXME is to use 'move' semantics when returning the values from the
block -- don't bump the refcount and drop it again for the returning
block, but simply assign ownership to the receiver. To do this, we'll
need a way to (safely) scrub things from a block's cleanup list.
2011-05-31 14:29:16 +02:00
Brian Anderson
81fc2d8728
rustc: Remove unneeded type params from alt patterns
2011-05-31 01:23:53 -04:00
Brian Anderson
ed0eb8f45a
stdlib: Remove unneeded type params from alt patterns
2011-05-31 01:23:53 -04:00
Brian Anderson
c1d97a41eb
Register new snapshots
2011-05-31 01:23:05 -04:00
Brian Anderson
c7e3f88c93
rustc: Pushdown type params for tag patterns. Closes #363
2011-05-31 00:00:04 -04:00
Brian Anderson
973b93ee2a
rt: Use new module syntax for logging rt pseudo-modules
...
Now use RUST_LOG=rt::mem instead of RUST_LOG=rt.mem
2011-05-30 17:17:51 -04:00
Tim Chevalier
18883fea3a
In pre/postcondition computation, failing calls should set the postcondition
...
A non-returning call should have a postcondition in which all predicates
are true -- not just a poststate. Otherwise, alt expressions where
one or more branches terminate in a non-returning call and others
initialize a variable get rejected.
Includes a test case.
2011-05-27 20:43:51 -07:00
Tim Chevalier
95e1aa18c1
change comment
2011-05-27 20:43:51 -07:00
Tim Chevalier
9a24e4f780
Fix two typestate bugs
...
* Non-returning calls should set all predicates to be true, not
just the "this function returns" predicate
* Fixed a bug in the expr_alt case in tstate.states that wasn't updating
the changed flag properly, then fixed *another* bug that was updating
it too enthusiastically, but was masked by the first bug.
2011-05-27 20:43:51 -07:00
Lindsey Kuper
dc9d5e1689
Lots of comments, and some more descriptive names.
2011-05-27 18:20:43 -07:00
Tim Chevalier
b6e0c5829f
Check the declaration type in a for loop against the sequence type
...
Changed the typechecker to correctly typecheck the declared variable
type in a for or for-each loop against the vector element type (for
a for loop) or the iterator type (for a for-each loop). Added a
test case.
2011-05-27 17:42:09 -07:00
Tim Chevalier
0c5a55f275
add a function that returns the type of a local decl
2011-05-27 17:34:50 -07:00
Graydon Hoare
85a2b0bfb9
Re-XFAIL, not valgrind-clean.
2011-05-27 15:52:00 -07:00
Eric Holk
52795049e7
Generating names for wrappers, removed extra logging
2011-05-27 15:37:19 -07:00
Eric Holk
8cfc388d40
Switched calling conventions so that spawn with multiple arguments works.
2011-05-27 15:20:58 -07:00
Eric Holk
d49998f0ed
Switching over to wrappers for spawning functions of multiple arguments. Doesn't quite work yet.
2011-05-27 15:20:58 -07:00
Eric Holk
842bf7cad1
Un-XFAILing spawn tests.
2011-05-27 15:20:58 -07:00
Eric Holk
da0e0b6f5e
Removing excessively verbous logging.
2011-05-27 15:20:58 -07:00
Eric Holk
a88af906c5
Programs using spawn terminate
2011-05-27 15:20:58 -07:00
Eric Holk
dad426419c
Working on 2 argument spawn. The arguments seem to be copied correctly once, but then they get lost.
2011-05-27 15:20:58 -07:00
Eric Holk
bb4c7a9c68
Arguments seem to be correctly passed to child processes now.
2011-05-27 15:20:58 -07:00
Eric Holk
21efd07bc1
New tasks run, but their arguments get lost and something ends up in an infinite loop when the task exits.
2011-05-27 15:20:58 -07:00
Lindsey Kuper
867e9fb030
Test case showing that issue 324 is resolved.
2011-05-27 12:45:01 -07:00
Tim Chevalier
0cbcf92749
Use annotations on blocks
...
Previously, block_ty returned the type of the terminating
expression of the block (or nil if said expression was absent).
I changed check_expr to write the type of that expression into
the annotation for the block itself, so now block_ty can use the
block's annotation.
2011-05-27 12:21:37 -07:00
Michael Sullivan
a7a42c24be
Change the syntax for RECV from "var <- port" to "port |> var".
2011-05-27 12:01:20 -07:00
Michael Sullivan
2119e3b5b9
Fix missing bump in RECV lexer case.
2011-05-27 12:01:20 -07:00
Michael Sullivan
9c79200a7f
Pretty print the new RECV token...
2011-05-27 12:01:20 -07:00
Michael Sullivan
ea16e582eb
Remove parser support for recv as an initializer in preparation for changing the recv syntax.
2011-05-27 12:01:20 -07:00
Michael Sullivan
55b40e6894
Lex '|>' as the RECV token.
2011-05-27 12:01:20 -07:00
Tim Chevalier
147b088125
Test for use of break as an expression
...
The test was meant to verify that the typechecker correctly
allows a _|_ value (break, here) to be used in any context.
However, the compiler fails with an LLVM assertion failure.
I xfailed it, but wanted it to be on the record anyway.
2011-05-26 20:52:05 -07:00
Tim Chevalier
1a96e79fe0
Make _|_ unify with anything
...
The typechecker had a number of special cases for unifying types
with _|_ (as with checking if and alt). But, a value of type _|_
should be usable in any context, as such a value always diverges,
and will never be used by its immediate context. Changed unify
accordingly, removed special cases.
2011-05-26 20:50:25 -07:00
Paul Stansifer
af6b4821c1
Handle circularity in glob imports in a more elegant fashion.
2011-05-27 02:42:33 +00:00
Paul Stansifer
7fe3d821ac
Add a map from def_id s to items in resolve::env.
...
Use it to provide better error messages in the event of
glob-importing the same name multiple times.
2011-05-27 02:42:33 +00:00
Paul Stansifer
54ca8565c9
Fix bugs: make sure glob imports show up in the right module,
...
and make sure that circular glob imports don't diverge.
2011-05-27 02:42:33 +00:00
Paul Stansifer
3375b8fba2
Add list function 'has'.
2011-05-27 02:42:33 +00:00
Paul Stansifer
40fe44d23e
"import module::*;" now works.
2011-05-27 02:42:33 +00:00
Paul Stansifer
22953f52fa
Added filter_map.
2011-05-27 02:42:33 +00:00
Paul Stansifer
e2bb98001e
Part one of adding globbing to resolve.rs: build up glob links. (Part two will follow those links if non-glob resolution fails.)
2011-05-27 02:42:32 +00:00
Paul Stansifer
f11f846ead
Parsing and folding changes for globbed imports.
2011-05-27 02:42:32 +00:00
Tim Chevalier
610c81af19
Fix typo
2011-05-26 19:13:56 -07:00
Tim Chevalier
83cdb47a7c
Add a list append function, which I didn't end up using, but why not add it?
2011-05-26 19:13:56 -07:00
Graydon Hoare
fc31aa7f85
Fix testcase to be slightly less fussy about line number of error, as it just drifted.
2011-05-26 18:29:28 -07:00
Graydon Hoare
79c9e13073
More delicious dead code removal from runtime, upcalls.
2011-05-26 18:21:02 -07:00
Tim Chevalier
4f792f2dbb
Track spans for each local variable in typestate
...
This lets us print better messages in situations with name
shadowing.
2011-05-26 18:14:32 -07:00
Tim Chevalier
250643c549
Remove unused imports
2011-05-26 18:01:48 -07:00
Tim Chevalier
97e0575e2e
Add a span_str function in session
2011-05-26 18:00:54 -07:00
Tim Chevalier
79693fab1f
Fix typo in error message
2011-05-26 18:00:54 -07:00
Graydon Hoare
9f95538462
Remove redisue of unused fields from 'ann'.
2011-05-26 17:26:59 -07:00
Graydon Hoare
2561b01211
Remove residual uses of fold, and fold itself.
2011-05-26 17:16:54 -07:00
Graydon Hoare
8e945dcd81
Remove native glues. All calls to C are direct now.
2011-05-26 16:45:01 -07:00
Rafael Ávila de Espíndola
89e5f6c883
New snapshot.
2011-05-26 18:47:21 -04:00
Graydon Hoare
9491dc3e61
Add early returns to rustc main on non-compiling paths.
2011-05-26 15:22:08 +00:00
Graydon Hoare
dc1b34288c
Pretty print view items with :: rather than :.
2011-05-25 22:09:36 -07:00