about summary refs log tree commit diff
path: root/src/comp/middle/tstate/auxiliary.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-1115/+0
2012-03-02core: Remove _mut functions from vecBrian Anderson-1/+1
Instead, use vec::to_mut/from_mut to transform vectors in place as needed.
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-4/+4
2012-02-28change def's that are always local to use node_id, add --inline optNiko Matsakis-9/+9
2012-02-22Stop normalizing patternsMarijn Haverbeke-1/+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-15make mut a keyword synonymous with mutableNiko Matsakis-1/+1
first step towards issue #1273
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-6/+5
2012-02-09Remove some pointless importsMarijn Haverbeke-1/+0
2012-02-06Make ty::t type self-sufficientMarijn Haverbeke-6/+5
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-02-05infer modes rather than overwriting with expected tyNiko Matsakis-3/+5
2012-01-31Change option::t to optionTim Chevalier-8/+8
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-10/+10
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-26Remove ty_native_fnMarijn Haverbeke-1/+1
It was being used as a clumsy synonym of ty_fn.
2012-01-23s/block()/fn()/gNiko Matsakis-1/+1
2012-01-19rustc: ";" to "," in enumsPatrick Walton-10/+10
2012-01-19rustc: "tag" -> "enum"Patrick Walton-4/+4
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-14/+14
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-15/+11
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-13deprecate fn exprs and the fn() type, preferring fn@ and native fnNiko Matsakis-3/+4
2012-01-12Make driver::session::session no longer an objectMarijn Haverbeke-4/+5
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-11Implement std::map as an iface/impl instead of an objMarijn Haverbeke-3/+3
2012-01-06Disallow variable names that shadow tags in scopeTim Chevalier-6/+6
Now, if you have a tag named "foo", a variable declaration like "let foo..." is illegal. This change makes it possible to eliminate the '.' after a nullary tag pattern in an alt (but I'll be doing that in a future commit) -- as now it's always obvious whether a name refers to a tag or a new declared variable. resolve implements this change -- all the other changes are just to get rid of existing code that declares variables that shadow tag names.
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-2/+3
2012-01-04Reformat typestate error messages so as not to confuse emacs compilation modeTim Chevalier-3/+5
2011-12-29split proto from fn_decl, as not all fn_decls know the proto.Niko Matsakis-2/+2
this will address the (crashing) new test added.
2011-12-23Go back to a single visit_fn function in visit.rsMarijn Haverbeke-1/+1
2011-12-23Use the same type of record in ty::ty_fn and ty::methodMarijn Haverbeke-3/+3
Removes some more code duplication.
2011-12-22Register new snapshots, purge log_err and log_full in favour of log(...).Graydon Hoare-9/+9
2011-12-22Merge all 3 log syntaxes, tidy up residual misuses.Graydon Hoare-5/+5
2011-12-22Register snapshots and switch logging over to use of log_full or #error / ↵Graydon Hoare-33/+38
#debug.
2011-12-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-2/+3
2011-12-19integrate cap clause into type state, but not transNiko Matsakis-1/+3
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-1/+1
2011-12-14push changes through to get things compiling, if not running.Niko Matsakis-2/+3
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-3/+3
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-07Remove stmt_crate_directive, it's vestigial and confusing.Graydon Hoare-4/+0
2011-11-30Box ast::path valuesMarijn Haverbeke-3/+3
It seems inefficient to copy them around. Let's measure whether that's actually > the case
2011-11-22Only warn about unreachable range patterns when appropriateMarijn Haverbeke-1/+0
Also simplifies the literal-munging, and moves it into ast_util Closes #1170
2011-11-21rustc: Remove abi from ast::native_modHaitao Li-1/+1
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-10Cleanup unused importsHaitao Li-10/+7
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-21Move ast_util::pat_bindings over to new iter system.Marijn Haverbeke-2/+2
Issue #1056
2011-10-21Move hash table iteration over to block-taking functionsMarijn Haverbeke-8/+6
Issue #1056
2011-09-15Forbid assignment to by-reference bindingsMarijn Haverbeke-4/+5
Issue #918
2011-09-15Add representation for by-ref let bindingsMarijn Haverbeke-2/+4
Issue #918
2011-09-14Rename ast::controlflow to ast::ret_styleMarijn Haverbeke-3/+3
It will include information about returning by alias.
2011-09-12Factor imports mindlessly.Graydon Hoare-34/+12
2011-09-12Pretty-print for new arg-mode syntaxMarijn Haverbeke-1/+1