Commit graph

26 commits

Author SHA1 Message Date
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)