about summary refs log tree commit diff
path: root/src/comp/middle/tstate/annotate.rs
AgeCommit message (Collapse)AuthorLines
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-1/+1
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-10Cleanup unused importsHaitao Li-7/+3
2011-09-12Factor imports mindlessly.Graydon Hoare-19/+6
2011-09-12Reformat for new mode syntax, step 1Marijn Haverbeke-12/+12
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
2011-09-02Reformat. Issue #855Brian Anderson-3/+3
2011-09-01Rename std::istr to std::str. Issue #855Brian Anderson-1/+1
2011-09-01Remove various istr conversions. Issue #855Brian Anderson-1/+1
2011-08-27Convert std::int to istrs. Issue #855Brian Anderson-3/+3
2011-08-27Convert std::uint to istrs. Issue #855Brian Anderson-1/+2
2011-08-22Move functions from syntax::ast to syntax::ast_utilBrian Anderson-0/+1
This leaves syntax::ast just defining the AST, which strikes me as somewhat nicer
2011-08-20ReformatBrian Anderson-7/+7
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-15The wonky for...in... whitespace was bothering me. Sorry!Lindsey Kuper-1/+1
2011-08-09Port the compiler to the ivec type [T] syntax.Erick Tryzelaar-10/+10
2011-08-03Make ast::pat_bindings an iteratorMarijn Haverbeke-3/+1
And use it to get rid of some repetetive code
2011-08-01Partially implement destructuring localsMarijn Haverbeke-1/+3
You can now say let {bcx, val} = some_result_returner(); Similar for loop variables. Assigning to such variables is not safe yet. Function arguments also remain a TODO.
2011-07-27Reformat for new syntaxMarijn Haverbeke-41/+38
2011-07-26Convert all code that uses walk.rs in the straightforward way to simple_visitMarijn Haverbeke-12/+12
Code that needs the keep_going functionality is still using walk. I will add an equivalent to visit.rs later.
2011-07-25Rename the block type to be blk also. Sorry.Michael Sullivan-1/+1
2011-07-12rustc: Remove some useless std::vec importsPatrick Walton-1/+0
2011-07-07rustc: Change lots of AST nodes to use interior vectorsPatrick Walton-3/+3
2011-07-06rustc: Move tstate::annotate over to interior vectorsPatrick Walton-12/+12
2011-07-06rustc: Revert the conversion to interior vectors due to heap corruptionPatrick Walton-12/+12
2011-07-06rustc: Move tstate::annotate over to interior vectorsPatrick Walton-12/+12
2011-07-06Remove temporary stdlib placeholders, use actual stdlib functionsMarijn Haverbeke-6/+6
(Possible now that a snapshot took place.)
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-5/+6
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-06-30Warn for unused variablesTim Chevalier-10/+10
Modify typestate to check for unused variables and emit warnings where relevant. This exposed a (previously harmless) bug in collect_locals where outer functions had bit-vector entries for init constraints for variables declared in their inner nested functions. Fixing that required changing collect_locals to use visit instead of walk -- probably a good thing anyway.
2011-06-24Modify the fn vistors in walk so that they can handle functions without ↵Michael Sullivan-4/+5
names. Update the typestate code to understand this.
2011-06-24Remove uses of variable name 'res' from rustcMarijn Haverbeke-14/+14
This in preparation of making 'res' a keyword for defining resources. Please don't introduce too many new ones in the meantime...
2011-06-21Move expr ids into the expr record typeMarijn Haverbeke-2/+1
This simplifies the tag variants a bit and makes expr_node_id obsolete.
2011-06-20Get rid of def_ids and anns in AST nodes, use single node_idMarijn Haverbeke-28/+28
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-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-32/+27
2011-06-13Change decl to local in expr_for and expr_for_eachTim Chevalier-41/+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-10Fix unsafe uses of mutable referencesMarijn Haverbeke-10/+10
2011-06-01Redo typestate-related data structures to support predicate constraints. No ↵Tim Chevalier-4/+4
actual support yet, just infrastructure.
2011-05-26Track spans for each local variable in typestateTim Chevalier-8/+10
This lets us print better messages in situations with name shadowing.
2011-05-24Just removing some unnecessary imports.Lindsey Kuper-37/+0
2011-05-20Change node_ann hash table to a vector in typestateTim Chevalier-6/+7
2011-05-19Add ann as an argument to visit_fnTim Chevalier-7/+8
2011-05-19Add ident as an argument to visit_fn (typestate wants it)Tim Chevalier-10/+8
2011-05-19Rewrite tstate.annotate to use walk instead of foldTim Chevalier-383/+69
and various other tidying in typestate
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-10/+10
Except for _task, which is still a keyword.
2011-05-16Merge remote branch 'origin/master' into HEADGraydon Hoare-0/+492
Conflicts: src/comp/middle/trans.rs
2011-05-16Started adding support for return checking and non-returning function ↵Tim Chevalier-0/+492
annotations * Reorganized typestate into several modules. * Made typestate check that any function with a non-nil return type returns a value. For now, the check is a warning and not an error (see next item). * Added a "bot" type (prettyprinted as _|_), for constructs like be, ret, break, cont, and fail that don't locally return a value that can be inspected. "bot" is distinct from "nil". There is no concrete syntax for _|_, while the concrete syntax for the nil type is (). * Added support to the parser for a ! annotation on functions whose result type is _|_. Such a function is required to have either a fail or a call to another ! function that is reached in all control flow paths. The point of this annotation is to mark functions like unimpl() and span_err(), so that an alt with a call to err() in one case isn't a false positive for the return-value checker. I haven't actually annotated anything with it yet. * Random bugfixes: * * Fixed bug in trans::trans_binary that was throwing away the cleanups for nested subexpressions of an and or or (tests: box-inside-if and box-inside-if2). ** In typeck, unify the expected type arguments of a tag with the actual specified arguments.