about summary refs log tree commit diff
path: root/src/comp/middle/alias.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-715/+0
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-4/+4
2012-02-22Stop normalizing patternsMarijn Haverbeke-4/+6
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-44/+44
first step towards issue #1273
2012-02-15Fix bug in safe-reference checkerMarijn Haverbeke-28/+16
At some point, a refactor broke the code that handled local declarations to no longer descend into the initializer expressions. Closes #1846
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-7/+3
2012-02-09Fix various bugs in monomorphizationMarijn Haverbeke-1/+1
Enough to be able to compile librustc with --monomorphize. Issue #1736
2012-02-09Remove some pointless importsMarijn Haverbeke-2/+1
2012-02-06Make ty::t type self-sufficientMarijn Haverbeke-8/+8
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-05Merge remote-tracking branch 'erickt/master'Brian Anderson-1/+1
Conflicts: src/libcore/vec.rs src/libstd/getopts.rs
2012-02-05infer modes rather than overwriting with expected tyNiko Matsakis-9/+16
2012-02-01Remove support for native typesMarijn Haverbeke-1/+1
Issue #1673
2012-01-31Change option::t to optionTim Chevalier-11/+11
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-0/+17
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-30Change all ternary ops to if/then/elsePaul Woolcock-6/+9
All the files below had at least one instance of the ternary operator present in the source. All have been changed to the equivalent if/then/else expression.
2012-01-28core: rename vec::position* functionsErick Tryzelaar-1/+1
Almost all of the vec functions that predicates don't have a corresponding function that takes a single element, so this commit renames the common fn usecase to be the default.
2012-01-26Remove ty_native_fnMarijn Haverbeke-1/+1
It was being used as a clumsy synonym of ty_fn.
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-3/+3
This should reduce confusion of people trying to read the code.
2012-01-23s/block()/fn()/gNiko Matsakis-1/+1
2012-01-19rustc: ";" to "," in enumsPatrick Walton-4/+4
2012-01-19rustc: "tag" -> "enum"Patrick Walton-4/+4
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-18/+18
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-4/+6
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-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-2/+5
2012-01-13Obj system? What obj system?Marijn Haverbeke-19/+6
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-3/+3
this will address the (crashing) new test added.
2011-12-23Go back to a single visit_fn function in visit.rsMarijn Haverbeke-4/+4
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-21Make { || ... } sugar for any type of closure, inferredNiko Matsakis-8/+11
2011-12-16reorder args to the various vec, option fns so blk comes lastNiko Matsakis-2/+2
2011-12-16Make uses of self in impls compileMarijn Haverbeke-13/+12
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-16Parse and resolve implementations.Marijn Haverbeke-1/+1
Issue #1227
2011-12-13Copy first batch of material from libstd to libcore.Graydon Hoare-2/+3
2011-12-08Allow binding of nested patternsMarijn Haverbeke-1/+2
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-3/+0
2011-12-07Change literal representation to not truncateMarijn Haverbeke-3/+2
Also shuffles around the organization of numeric literals and types, separating by int/uint/float instead of machine-vs-non-machine types. This simplifies some code. Closes #974 Closes #1252
2011-11-30Box ast::path valuesMarijn Haverbeke-4/+3
It seems inefficient to copy them around. Let's measure whether that's actually > the case
2011-11-23Rollback return-by-referenceMarijn Haverbeke-110/+3
It's proving too inflexible, so I'm ripping out the extra complexity in the hope that regions will, at some point, provide something similar. Closes #918
2011-11-21rustc: Remove abi from ast::native_modHaitao Li-1/+1
2011-11-21Close hole in safe-reference analysisMarijn Haverbeke-3/+15
2011-11-21Fix bad interaction between last-use finding and referencesMarijn Haverbeke-2/+9
The last-use pass now takes input from the alias pass to not mark things as last uses that are still accessed through a reference. Issue #925
2011-11-18Add a pass-by-copy parameter passing conventionMarijn Haverbeke-1/+4
This is intended to solve the problem of how to pass arguments to constructor functions -- you want to move in rvalues, but not have to explicitly copy stuff that is not an rvalue. The by-copy passing convention will ensure the callee gets its own copy of the value. For rvalues, it'll just pass off the value. For lvalues, it'll make a copy. Issue #1177
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-11-15Fix handling of loops and conditionals in alias.rsMarijn Haverbeke-62/+149
It now threads information about invalidated aliases through the AST properly. This makes it more permissive for conditionals (invalidating an alias in one branch doesn't prevent you from using it in another), and less permissive for loops (it now properly notices when a loop invalidates an alias that it might still use in another iteration). Closes #1144
2011-11-10Cleanup unused importsHaitao Li-2/+2
2011-11-03Disallow writing to function arguments againMarijn Haverbeke-1/+1
Remove implicit copying hack. Closes #1118
2011-10-25Properly take mutable object fields into account during alias analysisMarijn Haverbeke-16/+23
Closes #1055