Commit graph

47 commits

Author SHA1 Message Date
Brian Anderson
4dcf84e4f4 Remove bind. Issue #2189 2012-06-20 17:27:28 -07:00
Brian Anderson
ce750a7dbc Box AST idents 2012-06-13 11:30:45 -07:00
Tim Chevalier
aa9d2d88d3 Handle class destructors correctly in metadata
This allows destructors to be inlined, which is necessary since
classes can have both ty params and destructors.
2012-06-12 17:37:04 -07:00
Tim Chevalier
a6c92f0a17 Revert "Revert "Merge pull request #2516 from mozilla/incoming" due to failures"
This reverts commit 9fae95860de510f6874810cf43efb83f101246ef.
2012-06-06 15:08:24 -07:00
Brian Anderson
9aa18c2852 rustc: Move ast_map to the syntax crate 2012-05-21 23:39:27 -07:00
Tim Chevalier
cf2fc2c34e Annotate or fix FIXMEs in LLVM bindings and metadata code
Fixed up a few FIXMEs in lib/llvm to use more descriptive data
types. Covered FIXMEs in metadata::{creader, csearch, decoder} and
one in encoder.
2012-05-17 20:39:17 -07:00
Brian Anderson
288799786b rustc: Sever the link between metadata and resolve 2012-05-16 22:46:57 -07:00
Tim Chevalier
fa5cc5bcd0 Generate drop glue correctly for classes with destructors 2012-05-15 18:00:41 -07:00
Brian Anderson
452fc46ffc rustc: Break some of metadata's dependencies on session 2012-05-14 20:41:33 -07:00
Brian Anderson
fce6a474b1 rustc: Eliminate metadata's dependency on astencode 2012-05-14 19:04:32 -07:00
Brian Anderson
32c4b6da5b rustc: Move astencode from metadata to middle 2012-05-14 19:04:31 -07:00
Brian Anderson
a2572fe77e rustc: Eliminate metadata's dependency on trans 2012-05-13 17:08:35 -07:00
Marijn Haverbeke
b619954457 Start parsing pub/priv on regular items
Issue #1893
2012-05-08 16:09:40 +02:00
Tim Chevalier
931514cfb6 Remove commented-out code and old comments that accidentally snuck in 2012-05-02 14:02:22 -07:00
Tim Chevalier
3d4ef74c9b Encode the ifaces a class implements in metadata
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-02 13:38:56 -07:00
Tim Chevalier
f7641286b2 Allow classes to be cast to ifaces that are in the same crate
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272.
2012-04-23 21:15:03 -07:00
Niko Matsakis
3c995fb8f3 make nominal types optionally parameterized by a self region.
Issue #2201.
2012-04-19 21:01:11 -07:00
Brian Anderson
dea8ae4e6f rustc: Resolve external impls defined in yet other crates. Issue #2196 2012-04-16 14:58:58 -07:00
Brian Anderson
4f576275be syntax: Cleanup attr module. Closes #1545 2012-04-15 01:43:38 -07:00
Haitao Li
5aa5220f8a Encode crate dependencies' hash and version data 2012-04-08 02:00:58 +08:00
Tim Chevalier
9d274ec5f2 Re-rename option functions
get_with_default (nee from_maybe) => get_default
with_option (nee maybe) => map_default
with_option_do (nee may) => iter

As per discussion of 21be1379d5
2012-04-06 12:20:13 -07:00
Marijn Haverbeke
c902eafa14 Convert old-style for loops to new-style
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-06 20:38:23 +02:00
Tim Chevalier
21be1379d5 Rename some core::option functions
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-04-02 16:12:49 -07:00
Brian Anderson
0e87039348 rustc: Remove the rustsyntax::attr wrapper in front 2012-03-29 14:42:31 -07:00
Tim Chevalier
f7bbe537c1 Allow explicit self-calls within classes
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-28 20:30:07 -07:00
Tim Chevalier
edb747ceed Enforce mutability declarations in classes; correct shapes for classes
1. Enforce mutability declarations on class fields. Don't allow any
mutation of class fields not declared as mutable (except inside the
constructor).

