about summary refs log tree commit diff
path: root/src/comp/middle/tstate/states.rs
AgeCommit message (Collapse)AuthorLines
2011-12-16Make uses of self in impls compileMarijn Haverbeke-1/+0
Get rid of expr_self_call, introduces def_self. `self` is now, syntactically, simply a variable. A method implicitly brings a `self` binding into scope. Issue #1227
2011-12-14first attempt, not happy with itNiko Matsakis-1/+1
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-2/+2
2011-12-08Allow binding of nested patternsMarijn Haverbeke-1/+1
See src/test/run-pass/nested-patterns.rs for some examples. The syntax is boundvar@subpattern Which will match the subpattern as usual, but also bind boundvar to the whole matched value. Closes #838
2011-12-07Make typestate properly descend pattern guardsMarijn Haverbeke-0/+6
Closes #1265
2011-11-30Box ast::path valuesMarijn Haverbeke-1/+1
It seems inefficient to copy them around. Let's measure whether that's actually > the case
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-10Cleanup unused importsHaitao Li-8/+4
2011-10-21Change the way block calls are parsed, mark them as block-calls.Marijn Haverbeke-1/+1
This makes it possible to omit the semicolon after the block, and will cause the pretty-printer to properly print such calls (if pretty-printing of blocks wasn't so broken). Block calls (with the block outside of the parentheses) can now only occur at statement level, and their value can not be used. When calling a block-style function that returns a useful value, the block must be put insde the parentheses. Issue #1054
2011-10-21Drop support for iter, put, and for-eachMarijn Haverbeke-11/+0
Closes #1056
2011-10-21Move ast_util::pat_bindings over to new iter system.Marijn Haverbeke-2/+2
Issue #1056
2011-09-20Represent unique creation as a unop in the AST instead of its own exprBrian Anderson-1/+0
Like the box unop. Issue #409
2011-09-15Forbid assignment to by-reference bindingsMarijn Haverbeke-1/+1
Issue #918
2011-09-14Rename ast::controlflow to ast::ret_styleMarijn Haverbeke-6/+6
It will include information about returning by alias.
2011-09-12Factor imports mindlessly.Graydon Hoare-24/+7
2011-09-12Reformat for new mode syntax, step 1Marijn Haverbeke-36/+33
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
2011-09-06Forbid blocks from deinitializing upvarsTim Chevalier-2/+22
Move expressions where the RHS is an upvar are now forbidden within block expressions.
2011-09-02Reformat. Issue #855Brian Anderson-1/+2
2011-09-02Handle if-check with no else correctly in typestateTim Chevalier-4/+17
Propagate the if-check constraint into the consequent even when there's no else branch. (Oops!)
2011-09-01Convert all uses of #ifmt to #fmt. Issue #855Brian Anderson-1/+1
2011-09-01Rename std::istr to std::str. Issue #855Brian Anderson-1/+1
2011-09-01Make resolve recognize upvarsMarijn Haverbeke-1/+1
Upvars are now marked with def_upvar throughout, not just when going through freevars::lookup_def. This makes things less error-prone. One thing to watch out for is that def_upvar is used in `for each` bodies too, when they refer to a local outside the body.
2011-08-31Get rid of the hack that ignores () typed things in fn tail position.Michael Sullivan-12/+6
Closes #868. Unfortunately, this causes certain invalid programs to fail type-checking instead of failing type-state when a type-state error message would probably be more intuitive. (Although, by any reasonable interpretation of the static semantics, it technically ought to be a type error.)
2011-08-31Convert uses of #fmt to #ifmt. Issue #855Brian Anderson-3/+3
2011-08-27Convert rustc::driver::session to istrs. Issue #855Brian Anderson-3/+4
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-98/+89
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-18Remove seq_kind from ast::expr_vecBrian Anderson-1/+1
2011-08-17Track arguments in typestateTim Chevalier-1/+8
Add the infrastructure for arguments -- as well as local vars -- to be deinitialized with move-mode calls. Address Issue #819
2011-08-16Port the compiler to the typaram foo<T> syntax.Erick Tryzelaar-3/+3
2011-08-16Removing tasks, ports and chans from the compiler.Eric Holk-25/+0
2011-08-16Rename std::ivec to std::vecBrian Anderson-10/+10
2011-08-15The wonky for...in... whitespace was bothering me. Sorry!Lindsey Kuper-3/+3
2011-08-15Add operator 'copy', translates as fall-through.Graydon Hoare-0/+3
2011-08-15Rename a field (so that macros can mention it).Paul Stansifer-2/+2
2011-08-15rustc: Parse and typecheck unique pointersPatrick Walton-0/+1
2011-08-15Tuple fields are immutableMarijn Haverbeke-2/+1
2011-08-15Tuple types back, not constructable yetMarijn Haverbeke-0/+6
2011-08-09Port the compiler to the ivec type [T] syntax.Erick Tryzelaar-3/+3
2011-08-08Implement typestate checking for move-mode args. Un-XFAIL ↵Graydon Hoare-18/+46
compile-fail/move-arg.rs.
2011-08-05Initialize all constraints to FalseTim Chevalier-9/+13
Previously, typestate was initializing the init constraint for a declared-but-not-initialized variable (like x in "let x;") to False, but other constraints to Don't-know. This led to over-lenient results when a variable was used before declaration (see the included test case). Now, everything gets initialized to False in the prestate/poststate- finding phase, and Don't-know should only be used in pre/postconditions. This aspect of the algorithm really needs formalization (just on paper), but for now, this closes #700
2011-08-03Make ast::pat_bindings an iteratorMarijn Haverbeke-1/+1
And use it to get rid of some repetetive code
2011-08-01Handle bang functions correctly in typestateTim Chevalier-37/+36
The logic for how the "returns" constraint was handled was always dodgy, for reasons explained in the comments I added to auxiliary::fn_info in this commit. Fixed it by adding distinct "returns" and "diverges" constraints for each function, which are both handled positively (that is: for a ! function, the "diverges" constraint must be true on every exit path; for any other function, the "returns" constraint must be true on every exit path). Closes #779
2011-08-01Partially implement destructuring localsMarijn Haverbeke-19/+11
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-29Refactor typestate code involving stmt_declsTim Chevalier-94/+98
To handle multiple-LHS declarations with initializers properly, I changed seq_states to take a list of expressions paired with optional names, not just a list of expressions. Then, the same logic that handles ordered lists of subexpressions everywhere else can handle multi- declarations.
2011-07-28The names 'outer' and 'inner' make more sense than 'self' and 'with'.Lindsey Kuper-1/+1
(Also, some formatting and long-string cleanup.)
2011-07-27Reformat for new syntaxMarijn Haverbeke-566/+548
2011-07-26Initial implementation of typestate for closures.Michael Sullivan-1/+1
There are still things not handled properly: relying on other preconditions of upvars is likely to cause bad things to happen. We probably want to disallow it.
2011-07-26Remove tuple support from the compilerMarijn Haverbeke-4/+0
2011-07-26Remove all uses of tuples from the compiler and stdlibMarijn Haverbeke-13/+16