about summary refs log tree commit diff
path: root/src/comp/middle/tstate/states.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-783/+0
2012-03-01Use the correct prestate for callsTim Chevalier-2/+2
The prestate for calls was getting set incorrectly to the poststate for the operator in the call. This worked before since most of the time, operator expressions are pure. Issue 1895 shows how this breaks when the operator is a closure that has a move-in capture clause. (I had a several-day, multi-file patch for this that didn't work... and then it turned out to be a one-line fix. The joys of programming.) Closes #1895
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-1/+1
2012-02-28change def's that are always local to use node_id, add --inline optNiko Matsakis-3/+2
2012-02-22Stop normalizing patternsMarijn Haverbeke-2/+1
The check for whether a pat_ident is a variant or a binding is simple and fast. Normalizing patterns again and again is slow and error-prone (several places were forgetting to do it).
2012-02-15Support 'alt check' syntaxMarijn Haverbeke-1/+1
It is only a way to flag an alt as intentionally non-exhaustive right now. Issue #1679
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-1/+1
2012-02-09Remove some pointless importsMarijn Haverbeke-2/+0
2012-02-06Make ty::t type self-sufficientMarijn Haverbeke-1/+1
It is now no longer needed to have a ty::ctxt to get at the contents of a ty::t. The straight-forward approach of doing this, simply making ty::t a box type, unfortunately killed our compiler performance (~15% slower) through refcounting cost. Thus, this patch now represents ty::t as an unsafe pointer, assuming that the ty::ctxt, which holds these boxes alive, outlives any uses of the ty::t values. In the current compiler this trivially holds, but it is does of course add a new potential pitfall. ty::get takes a ty::t and returns a boxed representation of the type. I've changed calls to ty::struct(X) to do ty::get(X).struct. Type structs are full of vectors, and copying them every time we wanted to access them was a bit of a cost.
2012-01-31Change option::t to optionTim Chevalier-3/+3
Now that core exports "option" as a synonym for option::t, search-and- replace option::t with option. The only place that still refers to option::t are the modules in libcore that use option, because fixing this requires a new snapshot (forthcoming).
2012-01-31Require alts to be exhaustiveTim Chevalier-4/+5
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-30Remove ternary operatorPaul Woolcock-3/+0
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have been removed.
2012-01-21issue #1352: change param order on vec::init_elt, putting block in final ↵Graham Fawcett-6/+6
position. To match the init_fn() and init_fn_mut() changes.
2012-01-20Handle fail after return correctly in typestateTim Chevalier-4/+18
Previously, typestate would conclude that this function was correctly diverging: fn f() -> ! { ret; fail; } even though it always returns to the caller. It wasn't handling the i_diverge and i_return bits correctly in the fail case. Fixed it. Closes #897
2012-01-19Handle predicates that recurse in a check() expressionTim Chevalier-1/+1
typestate was using the enclosing function ID for the "this function returns" constraint, which meant confusion and panic in the case where a predicate p includes "check p()". Fixed it to use a fresh ID. Closes #933
2012-01-19rustc: Remove trailing whitespacePatrick Walton-1/+1
2012-01-19Compute typestates for FRU exprs correctly, plus a bit of cleanupTim Chevalier-50/+36
The code in Issue 948 was causing typestate to diverge because it was using the prestate for the whole expression -- not the post- state for the fields list -- as the prestate for the record base expression. Fixed. Closes #948
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-17/+17
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-7/+10
This commit allows patterns like: alt x { some(_) { ... } none { } } without the '.' after none. The parser suspends judgment about whether a bare ident is a tag or a new bound variable; instead, the resolver disambiguates. This means that any code after resolution that pattern-matches on patterns needs to call pat_util::normalize_pat, which consults an environment to do this disambiguation. In addition, local variables are no longer allowed to shadow tag names, so this required changing some code (e.g. renaming variables named "mut", and renaming ast::sub to subtract). The parser currently accepts patterns with and without the '.'. Once the compiler and libraries are changed, it will no longer accept the '.'.
2012-01-13Obj system? What obj system?Marijn Haverbeke-6/+0
Removes the obj system from the compiler. Closes #1484
2012-01-12Make driver::session::session no longer an objectMarijn Haverbeke-0/+1
Rather, it is now a struct where properties like opts are accessed directly, and the error-reporting methods are part of a static impl (with the same name as the type).
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-1/+1
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-1/+1
this will address the (crashing) new test added.
2011-12-22Register new snapshots, purge log_err and log_full in favour of log(...).Graydon Hoare-4/+4
2011-12-22Merge branch 'master' of github.com:graydon/rustGraydon Hoare-1/+1
2011-12-22Register snapshots and switch logging over to use of log_full or #error / ↵Graydon Hoare-21/+21
#debug.
2011-12-22Unify some data structures in syntax::ast that were doing the same thingMarijn Haverbeke-1/+1
As a preparation to removing some duplication in typeck.
2011-12-21Switch log_expr to carrying a full expr:u32 for level. Add log_full variant ↵Graydon Hoare-2/+2
that parses that expr, prepare for snapshot.
2011-12-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-10/+13
2011-12-19integrate cap clause into type state, but not transNiko Matsakis-1/+16
2011-12-19Add type argument field to expr_pathMarijn Haverbeke-1/+1
This way, you can explicitly provide type parameters when calling a generic method. Issue #1227
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!)