Commit Graph

792 Commits

Author SHA1 Message Date
Lindsey Kuper
3cf582b529 Enable integer literal suffix inference. 2012-06-19 17:06:05 -07:00
Lindsey Kuper
b1fa8249f1 Fix incorrect fn name in debug statement 2012-06-19 17:04:39 -07:00
Lindsey Kuper
26bd186726 Don't create a new inference context for checking pattern ranges.
Ugly fix -- it would be better to refactor and consolidate the various
"make sure these types are the same" fns scattered around typeck.
2012-06-19 16:53:41 -07:00
Lindsey Kuper
3e281439a0 Union-find rank optimization for infer.
Makes deep-vector2 not run out of stack when suffix inference is
enabled.
2012-06-19 16:35:26 -07:00
Lindsey Kuper
906169d608 Add a node type in place of hand-rolled records in infer 2012-06-19 16:35:26 -07:00
Brian Anderson
636a849bf2 rustc: Add a temporary option to not link to the runtime 2012-06-19 12:36:59 -07:00
Niko Matsakis
6e73e45e37 first steps to autoderef on method calls 2012-06-19 11:52:39 -07:00
Niko Matsakis
b0646e0749 document liveness a bit better 2012-06-18 19:41:17 -07:00
Brian Anderson
1ec5a5c635 Add 'do' expressions 2012-06-18 17:42:30 -07:00
Michael Sullivan
30dd32d4db Fix generation of str/@. Closes #2638. 2012-06-18 15:54:37 -07:00
Michael Sullivan
797856cbde Use unboxed vecs for string shape glue. 2012-06-18 15:54:37 -07:00
Lindsey Kuper
567e4d9c6f Minor infer/typeck cleanups 2012-06-18 15:36:14 -07:00
Niko Matsakis
b0e66a6f3b Undo workaround for #2633 since it is fixed.
This reverts commit a14df270dc.

Conflicts:

	src/rustc/middle/trans/base.rs
2012-06-17 16:38:13 -07:00
Niko Matsakis
982e1166b2 Issue #2633: remove last_use entries that are subject to a loan 2012-06-17 16:17:40 -07:00
Tim Chevalier
416b3bfea4 Comments only 2012-06-16 15:16:31 -07:00
Tim Chevalier
a14df270dc Make move_val take its first argument by copy
Workaround for #2633 -- should allow changes on eholk's branch to
compile without segfaulting.
2012-06-16 14:30:20 -07:00
Michael Sullivan
6e63e2fd5f Fix copying of fixed length vectors. Closes #2630. 2012-06-15 15:31:19 -07:00
Michael Sullivan
a56902304d Make fixed length vecs implicitly copyable. Clean up some other kind code. Closes #2629 2012-06-15 15:31:19 -07:00
Tim Chevalier
093faaabe1 Handle index expressions' callee IDs correctly
Some code that handles unary and binary exprs' callee IDs was
    forgetting to handle the index expr case (since calls to
    user-defined index operators also have callee IDs). This was
    manifesting as an ICE in trans because when monomorphizing a
    function that had one of these operators in it (an index into a
    dvec, in the test case), the callee ID would be unbound to a type.

    Fixed it. Closes #2631.
