Tim Chevalier
9427864f33
Unify the rhs and lhs types in a send
...
Closes #662 .
One-line fixes are always the best :-D
2011-07-11 15:24:47 -07:00
Patrick Walton
79ce5a4614
rustc: Implement pointer dereference; add a test case
2011-07-11 15:19:16 -07:00
Michael Sullivan
4618e802db
Fix comparisons of the nil type to do something sensible.
...
Closes #576 .
2011-07-11 14:45:21 -07:00
Brian Anderson
7fc7ebd520
The lexer's get_mark_str should slice by byte position, not char. Closes #654
2011-07-11 14:41:55 -07:00
Marijn Haverbeke
c893188549
Use some actual or-patterns in resolve.rs
2011-07-11 21:23:49 +02:00
Marijn Haverbeke
55e348280e
Fix pretty-printing of record patterns
2011-07-11 21:23:49 +02:00
Michael Sullivan
7340824cbc
Fix autoderef of function calls when the function is not an lval.
...
As it turns out, the correct way to handle this is much simpler than what I
did originally.
Also add more tests.
2011-07-11 11:38:01 -07:00
Michael Sullivan
cd97f4eed0
Fix handling of derived tydescs in bind.
...
In trans_bind_thunk, we need to load the tydescs from the environment *before*
we try to construct derived tydescs from them.
2011-07-11 11:37:55 -07:00
Michael Sullivan
0beb271d8c
Fix bind to work with boxed arguments with type parameters.
...
This still doesn't work with bare fn arguments with type parameters.
2011-07-11 11:37:55 -07:00
Marijn Haverbeke
7595fe5153
Implement record patterns
...
Closes #469 .
2011-07-11 15:32:41 +02:00
Marijn Haverbeke
12cb128a0a
Move visit to newtype-style nominal type
...
This makes getting the function fields out of the visitor less
cumbersome and more efficient (no take/drop).
2011-07-11 13:53:50 +02:00
Marijn Haverbeke
5f544b1366
Output a meaningful error when too few or too many type parameters given
...
Closes #619
2011-07-11 13:19:34 +02:00
Marijn Haverbeke
86ee3454a1
Implement or-patterns in case clauses
...
You can now say
expr_move(?dst, ?src) | expr_assign(?dst, ?src) { ... }
to match both expr_move and expr_assign. The names, types, and number
of bound names have to match in all the patterns.
Closes #449 .
2011-07-11 11:01:54 +02:00
Marijn Haverbeke
4d325b1a15
Spill instead of copy when binding a pattern that's only a var binding
...
The alias rules guarantee that the alt-ed value will outlive the binding's
last use, so this is safe.
This is a preparation for or-patterns. Joining scoped bindings seems like
it would get messy.
2011-07-11 10:33:19 +02:00
Jesse Ruderman
ea69f48eac
Add a missing case so nbody.rs can pp
2011-07-10 17:05:25 -07:00
Jesse Ruderman
ab50da9445
Export noop_fold_expr so the fuzzer can use it
2011-07-10 17:05:25 -07:00
Brian Anderson
6d3513eaee
Make #fmt work from inside std. Issue #175
...
At long last, this patch makes #fmt usable from inside the standard library.
The way it does it us very hackish, but at least it works now.
2011-07-10 17:00:28 -07:00
Brian Anderson
e494e73cdd
Use more encapsulation for metadata::cstore
2011-07-10 15:44:11 -07:00
Patrick Walton
f42c94740a
rustc: Make rust-intrinsics take an explicit return pointer
2011-07-09 21:13:25 -07:00
Brian Anderson
75047ea87e
Generate code to load a crate's tests into the std test runner. Issue #428
2011-07-09 19:30:04 -07:00
Brian Anderson
f72dbec9b5
Collect functions that look like unit tests. Issue #428
2011-07-09 12:36:03 -07:00
Brian Anderson
5543404abe
Track the path as we fold over the AST looking for unit tests. Issue #428
2011-07-09 12:35:30 -07:00
Tim Chevalier
182c413af1
Propagate constraints through copy, move, and swap
...
Assignments and moves with a simple local variable reference on the
RHS now propagate any typestate constraints the RHS was involved
in to the LHS. Swaps where both sides are local variables
exchange the constraints.
This was a pain in the butt and I'm still not proud of the resulting
code. Needs refactoring like whoa.
2011-07-08 22:25:57 -07:00
Tim Chevalier
be6febb46d
Minor refactoring
2011-07-08 22:25:57 -07:00
Tim Chevalier
7060f4c89c
Alias-ify some prettyprinting functions
2011-07-08 22:25:57 -07:00
Tim Chevalier
36c4cb37ad
Improve impossible-case handling in ty::get_element_type
2011-07-08 22:25:57 -07:00
Brian Anderson
7498d03693
Improve the error message for import glob collisions. Closes #482
...
Instead of noting where the imported things were defined, note where they were
imported. This is more useful and avoids issue #482 .
2011-07-08 18:55:01 -07:00
Patrick Walton
1ff426b89f
rustc: Use interior vectors for the union-find in rustc
2011-07-08 17:00:21 -07:00
Patrick Walton
8450ab9a2b
rustc: Fix a level-of-indirection problem by using size_of() to compute dynamically sized interior vector element sizes instead of field_of_tydesc()
2011-07-08 16:37:43 -07:00
Brian Anderson
f5d604f0c3
Decode types across multiple crates. Closes #632
2011-07-08 15:07:14 -07:00
Lindsey Kuper
33ce1164e2
Nicer pretty-printing for anon objs. Closes #499 .
...
(Incidentally, what's the right way to test changes to the
pretty-printer? There has to be a better way than what I did, which
was to log_err the results of expr_to_str as exprs passed through
trans and glance at the output.)
2011-07-08 15:00:47 -07:00
Brian Anderson
4319e7a655
Recursively load dependencies of external crates. Issue #632
2011-07-08 14:07:41 -07:00
Brian Anderson
412e203b3c
Refactor load_library_crate and resolve_crate
2011-07-08 14:07:41 -07:00
Brian Anderson
dd8ab24da2
Add a map from external cnums to local cnums in cstore::crate_metadata
...
Once populated, this will allow us to load type info for types defined in
external crates referenced by other external crates.
2011-07-08 14:07:41 -07:00
Brian Anderson
061bcb2e42
Extract resolve_crate from creader::visit_view_item
2011-07-08 14:07:41 -07:00
Rafael Ávila de Espíndola
4c309321e0
Try to use static crate if we cannot find the dynamic one. This supports
...
the common case of wanting to link statically with the project's libraries
but dynamically with the system ones.
2011-07-08 15:39:44 -04:00
Rafael Ávila de Espíndola
94f0e9d956
Add just enough logic to the driver so that we can link std statically.
2011-07-08 15:05:32 -04:00
Brian Anderson
4c0a2ed378
Fix newlines when outputting crate attributes with --ls
2011-07-08 11:34:15 -07:00
Brian Anderson
3070439c00
Encode/decode a crate's externel dependencies. Issue #632
...
The encoding is very simple right now, just the crate name. Ultimately this
won't be enough for our versioning needs, but it should fill our immediate
need of being able to correlate encoded crate numbers to actual crates.
2011-07-08 11:34:15 -07:00
Patrick Walton
7c66894a71
rustc: Do dynamic size calculations properly when concatenating interior vectors. Closes #640 .
2011-07-08 11:29:29 -07:00
Brian Anderson
d0a432f4bb
Don't export tyencode from the metadata module
...
This involves pulling the type_abbrev cache out of crate_ctxt
2011-07-08 09:37:01 -07:00
Brian Anderson
00d54018f1
Cleanup decoding and crate searching
2011-07-08 09:37:01 -07:00
Brian Anderson
06391dda02
Make the interface to metadata::csearch more consistent
2011-07-08 09:37:01 -07:00
Brian Anderson
85212840c0
Remove unused functions from metadata::csearch
2011-07-08 09:37:01 -07:00
Brian Anderson
9ebb60d38b
Extract various dependencies from metadata::decoder to metadata::csearch
2011-07-08 09:37:01 -07:00
Brian Anderson
7ae711fc03
Begin splitting metadata::decoder into decoding and crate search modules
2011-07-08 09:37:01 -07:00
Brian Anderson
cc2924068f
Replace various ints with ast::crate_nums
2011-07-08 09:37:01 -07:00
Brian Anderson
29b766029c
Move external crate/lib resolution to its own pass
...
The scope of external crate reading is beyond the resolve pass now, as it
builds up tables of information needed for several different purposes.
2011-07-08 09:37:01 -07:00
Brian Anderson
85535fc3e0
Move crate_map from resolve to cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
513b2276c2
Remove non-existant export from metadata::decoder
2011-07-08 09:37:00 -07:00