Graydon Hoare
7a3b290245
Add vstore/evec/estr to compiler.
2012-04-11 11:08:40 -07:00
Graydon Hoare
0c94cd5d43
Add some xfailed estr tests.
2012-04-11 11:08:40 -07:00
Tim Chevalier
fd26743bed
Generic classes and generic class methods work cross-crate
...
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-10 11:01:36 -07:00
Haitao Li
1dac883282
test: Remove duplicated auxliary tests
2012-04-10 16:59:35 +08:00
Niko Matsakis
24e921f7d4
make anything used in a resource body always reachable
...
(they appear to be uncond. inlined)
Fixes #2170 .
2012-04-09 16:36:59 -07:00
Haitao Li
2ce28899e4
test: Don't share auxiliary modules
2012-04-09 00:18:18 +08:00
Haitao Li
cc66599c1f
Xfail-fast a case on window
2012-04-08 23:14:57 +08:00
Haitao Li
101f83ecef
Fix a missing un-xfailed case
...
Issue #1230
2012-04-08 22:09:15 +08:00
Haitao Li
7d227f21f7
Check metadata hash when loading transitive dependent crates
...
Fix issue #2138
2012-04-08 21:19:15 +08:00
Brian Anderson
a6e748a1d9
rustc: Hash the CMH into symbol names
2012-04-07 17:50:49 -07:00
Brian Anderson
e0f2341da1
test: Add another test using multiple versions of the same crate
2012-04-07 17:40:25 -07:00
Brian Anderson
320e6cebf4
test: Un-xfail run-pass/crateresolve2
2012-04-07 17:39:59 -07:00
Brian Anderson
19b7a7d803
Revert "Mangle exported names using node IDs rather than types"
...
This reverts commit c83d61de93
.
2012-04-07 17:29:06 -07:00
Niko Matsakis
1e42c9a367
Do not consider ty_bot to be a "resolved type".
...
Fixes #2149 . Fixes #2150 . Fixes #2151 .
2012-04-07 17:12:48 -07:00
Haitao Li
7aaa120bcc
Check version when resolving transitive dependent crates
...
Issue #2138
2012-04-08 02:05:09 +08:00
Haitao Li
2f42b14b4f
Use version and hash in crate_map name
...
Related issue #2137
2012-04-07 22:11:23 +08:00
Haitao Li
13686b6778
Use real crate name in crate_map name
...
`use` statement may introduce an crate name alias. This patch always
uses the link attrbute "name" as the crate's name when building the
crate map.
Closes #1706
2012-04-07 22:08:54 +08: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
Brian Anderson
9c88e5ef5a
test: Refactor the crateresolve tests
...
Keep their aux builds from stomping on each other
2012-04-06 10:58:03 -07:00
Niko Matsakis
051f24da25
add static region and also fix regions to be contravariant
2012-04-05 21:16:28 -07:00
Brian Anderson
2577bd9df3
rustc: Don't assume that all crates with the same name are the same
2012-04-05 20:53:16 -07:00
Tim Chevalier
c83d61de93
Mangle exported names using node IDs rather than types
...
Use node IDs rather than types to ensure exported names are unique.
duplicate symbol. Closes #2074 .
2012-04-05 18:22:53 -07:00
Niko Matsakis
b91c9f803d
simplify typing rule for vector addition: use mutability of LHS
2012-04-05 15:18:26 -07:00
Niko Matsakis
79cbdba037
new tests for things we'll have to fix eventually
2012-04-05 15:18:26 -07:00
Tim Chevalier
98b07ddc82
Rename task::task_builder to task::builder
...
Closes #2120 .
2012-04-05 14:09:32 -07:00
Niko Matsakis
c0d61795de
wip: refactor repr of regions
...
- we now distinguish bound/free parameters (see region-param
test case for why this is necessary)
- we also track bounds on region variables
- also, restructure fold_ty() to have multiple variants without
duplication instead of one overloaded folder. This also allows
for using block functions.
2012-04-04 19:41:23 -07:00
Graydon Hoare
2577e3eafc
Tidy up predicate names in libcore. Should close #1431 .
2012-04-04 18:08:55 -07:00
Brian Anderson
38ed2ea096
rustc: Allow consts to refer to other consts
2012-04-04 15:03:39 -07:00
Brian Anderson
e325146eb4
Merge remote-tracking branch 'brson/mainthread'
...
Conflicts:
src/rt/rust_kernel.cpp
src/rt/rust_scheduler.cpp
src/rt/rust_scheduler.h
2012-04-03 20:30:01 -07:00
Brian Anderson
c0e12854ed
rt: Fix bugs in the osmain scheduler
2012-04-03 18:01:13 -07:00
Tim Chevalier
5571a9a193
also xfail class-typarams (doesn't work on Windows)
2012-04-03 17:47:07 -07:00
Tim Chevalier
bc5e10dd1b
xfail - metadata encoding doesn't work, which breaks Windows
2012-04-03 17:16:14 -07:00
Tim Chevalier
1f892dcb01
Monomorphize class constructors, support generic classes and class methods
...
Allow class methods to have type parameters (this is a change from the
original classes proposal).
Add test cases for classes with type parameters, and classes with methods
that have their own type parameters.
2012-04-03 16:23:50 -07:00
Brian Anderson
bef72447e7
core: Add a scheduler mode, osmain, to spawn onto the main scheduler
2012-04-03 14:28:30 -07:00
Brian Anderson
5d54defce4
core: Add extension methods for vec
2012-03-29 20:56:50 -07:00
Niko Matsakis
76d0a13ae5
resolve type variables with no constraints to bot
2012-03-29 19:41:09 -07:00
Tim Chevalier
c7082ce8e8
Require "self" as base expression for intra-class method or field references
...
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-29 12:22:01 -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
Niko Matsakis
23f92ea370
Detect and report types which could never be instantiated.
...
Fixes #2063 .
2012-03-28 17:02:54 -07:00
Patrick Walton
18a97d71f9
test: Un-XFAIL regions-mock-trans.rs and regions-mock-trans-impls.rs
2012-03-28 14:31:23 -07:00
Patrick Walton
3c398d28a4
rustc: Universally quantify regions when calling functions. Un-XFAIL regions-addr-of-ret.rs.
2012-03-28 14:24:18 -07:00
Tim Chevalier
ca6636d6b6
Allow references to "self" within classes
...
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-28 14:19:00 -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
Marijn Haverbeke
064f82d68d
Support returning from loop blocks
...
The code is somewhat invasive, but it seems hard to do this in a
clean way, since the design itself involves a bunch of 'action
at a distance'.
Issue #1819
2012-03-27 12:33:13 +02:00
Graydon Hoare
6e6798c4e1
Bulk-edit mutable -> mut.
2012-03-26 18:35:18 -07:00
Brian Anderson
45a709766c
rustc: Begin eliminating ext's dependency on the session
2012-03-26 17:16:26 -07:00
Tim Chevalier
c282810ab0
Enforce privacy declarations for class fields and methods
2012-03-26 10:00:33 -07:00
Marijn Haverbeke
87e097a853
Disallow ret inside of block functions
...
Also adds proper checking for cont/break being inside a loop.
Closes #1854
Issue #1619
2012-03-26 12:45:47 +02:00
Niko Matsakis
ac4294a176
add test that was failing from tedh
2012-03-24 21:59:16 -07:00
Niko Matsakis
bf9d714d46
Avoid unifying vars when possible; handle bot (more) correctly
2012-03-24 21:38:43 -07:00
Patrick Walton
f507b54f19
test: Rename run-pass/simple-regions.rs to run-pass/regions-simple.rs
...
This groups all the region tests under regions-*.
2012-03-24 19:21:51 -07:00
Tim Chevalier
aae14e352a
Allow methods to call other methods in the same class
2012-03-23 23:10:45 -07:00
Tim Chevalier
bebdfe8ce8
Add another test for cross-crate method calls
2012-03-23 23:10:45 -07:00
Niko Matsakis
f5edb5ee18
xfail-test regions tests
2012-03-23 22:06:39 -07:00
Tim Chevalier
8bbd78075f
Handle self correctly when translating classes
...
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-23 20:37:50 -07:00
Patrick Walton
cab4f1685b
test: Add a test case that ensures ret &EXPR
works.
2012-03-23 16:18:28 -07:00
Patrick Walton
7592dae949
test: Fix unresolved name in regions-mock-trans-impls.rs
2012-03-23 15:44:37 -07:00
Patrick Walton
c56ec7b02a
test: Add a version of the "mock-trans" regions test case that uses impls
2012-03-23 15:28:47 -07:00
Patrick Walton
b9c4dbeb33
test: Fix leak in regions-mock-trans
2012-03-23 15:17:34 -07:00
Patrick Walton
df77eb433b
test: Fix whitespace at EOL
2012-03-23 15:05:39 -07:00
Patrick Walton
aa0f25ae31
test: Add a trans.rs-workalike test case for regions
2012-03-23 14:42:39 -07:00
Patrick Walton
7931a61ebb
rustc: Redo region inference to be a bit less broken
2012-03-23 12:22:58 -07:00
Marijn Haverbeke
84019aa0dc
Keep an explicit map of things that have to be spilled
...
This prevents us from spilling locals more than once.
Closes #2040
2012-03-23 16:08:01 +01:00
Marijn Haverbeke
894b7469d6
Replace most uses of intrinsics in core with builtins
...
Issue #1981
2012-03-23 10:49:47 +01:00
Tim Chevalier
73a0c17d77
Make cross-crate calls to class methods work
2012-03-22 20:32:47 -07:00
Brian Anderson
f7f1490d6e
rt: Run resource destructors during cycle collection
2012-03-22 19:07:31 -07:00
Niko Matsakis
dc07280b08
make --enforce-mut-vars always on, add mut annotations to remaining files
2012-03-22 09:58:19 -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
Niko Matsakis
7cc0f554ae
add test for commit 9502fb99e0
2012-03-21 08:23:31 -07:00
Niko Matsakis
cce2751461
Adjust arena definition to be compatible with placement new
2012-03-21 05:46:31 -07:00
Niko Matsakis
cfcbec3cc3
Implement an initial version of placement new.
2012-03-20 20:39:40 -07:00
Graydon Hoare
084fe56ad5
Conditionalize test to only run double/byte/double test on x64 for now.
2012-03-20 17:34:21 -07:00
Graydon Hoare
faacbb38f0
Xfail struct-return test. x64 ABI is not quite right yet.
2012-03-20 17:13:48 -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
Graydon Hoare
855c99ea75
Some tests for passing and returning structures by value on x64. Close #1402 . Close #1970 .
2012-03-20 16:44:56 -07:00
Brian Anderson
b181ea415e
core: Rename unsafe::leak to unsafe::forget. Closes #2031
2012-03-20 15:20:37 -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
Brian Anderson
154a3fdf44
rustc: Unify impl self types in the opposite order so variance is correct
2012-03-16 17:06:15 -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
Niko Matsakis
e399ddbf17
allow binding of fn~, make result fn@. fixes 1899.
2012-03-16 17:48:53 -04:00
Patrick Walton
0972571cdd
test: Add a test case for self regions and typeclass implementations
2012-03-15 18:13:57 -07:00
Brian Anderson
9e480708a2
core:: Eliminate str::sbuf. Replace with *u8
2012-03-14 18:19:08 -07: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
Niko Matsakis
a3d2882ffd
fixup auto_serialize's treatment of nullary variants
2012-03-14 21:05:06 -04:00
Patrick Walton
b516913a5d
test: Remove unsafe from the region tests
2012-03-14 16:18:33 -07:00
Patrick Walton
83ed4f4bc4
test: Add a test case for the "self" region in enums
2012-03-14 15:41:54 -07:00
Niko Matsakis
1600be2c3b
fix auto_serialize for enums with type parameters
2012-03-14 17:19:33 -04:00
Niko Matsakis
ffa187db25
adjust auto_serialize to generate fns named serialize_T()
...
We used to generate a module T with a serialize() and deserialize() fn,
but this was suboptimal for a number of reasons:
- it required moving serialization into core so that uint etc worked
- it was harder to override the serialization behavior locally
(this is now trivial)
2012-03-14 11:49:28 -04:00
Niko Matsakis
9086c6f5a2
merge all auto_serialize tests into one
2012-03-13 21:30:07 -04:00
Niko Matsakis
b30cb8e43a
implement deserialization, rename mk_mem_buffer() to mem_buffer()
2012-03-13 21:30:07 -04:00
Niko Matsakis
d91742294f
first (functional) version of the auto_serialize syntax ext
2012-03-13 21:30:07 -04:00
Brian Anderson
aeb445b2ea
rustc: Don't make the while loop body's basic block a child of the condition
...
As a child of the condition, when the body encounters a ret or break it
incorrectly re-runs the cleanups of the condition.
2012-03-13 17:27:17 -07:00
Brian Anderson
cd72b1f848
Overhaul constructor naming in libs
2012-03-13 11:07:22 -07:00
Kevin Atkinson
15985277b9
Fix Issue #1926 by sorting the gather list.
2012-03-13 07:40:41 -04: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
Tim Chevalier
813c41362b
A few tests for infinite loops
2012-03-11 20:17:27 -07:00
Tim Chevalier
d3035a1b20
Fix test so it terminates, and un-xfail it
...
Still need more tests for loop{}
2012-03-10 21:19:02 -08:00
Tim Chevalier
9838a7ec54
Tweak some test cases and add a few new ones
2012-03-10 20:38:03 -08:00
Brian Anderson
6d4fb35912
core Remove vec::enum_chars/uint. Closes #1955
2012-03-10 17:07:23 -08:00
Brian Anderson
a0f0a704b0
core: Clean up comments and exports
2012-03-10 00:35:02 -08:00
Tim Chevalier
321fd80219
Add an infinite loop construct
...
Add a loop {} construct for infinite loops, and use it in test
cases. See #1906 for details.
2012-03-09 16:40:58 -08:00
Patrick Walton
92ed73d0bd
rustc: Add pretty printing support for the address-of operator. Un-XFAIL-pretty simple-regions.rs.
2012-03-08 18:10:07 -08:00
Patrick Walton
c40bfec45d
test: Add a simple region test, xfail'd in the pretty printer
2012-03-08 17:45:36 -08:00
Tim Chevalier
0c5fdc8745
Rename last to last_opt, last_unsafe to last
...
As per discussion on IRC. I am about to file an RFC for further
discussion about the more general issue of whether to enforce
invariants through types, typestate, or dynamic checks, but for now,
removing the misleading name "last_unsafe".
2012-03-08 15:25:56 -08:00
Tim Chevalier
ebc1d3e704
Rename last_total to last_unsafe
...
See Issue 1943 for any discussion (reopen it if necessary).
Closes #1943
2012-03-08 13:07:31 -08:00
Niko Matsakis
2bfed908e3
Fix #1941 : inlining of items that themselves contain nested items
...
The fix is to drop nested items from the encoded AST. Nested items may
themselves be inlined, but that is an independent question.
2012-03-07 18:06:29 -08: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
Brian Anderson
8a4c8bab84
test: Add test for #979
2012-03-05 18:41:55 -08:00
Brian Anderson
633881a562
test: xfail-fast run-pass/classes-simple.rs
2012-03-04 14:13:18 -08:00
Tim Chevalier
e2fa6f03f5
Translate simple classes
...
Programs using classes with fields only (no methods) compile and run,
as long as nothing refers to a class in a different crate (todo).
Also changed the AST representation of classes to have a separate
record for constructor info (instead of inlining the fields in the
item_class node), and fixed up spans and pretty-printing for
classes.
2012-03-04 12:43:17 -08:00
Brian Anderson
a04127d291
test: xfail-fast the cci tests
2012-03-02 13:46:42 -08:00
Brian Anderson
78bfdb11c8
Revert "rust: xfail-fast run-pass/cci_no_inline_exe"
...
This reverts commit 95099cddcf
.
2012-03-02 13:46:02 -08:00
Brian Anderson
09f191f3a7
Revert "test: xfail-fast run-pass/cci_iter.exe"
...
This reverts commit c0a5e21b29
.
2012-03-02 13:45:18 -08:00
Brian Anderson
95099cddcf
rust: xfail-fast run-pass/cci_no_inline_exe
2012-03-02 13:44:40 -08:00
Brian Anderson
c0a5e21b29
test: xfail-fast run-pass/cci_iter.exe
2012-03-02 13:36:11 -08:00
Brian Anderson
fd12459d94
test: xfail-fast run-pass/cci_impl_exe
2012-03-02 13:23:55 -08:00
Niko Matsakis
def72bda47
retool inline encoding to handle methods, fix tests
2012-03-02 06:47:25 -08:00
Tim Chevalier
48c763c098
Use the correct prestate for calls
...
The prestate for calls was getting set incorrectly to the poststate for the operator
in the call. This worked before since most of the time, operator expressions are
pure. Issue 1895 shows how this breaks when the operator is a closure that has a
move-in capture clause.
(I had a several-day, multi-file patch for this that didn't work... and then it
turned out to be a one-line fix. The joys of programming.)
Closes #1895
2012-03-01 09:16:26 -08:00
Marijn Haverbeke
072b015515
Add test case for #1894
2012-03-01 10:11:28 +01:00
Niko Matsakis
4132cbd22a
un-xfail test, remove old comment
2012-02-29 12:49:15 -08:00
Marijn Haverbeke
0da1aca498
Recognize last uses for copied closed-over variables
...
And clean up and fix some bad things in last_use.rs.
Closes #1894
2012-02-29 18:06:26 +01:00
Niko Matsakis
274c9708f0
Test for #1374
2012-02-24 21:14:31 -08:00
Graydon Hoare
b44be95e45
Support basic, unsophisticated, somewhat wrong export-globs.
2012-02-23 18:39:14 -08:00
Graydon Hoare
5f4dcb0fa4
Fix comment, add test that export glob works as import glob in scope.
2012-02-23 18:39:13 -08:00
Marijn Haverbeke
780f8277f4
Finish cleanup of core::str
...
Closes #1849
2012-02-23 17:00:19 +01:00
Kevin Cantu
7782f5d692
(core::str) remove len_bytes alias
2012-02-23 17:00:19 +01:00
Kevin Cantu
98447f5236
(core::str) mostly rename len -> len_chars
2012-02-23 17:00:19 +01:00
Brian Anderson
ffa77dd610
test: Add a test for #1696
2012-02-22 21:17:19 -08:00
Brian Anderson
99a48660d1
rustc: Allow any integral types on rhs of shift ops
2012-02-22 17:26:08 -08:00
Marijn Haverbeke
1e5266260a
Take move captures in account in mutability checker
...
Closes #1461
2012-02-22 13:35:17 +01:00
Brian Anderson
77a01054fa
rustc: Generate crates with #ast
2012-02-21 15:34:26 -08:00
Brian Anderson
6527fc3925
core: Fix to_str_exact for floats with no decimal component
2012-02-21 14:25:31 -08:00
Brian Anderson
4220dcf1e9
core: New task API
2012-02-20 18:58:04 -08:00
Tim Chevalier
fbc95ba018
Re-XFAIL test that I accidentally
2012-02-20 17:33:35 -08:00
Tim Chevalier
cd9579e079
fix whitespace again
2012-02-20 17:21:33 -08:00
Tim Chevalier
2299d204e4
Further work on resolving and typechecking classes
...
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-20 17:16:52 -08:00
Graydon Hoare
6f70896854
Add new test for export globs, xfailed.
2012-02-17 23:02:27 -08:00
Brian Anderson
93b66ee587
test: Assert that the result is correct in run-pass/crust-stress
2012-02-15 12:45:04 -08:00
Marijn Haverbeke
1248c250d8
A test that I forgot to git-add
2012-02-15 17:21:03 +01:00
Marijn Haverbeke
67cc89f38d
Rewrite exhaustiveness checker
...
Issue #352
Closes #1720
The old checker would happily accept things like 'alt x { @some(a) { a } }'.
It now properly descends into patterns, checks exhaustiveness of booleans,
and complains when number/string patterns aren't exhaustive.
2012-02-15 15:47:42 +01:00
Marijn Haverbeke
6627890f6b
Support 'alt check' syntax
...
It is only a way to flag an alt as intentionally non-exhaustive right now.
Issue #1679
2012-02-15 11:53:32 +01:00
Brian Anderson
9f95ccb426
test: Add a crust function stress test
2012-02-15 01:16:53 -08:00
Kevin Atkinson
a803a14b56
Bug fix to accept $ in 0th pos, (ie #ast{$(x) + ...}).
...
Note: part from Niko Matsakis commit: rewrite assert to accept a $ in
0th pos.
2012-02-14 19:37:33 -08:00
Kevin Atkinson
3eef8d1419
Correctly handle the character position at the EOF.
...
Fixes issue #1785 .
2012-02-14 19:37:33 -08:00
Brian Anderson
3f4872f032
test: Test yielding in crust functions
2012-02-14 11:24:09 -08:00
Brian Anderson
a393fb3221
rt: Maintain stack ptrs correctly when returning from stack switches
2012-02-14 11:24:09 -08:00
Brian Anderson
214cdd0dee
rustc: Translate crust functions
2012-02-14 11:24:09 -08:00
Brian Anderson
c4c89dd684
rustc: Translate the value of crust functions
2012-02-14 11:24:09 -08:00
Brian Anderson
0a503228f6
rustc: Typecheck crust functions as *u8
2012-02-14 11:24:09 -08:00
Brian Anderson
305cbf9b8e
rustc: Parse crust functions
2012-02-14 11:24:09 -08:00
Marijn Haverbeke
90324a1978
XFAIL bind-methods test until I figure out what is going wrong
...
It is not Valgrind-clean.
2012-02-14 13:54:41 +01:00
Marijn Haverbeke
57c7645cb8
Allow static method calls to be bound
...
This allows you to take the value of, for example, `[1].len`, or bind
it with `bind x.map(_)` syntax.
I'm holding off on implementing this for dynamic methods (those on
bounded type parameters or iface types) until it's clearer what we
will do with monomorphization.
Issue #435
2012-02-14 13:43:36 +01:00
Marijn Haverbeke
f2e880b750
Add [X].len() to core, use it in trans modules
2012-02-14 13:43:36 +01:00
Brian Anderson
f3dba33043
test: Add test for #1821
2012-02-13 15:58:14 -08:00
Marijn Haverbeke
94d4dcdbf0
Fix bug in handling of block functions in last-use analysis
...
It would fail to start out with a fresh scope when going over
a loop or block function for the second time, and thus not
recognize last uses of locals defined inside the block.
Closes #1818
2012-02-13 17:55:40 +01:00
Kevin Cantu
2b4f5136a5
(core::str) rename byte_len -> len_bytes and rename char_len -> len
2012-02-12 15:30:20 -08:00
Niko Matsakis
13d743093b
rewrite to use ctypes types
2012-02-11 10:14:41 -08:00
Niko Matsakis
b106ef8116
make bind syntax unnecessary: just use _ for one of the arguments
2012-02-11 10:14:41 -08:00
Niko Matsakis
d972226567
remove executable that was accidentally included
2012-02-10 20:48:29 -08:00
Niko Matsakis
fdddf8f9e1
put serializer into the build and encode full item paths
2012-02-10 20:48:28 -08:00
Marijn Haverbeke
7f1ea3ef6a
Don't allow binding patterns to bind keywords
...
Closes #1586
2012-02-10 15:54:47 +01:00
Tim Chevalier
503dec1d62
Further WIP on classes
...
Changes to resolve and typeck. Still nothning working yet.
2012-02-09 14:36:43 -08:00
Marijn Haverbeke
50fb4c30ed
Increase precedence of as operator
...
Closes #1717
2012-02-09 11:58:08 +01:00
Brian Anderson
35ba9715fa
core: Add task::spawn_sched
...
This function creates a new scheduler with a specified number of threads and
immediately executes a task on it. The scheduler is configured to terminate
when the task dies. This is the minimum API necessary to enable blocking C
calls.
2012-02-08 15:42:51 -08:00
Brian Anderson
2f4e7c157e
rt: Export a scheduler API
2012-02-08 15:42:51 -08:00
Marijn Haverbeke
6ed8d03784
Make sure iface_methods are set before they are accessed
...
Closes #1761
2012-02-06 09:56:42 +01:00
Marijn Haverbeke
91da710d86
Add monad iface test
2012-02-06 09:56:41 +01:00
Brian Anderson
da61e1ff15
test: Add test for issue #1460
2012-02-05 20:42:05 -08:00
Brian Anderson
0b43bf9782
test: Add test for #901 . Closes #901
2012-02-05 17:54:52 -08:00
Brian Anderson
34aa956e68
test: Resolve some FIXMEs
2012-02-05 17:05:24 -08:00
Kevin Atkinson
1d855ebc51
Remove support for $(...) form of quasi-quotes, use #ast{...} instead.
2012-02-05 15:38:27 -08:00
Niko Matsakis
dd51031390
new test case
2012-02-05 10:37:07 -08:00
Niko Matsakis
daf0d63a59
new test showing off the improved inference
2012-02-05 09:56:18 -08:00
Tim Chevalier
f3343b3571
Beginnings of front-end support for classes
...
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-03 22:47:35 -08:00
Graydon Hoare
8fc624bc08
Fix various drift issues in the qq branch.
2012-02-03 20:54:18 -07:00
Kevin Atkinson
dbb13883f7
Additional testcase.
2012-02-03 20:54:18 -07:00
Kevin Atkinson
42e25b2bb9
Type anti-quotes now work, add test case.
2012-02-03 20:54:17 -07:00
Kevin Atkinson
5f6a1159bb
Fix q-q so that non-expression q-q actually work when there is embed anti-q.
2012-02-03 20:54:00 -07:00
Kevin Atkinson
a2dde9a692
Allow anti-quotes to also be ast::ty rather than just ast::expr.
2012-02-03 20:41:49 -07:00
Kevin Atkinson
f7fab77102
Add testcase.
2012-02-03 20:41:49 -07:00
Marijn Haverbeke
c976b7c623
Fix tests for str::le patch
2012-02-03 14:32:23 +01:00
Marijn Haverbeke
c1b075d042
Remove experimental GC code
...
It's been sitting unused long enough to have bitrotted completely.
2012-02-03 11:34:12 +01:00
Brian Anderson
57cad61353
rt: Remove task pinning. Does nothing
2012-02-02 18:10:24 -08:00
Brian Anderson
18de0f2aeb
rt: Rename task_sleep intrinsic to task_yield. Remove usec param
2012-02-02 18:10:24 -08:00
Marijn Haverbeke
6a7de641da
Add test case for issue #1733
2012-02-02 10:30:07 +01:00
Kevin Cantu
8f367ebfeb
Rename (again) str::unsafe::slice -> str::unsafe::slice_bytes and
...
str::unsafe::safe_slice -> str::unsafe::slice_bytes_safe_range
2012-02-01 21:56:53 -08:00
Kevin Cantu
c71667d9d2
Propagating unsafe::slice 4
2012-02-01 21:56:53 -08:00
Marijn Haverbeke
856a544d0c
Remove native types from stdlib
2012-02-01 12:23:13 +01:00
Tim Chevalier
e5d095d67e
Change option::t to option
...
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-31 17:05:20 -08:00
Kevin Cantu
c7454f5595
Rename str::to_chars -> str::chars
2012-01-31 14:29:11 -08:00
Tim Chevalier
45c1dfe5b3
Don't compute pre- and postconditions for item_consts
...
Since item_consts can't refer to or modify local variables, they
don't participate in typestate and thus get empty pre and
postconditions by default.
Closes #1660
2012-01-31 11:52:46 -08:00
Tim Chevalier
fba35e1a3c
Require alts to be exhaustive
...
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
2012-01-31 10:08:24 -08:00
Brian Anderson
0e498da47e
rustc: Allow attributes on methods. Closes #1709
2012-01-30 11:43:45 -08:00
Paul Woolcock
a02493b969
Fix last failing test
...
All tests now pass, without the ternary operator.
2012-01-30 18:21:12 +01:00
Paul Woolcock
e1f15a71e3
Alter/remove tests that include/concern ternary
...
3 tests, pretty/block-disambig.rs, run-pass/operator-overloading.rs,
and run-pass/weird-exprs.rs, all included the ternary operator. These
were changed to use the if-then-else construct instead.
2 tests, run-pass/block-arg-in-ternary.rs and run-pass/ternary.rs, were
only there because of the ternary operator, and were removed.
2012-01-30 18:20:05 +01:00
Marijn Haverbeke
964bd485c6
Revert self types
2012-01-30 11:37:52 +01:00
Brian Anderson
fa13fd9d64
rt: Remove set_min_stack
2012-01-29 21:27:37 -08:00
Brian Anderson
3321880f13
Merge remote-tracking branch 'killerswan/fixing_strings_2'
...
Conflicts:
src/comp/driver/driver.rs
src/comp/middle/trans/base.rs
src/comp/syntax/parse/lexer.rs
2012-01-27 16:44:40 -08:00