about summary refs log tree commit diff
path: root/src/comp/middle/ty.rs
AgeCommit message (Collapse)AuthorLines
2011-07-06rustc: Make type parameter substitutions interior vectorsPatrick Walton-5/+5
2011-07-06rustc: Change constraints in types to use interior vectorsPatrick Walton-8/+8
2011-07-06rustc: Switch tag type parameters to interior vectorsPatrick Walton-7/+7
2011-07-06rustc: Use interior vectors for tag type parametersPatrick Walton-20/+35
2011-07-05Don't thread the local crate number through the sessionMarijn Haverbeke-2/+2
It's a constant, anyway.
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-68/+70
src/comp/syntax is currently just a sub-module of rustc, but it will, in the near future, be its own crate. This includes: - The AST data structure - The parser - The pretty-printer - Visit, walk, and fold - The syntax extension system - Some utility stuff that should be in the stdlib* *) Stdlib extensions currently require a snapshot before they can be used, and the win build is very broken right now. This is temporary and will be cleaned up when one of those problems goes away. A lot of code was moved by this patch, mostly towards a more organized layout. Some package paths did get longer, and I guess the new layout will take some getting used to. Sorry about that! Please try not to re-introduce any dependencies in syntax/ on any of the other src/comp/ subdirs.
2011-07-04Move the ids of pat AST nodes into their structMarijn Haverbeke-12/+1
Just like it was done with items and exprs. Simplifies some code.
2011-07-01rustc: Move path_to_str to front::astPatrick Walton-14/+1
2011-07-01Revert "rustc: Change methods in ty::t to use interior vectors"Patrick Walton-22/+22
This reverts commit 6720ea760df41df82af880b593e5b6023608d6cd.
2011-07-01rustc: Change methods in ty::t to use interior vectorsPatrick Walton-22/+22
2011-07-01Track def_ids of native types so that they can be distinguishedMarijn Haverbeke-23/+34
Closes #526
2011-07-01Allow dereferencing of single-variant, single-argument tag valuesMarijn Haverbeke-2/+12
(Using the * operator.) This makes tags more useful as nominal 'newtype' types, since you no longer have to copy out their contents (or construct a cumbersome boilerplate alt) to access them. I could have gone with a scheme where you could dereference individual arguments of an n-ary variant with ._0, ._1, etc, but opted not to, since we plan to move to a system where all variants are unary (or, I guess, nullary).
2011-07-01Move autoderefed_ty to ty.rs and rename it type_autoderef.Michael Sullivan-0/+12
2011-06-30rustc: Change function argument types to interior vectorsPatrick Walton-28/+29
2011-06-30Kill unused variablesTim Chevalier-1/+0
2011-06-30rustc: Use interior vectors for record typesPatrick Walton-15/+13
2011-06-30rustc: Make mk_imm_tup() take an interior vectorPatrick Walton-3/+12
2011-06-30rustc: Use interior vectors for tuple typesPatrick Walton-13/+14
2011-06-30Support type parameters in resourcesMarijn Haverbeke-20/+67
Some rather dodgy code was added to trans in the process. I'd love to discuss it with someone who knows more about types during translation.
2011-06-29Re-enable tidy (it was broken) and fix various non-tidy things.Graydon Hoare-1/+2
2011-06-28rustc: Add a "type-owns-heap-mem" cache. 2x translation speedup.Patrick Walton-0/+10
2011-06-28Add some missing cases for ty_res in ty.rsMarijn Haverbeke-2/+28
2011-06-27Move what's left of metadata::cwriter into middle::transBrian Anderson-1/+0
2011-06-27Extract metadata::decoder from metadata::creaderBrian Anderson-2/+3
2011-06-27Rename middle::metadata to metadata::cwriter. Move creader to metadataBrian Anderson-2/+2
Preparation for a lot more metadata refactoring
2011-06-26Reformulate an assert in ty::tag_variantsBrian Anderson-2/+7
This was doing a redundant hashmap lookup. Removing the redundancy trims 5% (2.8s) off rustc's compile time
2011-06-25Fail typechecking for bad binop/type combinationsBrian Anderson-0/+91
Includes assignment operations. Add regression tests for lots of less useful, less used or unexpected combinations, as well as a selection of compile-fail tests. Closes #500 (again!)
2011-06-25Primitive support for non-copyable valuesMarijn Haverbeke-0/+8
2011-06-25Partial implementation of resourcesMarijn Haverbeke-6/+18
Non-copyability is not enforced yet, and something is still flaky with dropping of the internal value, so don't actually use them yet. I'm merging this in so that I don't have to keep merging against new patches.
2011-06-24Remove uses of variable name 'res' from rustcMarijn Haverbeke-3/+3
This in preparation of making 'res' a keyword for defining resources. Please don't introduce too many new ones in the meantime...
2011-06-24Remove def_objMarijn Haverbeke-1/+0
Since obj constructors and types have different def_ids now, their def can simply be a def_fn and a def_ty.
2011-06-24rustc: If needed, duplicate types' heap parts recursively through structural ↵Patrick Walton-26/+52
types
2011-06-23Correct error message for argument mode mismatchTim Chevalier-3/+9
If you use a function expecting an alias argument in a context that expects a function expecting a value argument, or vice versa, the previous error message complained that the number of arguments was wrong. Fixed the error message to be accurate.
2011-06-22rustc: Remove some unneeded type annotationsBrian Anderson-9/+9
2011-06-22rustc: Don't commit unification changes until unify succeedsBrian Anderson-8/+16
This is so that subsequent reports about type mismatches get the types correct. Issue #516
2011-06-22Fix bug: globbed imports were importing everything visible from the otherPaul Stansifer-1/+3
module, not just everything exported.
2011-06-21Emit a better error message for unbound type parameters in nested functionsTim Chevalier-6/+11
This code was causing a bounds check failure: fn hd[U](&vec[U] v) -> U { fn hd1(&vec[U] w) -> U { ret w.(0); } ret hd1(v); } because in hd1, U was being treated as if it referred to a type parameter of hd1, rather than referring to the lexically enclosing binding for U that's part of hd. I'm actually not sure whether this is a legit program or not. But I wanted to get rid of the bounds check error, so I assumed that program shouldn't compile and made it a proper error message.
2011-06-21Serialize constraints in types (literal arguments still not supported)Tim Chevalier-1/+1
This involved, in part, changing the ast::def type so that a def_fn has a "purity" field. This lets the typechecker determine whether functions defined in other crates are pure. It also required updating some error messages in tests. As a test for cross-crate constrained functions, I added a safe_slice function to std::str (slice(), with one of the asserts replaced with a function precondition) and some test cases (various versions of fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for some of the boolean functions in std::uint.
2011-06-21Move expr ids into the expr record typeMarijn Haverbeke-56/+8
This simplifies the tag variants a bit and makes expr_node_id obsolete.
2011-06-20Use ast_map in typeck, instead of building another indexMarijn Haverbeke-11/+5
2011-06-20Get rid of def_ids and anns in AST nodes, use single node_idMarijn Haverbeke-91/+95
This reduces some redundancy in the AST data structures and cruft in the code that works with them. To get a def_id from a node_id, apply ast::local_def, which adds the local crate_num to the given node_id. Most code only deals with crate-local node_ids, and won't have to create def_ids at all.
2011-06-20Added string duplication to deep_copy. Closes #520.Eric Holk-0/+8
2011-06-20Removed duplicated ret_ty_of_fn. This also means the native function branch ↵Eric Holk-1/+5
is working now, so this commit closes #506.
2011-06-19rustc: Change smallintmap to use an ivec and use it for the node type table. ↵Patrick Walton-5/+4
3x typechecking speedup.
2011-06-19rustc: Export only what's needed from middle::tyBrian Anderson-3/+164
The list is formidable.
2011-06-19rustc: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-4/+4
Issue #440
2011-06-19Revert previous 6 commits. Hopefully put out Windows fire.Brian Anderson-168/+7
Revert "rustc: Export only what's needed from middle::ty" This reverts commit 4255d58aa5db2a05362c4435a0e807205e1b8ed7. Revert "rustc: Make name resolution errors less fatal" This reverts commit b8ab9ea89c16c60237e7660804f4321f59ae0435. Revert "rustc: Make import resolution errors less fatal" This reverts commit 92a8ae94b971206bf0502da3dc5f416fcb24cc36. Revert "rustc: Export only what's used from middle::resolve" This reverts commit 4539a2cf7ad99851a165c98ed2f4e4a475cffd7d. Revert "rustc: Re-introduce session.span_err, session.err" This reverts commit 7fe9a88e31ae07f2fd89f6715efedd7e3edf49e6. Revert "rustc: Rename session.span_err -> span_fatal, err -> fatal" This reverts commit c394a7f49ac29a099994e243017065de2ff97f2a.
2011-06-19rustc: Export only what's needed from middle::tyBrian Anderson-3/+164
The list is formidable.
2011-06-19rustc: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-4/+4
Issue #440
2011-06-18rustc: Cache results of type_has_pointers. 70% translation speedup.Patrick Walton-21/+27