about summary refs log tree commit diff
path: root/src/rustc/middle/resolve.rs
AgeCommit message (Collapse)AuthorLines
2012-05-21rustc: Move path_to_ident to ast_utilBrian Anderson-1/+2
2012-05-21change list so that it must be used in a purely boxed fashionNiko Matsakis-63/+65
The old way was inconsistent---the head was unboxed but the tail was boxed. This resulted in numerous needless copies and also made the borrow check unhappy, because the head tended to be stored in mutable memory.
2012-05-21detect and report shadows in nested bindingsNiko Matsakis-20/+21
2012-05-18make more code use dvecNiko Matsakis-6/+6
2012-05-18avoid modifying the variable we are alting overNiko Matsakis-4/+4
2012-05-14First cut at dtors for classesTim Chevalier-9/+19
Classes with dtors should compile now. Haven't yet tested whether they actually run correctly. Beginnings of support for #2295, though that won't be done until there's more test cases and resources are removed.
2012-05-08Start parsing pub/priv on regular itemsMarijn Haverbeke-0/+1
Issue #1893
2012-05-07In resolve, visit the path in an iface refTim Chevalier-9/+19
Necessary to resolve any type arguments in a ref to a parameterized iface. This meant that, for example: class A implements B<int> { ... didn't work before, because the "int" in B's argument wasn't getting visited, and thus wasn't getting resolved. Now it works. Partially addresses Issue #2288, but I also want to check that class ty params can appear as the type arguments to ifaces (for example, class A<T> implements B<T> {... should work.)
2012-05-07make it illegal to implicitly capture mutable variablesNiko Matsakis-5/+7
this is the final part of #1273
2012-05-04new cap clause syntaxNiko Matsakis-5/+6
2012-05-03Removed unused import of std::dequeTim Chevalier-1/+1
2012-05-02Error message reformatting, close #2309.Graydon Hoare-2/+2
2012-05-02Encode the ifaces a class implements in metadataTim Chevalier-2/+8
This lets you use class A as if it had type B if A implements B, and A and B are in different crates from your own. Closes #2285
2012-05-01Remove code that was accidentally committedTim Chevalier-4/+1
This was a workaround for the bug that was actually fixed in 164039e86720b5e6c06ca2320700d979f60d69d6
2012-05-01Don't re-export a glob-imported ID when the same ID is defined withinTim Chevalier-3/+12
a module See the test case I added (issue-2316-c) for a concrete example. issue-2316 also contains the originally reported test case. resolve was using bitwise or instead of logical or when checking exports, resulting in excessively eager evaluation. A one-line fix that took six hours to isolate ;-)
2012-04-25lots of work to make iface/impls parameterized by regionsNiko Matsakis-24/+23
- paths can now take region parameters, replacing the dirty hack I was doing before of abusing vstores. vstores are now a bit of a hack though. - fix various small bugs: - we never checked that iface types were compatible when casting to an iface with `as` - we allowed nonsense like int<int> - and more! (actually that may be it)
2012-04-25Rewrite exhaustiveness checkerMarijn Haverbeke-1/+1
Issue #2111
2012-04-23Allow classes to be cast to ifaces that are in the same crateTim Chevalier-10/+39
I had to xfail one existing test case (class-implements-int) because, I think, of the same bug described in #2272.
2012-04-23Move map iface over to more `for`-friendly iteration methodsMarijn Haverbeke-6/+6
2012-04-23Simplify representation of ast::pathMarijn Haverbeke-17/+15
2012-04-23Misc code cleanups using list::each for list iterationMarijn Haverbeke-32/+13
2012-04-19make nominal types optionally parameterized by a self region.Niko Matsakis-18/+18
Issue #2201.
2012-04-19Disallow rebinding / matching against consts in altsTim Chevalier-7/+11
As per Issue #1193. Closes #1193. I had to rename a few variables ("info" and "epsilon") to avoid clashing with in-scope constants, which is responsible for all the changes other than resolve and issue-1193.rs.
2012-04-13Annotate FIXMEs in syntax::ast and syntax::ast_utilTim Chevalier-8/+9
The main non-comment change was to change simple_path to path, as per a FIXME in ast.
2012-04-12Support general warnings and errors in lint pass via flags and attrs. Close ↵Graydon Hoare-4/+23
#1543.
2012-04-11rustc: Long linesBrian Anderson-1/+2
2012-04-11rustc: Fix typo in error messageBrian Anderson-2/+2
2012-04-11Allow classes to implement ifacesTim Chevalier-6/+28
Introduce syntax like: iface animal { ... } class cat implements animal { ... } to allow classes to implement ifaces. Casting classes to ifaces is *not* yet supported. ifaces that a class implements are not yet included in metadata. The syntax is subject to change, and may go away completely if we decide to use duck typing to relate classes with ifaces (see http://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/ )
2012-04-10Generic classes and generic class methods work cross-crateTim Chevalier-1/+1
Classes can have ty params now. So can methods inside classes. That was probably true before, but now it should still work if you call methods in a class that's defined in a different crate. Yay!
2012-04-06Re-rename option functionsTim Chevalier-2/+2
get_with_default (nee from_maybe) => get_default with_option (nee maybe) => map_default with_option_do (nee may) => iter As per discussion of 21be1379d561b6679a8a2ea47dce88f948c5acca
2012-04-06Remove support for old-style forMarijn Haverbeke-13/+1
Closes #1619
2012-04-06Convert old-style for loops to new-styleMarijn Haverbeke-56/+56
Most could use the each method, but because of the hack used to disambiguate old- and new-style loops, some had to use vec::each. (This hack will go away soon.) Issue #1619
2012-04-03Ensure method names in iface and impl items are uniqueMarijn Haverbeke-4/+10
Closes #2114
2012-04-02Rename some core::option functionsTim Chevalier-2/+2
from_maybe => get_with_default maybe => with_option may => with_option_do I know these names are kind of ridiculous, but it's the best I could think of. Feel free to bikeshed. Closes #2081
2012-03-29rustc: Remove the rustsyntax::attr wrapper in frontBrian Anderson-1/+1
2012-03-29Require "self" as base expression for intra-class method or field referencesTim Chevalier-49/+1
All field or method references within a class must begin with "self." now. A bare reference to a field or method in the same class will no longer typecheck.
2012-03-28Allow explicit self-calls within classesTim Chevalier-8/+8
Allow writing self.f() within a class that has a method f. In a future commit, this syntax will be required. For now, you can write either self.f() or f(). I added a "privacy" field to all methods (whether class methods or not), which allowed me to refactor the AST somewhat (getting rid of the class_item type; now there's just class_member).
2012-03-28Allow references to "self" within classesTim Chevalier-4/+10
Allow writing self.f within a class that has a field f. Currently, the compiler accepts either self.f or f. In a future commit I'll require writing self.f and not f. Not sure whether self.f() works if f is a method (making sure that works next).
2012-03-26Bulk-edit mutable -> mut.Graydon Hoare-26/+26
2012-03-26Disallow ret inside of block functionsMarijn Haverbeke-5/+6
Also adds proper checking for cont/break being inside a loop. Closes #1854 Issue #1619
2012-03-23Handle self correctly when translating classesTim Chevalier-1/+2
This change uses the same code for handling the "self" reference for classes as is already used for impls/ifaces. This allows removing the extra maybe_self_id argument (which was just for classes) to trans_closure that I added before. I also rewrote the translation for class ctors so that it doesn't generate new AST nodes (instead translating directly). Also changed visit so that it visits class ctors correctly with visit_fn, and changed typestate to not do return-checking when visiting a class ctor.
2012-03-23rustc: Redo region inference to be a bit less brokenPatrick Walton-0/+1
2012-03-23Revert resolve kludge that was working around #2049Marijn Haverbeke-12/+7
2012-03-23Clean up some confused shuffling of def_ids in resolve.rsMarijn Haverbeke-34/+31
2012-03-23Kludge in resolve to be able to land builtinsMarijn Haverbeke-7/+12
Something strange is happening to hash maps. I'm still investigating but want to get my snapshot built in the meantime. (Problem only happened on OS X.)
2012-03-21add mut decls to rustc and make them mandatoryNiko Matsakis-39/+40
2012-03-20Implement an initial version of placement new.Niko Matsakis-0/+3
2012-03-20Class methods WIPTim Chevalier-1/+3
In particular, use the ast::method type to represent a class method, and try to reuse as much iface code as possible. (This makes sense now since I'll be allowing polymorphic class methods.)
2012-03-20rustdoc: Run the entire resolve passBrian Anderson-11/+1
2012-03-20Fix caching bug in resolve, get rid of enumness kludgeMarijn Haverbeke-106/+55
Closes #1911