Commit graph

3964 commits

Author SHA1 Message Date
Tim Chevalier
9ec5e90608 Tests for constraint propagation 2011-07-08 22:25:57 -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
Patrick Walton
91d45b91e6 stdlib: Implement str::unsafe_from_bytes_ivec() 2011-07-08 22:23:11 -07:00
Patrick Walton
aa0f6f4961 stdlib: Add an offset function for simple pointer arithmetic on unsafe pointers 2011-07-08 21:56:15 -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
Brian Anderson
394b8fcd1c Add test case for issue #333. Closes #333
This has been fixed by a mystery hacker.
2011-07-08 17:43:44 -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
9b7984c250 snap: Register new snapshots 2011-07-08 16:51:25 -07:00
Patrick Walton
ccfbb74f11 rustc: Move maps over to interior vectors 2011-07-08 16:37:43 -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
Eric Holk
79ca673af7 Adding more support for working with u64s. 2011-07-08 14:02:26 -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
Patrick Walton
0864a22ace stdlib: Add an interior vector version of union-find for now 2011-07-08 11:44:38 -07:00
Eric Holk
d7db25e8f6 Added an environment variable to override the minimum stack size. Closes #637. 2011-07-08 11:36:56 -07: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
Brian Anderson
51e60b6565 Comment creader 2011-07-08 09:37:00 -07:00
Brian Anderson
639cf1a8ff Comment cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
58d288a4f7 Move used_link_args from session to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
4bfa269fe7 Move used_libraries from session to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
1386420cad Move used_crate_files from session to cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
82983e5005 Replace the crate cache in session with the one in cstore 2011-07-08 09:37:00 -07:00
Brian Anderson
b23ecd47ce Introduce metadata::cstore
I intend for this to be the location for storing all the data retrieved by
creader, most of which is currently in the session.
2011-07-08 09:37:00 -07:00
Marijn Haverbeke
c7bfef43c8 Ignore current scope when resolving self-shadowing imports
That is, for example, import x::y::x, which defines a local x,
and thus wouldn't be able to find x::y anymore.

Closes issue #624
2011-07-08 16:04:40 +02:00
Marijn Haverbeke
eeda0f4ab1 Don't unbox types in ty::is_binopable, do it on typeck side instead
Closes issue #631

Removes ty::strip_boxes entirely, since unboxing is now more complicated
anyway.
2011-07-08 15:52:54 +02:00
Marijn Haverbeke
381505f947 Remove useless return value in typeck::check_decl_local 2011-07-08 15:01:54 +02:00
Marijn Haverbeke
022363a674 Auto-bind generic functions when their value is taken in non-call context
trans::trans_lval will now autobind if the given expression was the
name of a generic functions. Those callees (trans_call and trans_bind)
that are interested in the generics information call trans_lval_gen
now.
2011-07-08 14:28:46 +02:00
Marijn Haverbeke
faec0d7799 Avoid superfluous take/drop for temp values passes as arguments 2011-07-08 13:46:29 +02:00
Marijn Haverbeke
b41fd61045 Make for-each bodies close over their parent's iterbody
Closes issue #639
2011-07-08 11:55:15 +02:00