about summary refs log tree commit diff
path: root/src/comp/middle/resolve.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-2381/+0
2012-02-29optionally enforce local variable mutabilityNiko Matsakis-3/+4
2012-02-29Recognize last uses for copied closed-over variablesMarijn Haverbeke-2/+1
And clean up and fix some bad things in last_use.rs. Closes #1894
2012-02-28change def's that are always local to use node_id, add --inline optNiko Matsakis-11/+13
2012-02-23rustc: Don't add duplicate entries to exp_mapBrian Anderson-1/+7
2012-02-23Support basic, unsophisticated, somewhat wrong export-globs.Graydon Hoare-50/+145
2012-02-23Treat export-globs as import-globs for sake of linking.Graydon Hoare-3/+12
2012-02-23Minor renaming to help my comprehension.Graydon Hoare-38/+44
2012-02-22Improve error message for use of a non-pure-fn in a predTim Chevalier-3/+3
Closes #1883
2012-02-22Stop normalizing patternsMarijn Haverbeke-11/+9
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-22Remove preconditions from librariesMarijn Haverbeke-2/+0
Closes #1805
2012-02-20Oops, my whitespace is showingTim Chevalier-1/+1
2012-02-20Further work on resolving and typechecking classesTim Chevalier-13/+56
Class tests aren't working yet, but they fail a little later :-) Also, make the parser correctly set a constructor's result type to its enclosing class type.
2012-02-18rustc: Add missing space to error messageBrian Anderson-1/+1
2012-02-17Refactor view_path to parse (but not yet process) export globs, unify code ↵Graydon Hoare-185/+253
paths.
2012-02-17rustc: Make resolve more forgiving of missing external cratesBrian Anderson-4/+12
Rustdoc needs to be able to resolve locals without resolving externals
2012-02-17rustdoc: Resolve imports and reexportsBrian Anderson-19/+32
2012-02-15Replace some explicit fails with 'alt check' invocationsMarijn Haverbeke-13/+7
2012-02-15Fix bug in safe-reference checkerMarijn Haverbeke-7/+7
At some point, a refactor broke the code that handled local declarations to no longer descend into the initializer expressions. Closes #1846
2012-02-11core: Change the argument order for vec::contains, vec::countBrian Anderson-3/+3
2012-02-11core: Rename vec::member to vec::contains to match str modBrian Anderson-3/+3
2012-02-10Remove a vestige of return-by-referenceMarijn Haverbeke-6/+6
2012-02-09Further WIP on classesTim Chevalier-1/+13
Changes to resolve and typeck. Still nothning working yet.
2012-02-09Remove some pointless importsMarijn Haverbeke-2/+1
2012-02-08A bit more WIP on classes, and some cleanup in resolveTim Chevalier-83/+131
2012-02-07Minor class-related tweaks to the ASTTim Chevalier-1/+2
2012-02-06Handle built-in typenames in the resolve pass, rather than in parserMarijn Haverbeke-19/+43
Closes #1728 Comments out a section of debuginfo.rs. This code was already broken (only being called when --xg was passed, and only working on trivial programs).
2012-02-06Self types for ifacesMarijn Haverbeke-2/+9
This allows a 'Name:' to appear in front of an iface declaration's name, which will cause 'Name' to refer to the self type (with the same number of type parameters as the iface has) in the method signatures of the iface. For example: iface F: functor<A> { fn fmap<B>(f: fn(A) -> B) -> F<B>; } Issue #1718
2012-02-03Beginnings of front-end support for classesTim Chevalier-0/+3
Added class support to the parser, prettyprinter, fold, and visit. (See Issue 1726.) This is WIP -- the test case is xfailed, and attempting to compile it will error out in resolve.
2012-02-03Store item paths in ast_map, get rid of trans::local_ctxtMarijn Haverbeke-1/+2
The direct motivation for this was that the monomorphizer needs to be able to generate sane symbols for random items. The typechecker can probably also use this in the future to provide more useful error messages.
2012-02-01Remove support for native typesMarijn Haverbeke-6/+0
Issue #1673
2012-01-31Change option::t to optionTim Chevalier-39/+39
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-52/+76
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-3/+6
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-30Revert self typesMarijn Haverbeke-1/+1
2012-01-29Fix mistake in previous commitMarijn Haverbeke-1/+2
2012-01-29Fix bug where resolve didn't descend method ty paramsMarijn Haverbeke-1/+1
Closes #1700
2012-01-26Make re-exporting of impls workMarijn Haverbeke-80/+101
Closes #1438
2012-01-26Allow operator overloading of the indexing operatorMarijn Haverbeke-1/+4
The method `op_index` (which takes a single argument) is used for this. Issue #1520
2012-01-26First stab at operator overloadingMarijn Haverbeke-3/+3
When no built-in interpretation is found for one of the operators mentioned below, the typechecker will try to turn it into a method call with the name written next to it. For binary operators, the method will be called on the LHS with the RHS as only parameter. Binary: + op_add - op_sub * op_mul / op_div % op_rem & op_and | op_or ^ op_xor << op_shift_left >> op_shift_right >>> op_ashift_right Unary: - op_neg ! op_not Overloading of the indexing ([]) operator isn't finished yet. Issue #1520
2012-01-26Remove ty_native_fnMarijn Haverbeke-5/+3
It was being used as a clumsy synonym of ty_fn.
2012-01-25Implement implicit self type parameters for ifacesMarijn Haverbeke-1/+1
Closes #1661
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-30/+31
This should reduce confusion of people trying to read the code.
2012-01-23s/block()/fn()/gNiko Matsakis-2/+2
2012-01-23Check that the names mentioned in tag exports are actually types (or variants)Tim Chevalier-2/+58
Check that in export foo{}, foo is an enum type, and that in export foo{bar, quux}, foo is an enum type and bar and quux are variants belonging to foo.
2012-01-23Export all enum variants by default; new syntax for selectively exporting ↵Tim Chevalier-0/+2
variants See issue 1426 for details. Now, the semantics of "export t;" where t is a tag are to export all of t's variants as well. "export t{};" exports t but not its variants, while "export t{a, b, c};" exports only variants a, b, c of t. To do: - documentation - there's currently no checking that a, b, c are actually variants of t in the above example - there's also no checking that t is an enum type, in the second two examples above - change the modules listed in issue 1426 that should have the old export semantics to use the t{} syntax I deleted the test export-no-tag-variants since we're doing the opposite now, and other tests cover the same behavior.
2012-01-21rustc: Always resolve reexported names from original defHaitao Li-22/+2
Issue #1501
2012-01-19rustc: ";" to "," in enumsPatrick Walton-24/+24
2012-01-19rustc: "tag" -> "enum"Patrick Walton-23/+23
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-43/+43
Does what it says on the tin. The next commit will remove support for this syntax.