about summary refs log tree commit diff
path: root/src/comp/middle/alias.rs
AgeCommit message (Collapse)AuthorLines
2011-07-27Reformat for new syntaxMarijn Haverbeke-448/+444
2011-07-26Remove tuple support from the compilerMarijn Haverbeke-12/+0
2011-07-26Remove all uses of tuples from the compiler and stdlibMarijn Haverbeke-16/+16
2011-07-25Rename the block type to be blk also. Sorry.Michael Sullivan-2/+2
2011-07-25Disallow block as a variable name in preparation for it becoming a keyword.Michael Sullivan-8/+8
2011-07-22Start adding support for multiple variable declarations per stmtMarijn Haverbeke-7/+9
This adds parser support and most of the machinery for auto x = 10, y = 20; However, the above still goes wrong somewhere in typestate, causing the state checker to believe only the last variable in the list is initialized after the statement. Tim, if you have a moment, could you go over the changes to the tstate code in this patch and see where I'm going wrong? Multi-var-decls without the typestate extension Add a loop
2011-07-22Fix unboxing in alias passMarijn Haverbeke-15/+27
The alias checker would only deref once for autoderef, and only deref boxes. It should now do the right thing. Closes #725.
2011-07-21Make ty::ctxt be boxed.Michael Sullivan-18/+18
Arguably we should leave ty_ctxt as a bare rec and just always work with boxes of it. This winds up being simpler and prettier, though.
2011-07-15rustc: Remove a bunch of exterior vectorsPatrick Walton-90/+93
2011-07-13box patterns, expect for the trans partMarijn Haverbeke-0/+1
2011-07-13Do not allow moving out of obj fields, properly check move initsMarijn Haverbeke-87/+85
Closes #591
2011-07-11rustc: Implement pointer dereference; add a test casePatrick Walton-0/+1
2011-07-11Implement record patternsMarijn Haverbeke-0/+3
Closes #469.
2011-07-11Move visit to newtype-style nominal typeMarijn Haverbeke-2/+2
This makes getting the function fields out of the visitor less cumbersome and more efficient (no take/drop).
2011-07-11Implement or-patterns in case clausesMarijn Haverbeke-1/+1
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-07rustc: Change lots of AST nodes to use interior vectorsPatrick Walton-3/+3
2011-07-07Improve handling of move and swap by alias checkerMarijn Haverbeke-10/+24
Closes issue #541. Closes issue #591
2011-07-06Remove temporary stdlib placeholders, use actual stdlib functionsMarijn Haverbeke-1/+1
(Possible now that a snapshot took place.)
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-8/+9
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-04Switch the alias checking pass to use span_err instead of span_fatalMarijn Haverbeke-12/+13
It'll now spit out all problems it finds, and only abort after the whole pass has run.
2011-07-04Move the ids of pat AST nodes into their structMarijn Haverbeke-2/+2
Just like it was done with items and exprs. Simplifies some code.
2011-07-01Allow dereferencing of single-variant, single-argument tag valuesMarijn Haverbeke-10/+5
(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-01Implement autoderef for function calls.Michael Sullivan-1/+1
This is important since we are going to be making functions noncopyable soon, which means we'll be seeing a lot of boxed functions. (*f)(...) is really just too heavyweight. Doing the autodereferencing was a very little bit tricky since trans_call works with an *lval* of the function whereas existing autoderef code was not for lvals.
2011-06-30rustc: Change function argument types to interior vectorsPatrick Walton-1/+1
2011-06-30Kill unused variablesTim Chevalier-1/+0
2011-06-30Support type parameters in resourcesMarijn Haverbeke-1/+1
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-29Extend visit to use visit_fn to visit fn expressions.Michael Sullivan-1/+2
2011-06-28Require that both sides of a swap be lvals.Michael Sullivan-5/+12
2011-06-28Make it possible to use * to dereference a resourceMarijn Haverbeke-4/+8
2011-06-21Move expr ids into the expr record typeMarijn Haverbeke-25/+25
This simplifies the tag variants a bit and makes expr_node_id obsolete.
2011-06-21rustc: Output an unimplemented message when alias encounters an unknown ↵Patrick Walton-0/+4
sequence type
2011-06-21rustc: Implement "for" over interior vectorsPatrick Walton-1/+5
2011-06-20Fix some uses of span_warn in alias.rs that should be span_fatalMarijn Haverbeke-2/+2
2011-06-20Get rid of def_ids and anns in AST nodes, use single node_idMarijn Haverbeke-38/+38
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-19rustc: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-10/+10
Issue #440
2011-06-19Revert previous 6 commits. Hopefully put out Windows fire.Brian Anderson-10/+10
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: Rename session.span_err -> span_fatal, err -> fatalBrian Anderson-10/+10
Issue #440
2011-06-17rustc: Add missing case for interior vectors in alias.rsPatrick Walton-0/+6
2011-06-16Reformat a bunch of recent churn.Graydon Hoare-33/+31
2011-06-16Refactor ast::item representationMarijn Haverbeke-1/+1
Most of the fields in an AST item were present in all variants. Things could be simplified considerably by putting them in the rec rather than in the variant tags.
2011-06-15Refactor data structures representing constraints (again...)Tim Chevalier-9/+6
I added a "resolved" version of the ast::constr type -- ty::constr_def -- that has a def_id field instead of an ann_field. This is more consistent with other types and eliminates some checking. Incidentally, I removed the def_map argument to the top-level function in middle::alias, since the ty::ctxt already has a def_map field.
2011-06-15Implement checking of alias safety in tail calls.Marijn Haverbeke-30/+75
2011-06-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-209/+190
2011-06-15rustc: Make room in remaining AST item nodes for attributesBrian Anderson-1/+1
Issue #487
2011-06-15Implement checking against assignments to immutable obj fieldsMarijn Haverbeke-33/+58
2011-06-15Extend alias analysis to check assignmentsMarijn Haverbeke-2/+23
This is a somewhat odd place to put these checks, but the data tracked by that pass, and the available functions, make it trivial to do such a check there.
2011-06-15Refactor expr_root in alias.rsMarijn Haverbeke-73/+71
It was too clunky and specific before. Now returns a vec of dereference specs instead of a bunch of special-case information. Further accessors extract the information they need from this vec.
2011-06-13Change decl to local in expr_for and expr_for_eachTim Chevalier-8/+4
Since the decl in a for or for-each loop must always be a local decl, I changed the AST to express this. Fewer potential match failures and "the impossible happened" error messages = yay!
2011-06-10Handle mutable references in alias analysisMarijn Haverbeke-32/+78
2011-06-10Implement mutable/immutable alias distinction.Marijn Haverbeke-15/+39
Before, all aliases were implicitly mutable, and writing &mutable was the same as writing &. Now, the two are distinguished, and assignments to regular aliases are no longer allowed.