2. Handle classes correctly in shape (treat classes like records).
2012-03-27 22:11:58 -07:00
Tim Chevalier
c282810ab0 Enforce privacy declarations for class fields and methods 2012-03-26 10:00:33 -07:00
Marijn Haverbeke
1b81c5112a Remove last vestiges of old-style intrinsics
Closes #2048
2012-03-23 16:08:01 +01:00
Marijn Haverbeke
52d618a99a Revert removal of intrinsics
Oops. We can't do this yet until the next snapshot.
2012-03-23 12:51:20 +01:00
Marijn Haverbeke
f5024692d4 Remove support for the old-style intrinsics
Closes #2042
Closes #1981
2012-03-23 12:21:55 +01:00
Tim Chevalier
73a0c17d77 Make cross-crate calls to class methods work 2012-03-22 20:32:47 -07:00
Niko Matsakis
b653a18416 add mut decls to rustc and make them mandatory 2012-03-21 21:04:14 -07:00
Tim Chevalier
30c272cb3a methods work
Cross-crate method calls don't work yet. Added
run-pass/class-method-cross-crate to test that, but it's xfailed

References to fields within methods don't work yet. Added
run-pass/class-methods to test that, but it's also xfailed
2012-03-21 13:53:21 -07:00
Tim Chevalier
b06dc884e5 Class methods WIP
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-20 17:07:07 -07:00
Tim Chevalier
e3a1c5c96a Encode both private and public class fields in metadata
This is necessary to calculate the correct offsets for field references.

Simple cross-crate class tests (still with fields only) now pass.
2012-03-16 20:36:07 -07:00
Tim Chevalier
16dd6c4756 Fix encoding of class ctors
Class tests still fail at runtime
2012-03-16 19:20:36 -07:00
Tim Chevalier
1680ccce1e Classes WIP
Cross-crate metadata for classes works well enough that programs with
classes in other crates compile successfully, but output wrong results.
Checking in work so far to avoid merge hassles. (Tests are xfailed.)
2012-03-16 15:28:05 -07:00
Marijn Haverbeke
b6ad34bef4 Properly recognize external intrinsics 2012-03-15 10:22:46 +01:00
Marijn Haverbeke
2c8c50d6cb Make sure enum and resource constructors are inlined properly 2012-03-15 09:32:53 +01:00
Marijn Haverbeke
4511f936b1 Hugely simplify iface handling
With the assumption of monomorphization
2012-03-15 09:26:54 +01:00
Marijn Haverbeke
5e647d799e Fix assumption that monomorphized method's impls are crate-local 2012-03-15 08:59:29 +01:00
Brian Anderson
3864d6d845 std: Rename the hashmap constructors to conform to new standards
Instead of using the new_ prefix just name them after their type
2012-03-14 18:19:08 -07:00
Graydon Hoare
6f5853f5a1 Libc/os/run/rand/io reorganization. Close #1373. Close #1638.
- Move io, run and rand to core.
 - Remove incorrect ctypes module (use libc).
 - Remove os-specific modules for os and fs.
 - Split fs between core::path and core::os.
2012-03-12 20:08:29 -07:00
Patrick Walton
c9375fed8d stdlib: Stop incurring vtable dispatch costs when hashmaps are used
This required changing almost all users of hashmaps to import the hashmap interface first.

The `size` member in the hashmap structure was renamed to `count` to work around a name conflict.
2012-03-07 17:35:13 -08:00
Patrick Walton
c245d9e980 Revert "stdlib: Stop incurring vtable dispatch costs when hashmaps are used"
This reverts commit f0250a23d3.
2012-03-07 16:56:45 -08:00
Patrick Walton
f0250a23d3 stdlib: Stop incurring vtable dispatch costs when hashmaps are used
This required changing almost all users of hashmaps to import the hashmap interface first.

The `size` member in the hashmap structure was renamed to `count` to work around a name conflict.
2012-03-07 16:51:31 -08:00
Graydon Hoare
87c14f1e3d Move src/comp to src/rustc 2012-03-02 18:46:13 -08:00
Renamed from src/comp/metadata/decoder.rs (Browse further)