2012-06-15 15:21:17 -07:00
Lindsey Kuper
7a253eabce Add an intermediate level of type/region variable resolution forcing
And change structurally_resolved_type() to force resolution of
non-region variables.
2012-06-15 12:54:44 -07:00
Paul Stansifer
1e36d216be Add the interner to parse_sess. 2012-06-15 12:41:41 -07:00
Michael Sullivan
68670f631c Make type_is_pod handle more types. 2012-06-15 11:48:04 -07:00
Patrick Walton
5151c08850 Issue #2591: Fix "upvar" jargon in borrowck error messages 2012-06-14 23:18:09 -07:00
Eric Holk
56bd689767 Merge branch 'incoming' of github.com:mozilla/rust into newsnap 2012-06-14 21:03:41 -07:00
Eric Holk
8ab15c0266 Merge branch 'incoming' into newsnap 2012-06-14 20:36:16 -07:00
Lindsey Kuper
77e6573929 Further work on integer literal suffix inference (#1425)
In this commit:

  * Change the lit_int_unsuffixed AST node to not carry a type, since
    it doesn't need one

  * Don't print "(unsuffixed)" when pretty-printing unsuffixed integer
    literals

  * Just print "I" instead of "(integral)" for integral type variables

  * Set up trans to use the information that will be gathered during
    typeck to construct the appropriate constants for unsuffixed int
    literals

  * Add logic for handling int_ty_sets in typeck::infer

  * Clean up unnecessary code in typeck::infer

  * Add missing mk_ functions to middle::ty

  * Add ty_var_integral to a few of the type utility functions it was
    missing from in middle::ty
2012-06-14 20:24:36 -07:00
Graydon Hoare
d953462d03 Complete a data visitor type that does proper pointer-walking. 2012-06-14 19:58:34 -07:00
Eric Holk
52c38ba886 Merge branch 'incoming' into newsnap 2012-06-14 19:36:22 -07:00
Patrick Walton
6969f0f2fc Issue #2572: (trans) Fix self-referential classes. 2012-06-14 18:51:31 -07:00
Tim Chevalier
dce5d6ab9c whitespace 2012-06-14 18:46:10 -07:00
Michael Sullivan
af60716281 Get an initial implementation of boxed vectors working. 2012-06-14 18:01:05 -07:00
Tim Chevalier
97bcb20244 Avoid some duplicated typechecking work
There was a FIXME noting that ty::enum_variants and typeck::check::
check_enum_variants both call eval_const_expr. I tried refactoring the
code so that check_enum_variants does all the work and enum_variants
just looks up cached results, but this turned out not to be easy because
several ty functions call enum_variants and it might get invoked on an
enum before that enum item has been typechecked. Instead, I just made
check_enum_variants update the enum_var_cache so that enum_variants
will never call eval_const_expr twice on the same const.
2012-06-14 16:21:53 -07:00
Graydon Hoare
aeb9a2b72c Add zero check/fail paths on div/mod paths. Close #944. 2012-06-14 15:39:24 -07:00
Tim Chevalier
c6462eec30 Comments only: annotate FIXMEs in reflect 2012-06-14 14:13:52 -07:00
Eric Holk
74d2f56f21 Adding move_val and move_val_init intrinsics. 2012-06-14 13:49:41 -07:00
Tim Chevalier
1642df8efa Remove a workaround 2012-06-14 12:40:49 -07:00
Tim Chevalier
fcab11da47 Refactor; annotate a FIXME 2012-06-14 12:24:56 -07:00
Tim Chevalier
24f9f45ac6 Comments only: annotate FIXMEs in typeck::infer 2012-06-14 12:10:48 -07:00
Tim Chevalier
699b14b99d Comments only: annotate a FIXME and remove an obsolete one 2012-06-14 12:07:42 -07:00
Tim Chevalier
730381d936 Annotate and fix FIXMEs in typeck 2012-06-14 12:04:05 -07:00
Tim Chevalier
87af3f3cca Dead code elimination 2012-06-14 11:10:32 -07:00
Michael Sullivan
591b2802ff Make trans only generate calls to the _dyn malloc upcalls, so we can get rid of the non dyn ones. 2012-06-13 18:00:17 -07:00
Michael Sullivan
4c0d41cffa Add a malloc_dyn upcall for dynamically sized allocations on the shared heap. 2012-06-13 17:59:21 -07:00
Tim Chevalier
e5a5fc2029 Allow impls to be re-exported
It was a little hard for me to believe, but it seems that re-exporting
an impl doesn't work at a, because encoder::encode_info_for_mod requires
that all the impls in the current module's impl map be local (that is,
bound to a value in the current crate's item map). Fixed it.

Closes #2414.
2012-06-13 15:52:00 -07:00
Tim Chevalier
6f95c79b95 Traverse types in reachability
Issue 2526 showed a test case where a library exported only a type
that was a synonym for a class. Because the class's destructor wasn't
getting marked as reachable, its linkage was wrongly getting set to
"internal". The solution is for reachability to traverse types.

Closes #2526.
2012-06-13 11:57:01 -07:00
Brian Anderson
ce750a7dbc Box AST idents 2012-06-13 11:30:45 -07:00
Michael Sullivan
bdd2000066 Some cleanup in tvec. 2012-06-13 11:17:02 -07:00
Tim Chevalier
aa9d2d88d3 Handle class destructors correctly in metadata
This allows destructors to be inlined, which is necessary since
classes can have both ty params and destructors.
2012-06-12 17:37:04 -07:00
Michael Sullivan
35dd717352 Simplify a bunch of trans functions to not need the rust type. Remove some PointerCasts. 2012-06-12 17:01:13 -07:00
Michael Sullivan
ccf4e8cf9a Make vectors contain the right type descriptor. Closes #2536. 2012-06-12 17:01:13 -07:00