Commit Graph

8612 Commits

Author SHA1 Message Date
Jeff Olson
f179029296 uv_write works, buffer passing still broke, can get sockaddr_in by val
.. but passing sockaddr_in by val back to C is broken, still passing by
ptr
.. the uv_write_cb is processed, but we have a status -1.. there is
also valgrind spew.. so buf passing is broken, still.
2012-04-06 15:35:48 -07:00
Jeff Olson
da779988d5 impl of rustrt::rust_uv_write in c++ and whitespace cleanup 2012-04-06 15:35:48 -07:00
Jeff Olson
05e2c131c4 changing ctypes:: to libc:: and impl of uv::direct::write() 2012-04-06 15:35:48 -07:00
Jeff Olson
af08aba573 some more stuff for libuv dealing w/ 1402.. should go away soon 2012-04-06 15:35:48 -07:00
Jeff Olson
3817ba7578 adding uv::direct and beginning to work out tcp request case
lots of changes, here.. should've commited sooner.
- added uv::direct module that contains rust fns that map, neatly, to
the libuv c library as much as possible. they operate on ptrs to libuv
structs mapped in rust, as much as possible (there are some notable
exceptions). these uv::direct fns should only take inputs from rust and,
as neccesary, translate them into C-friendly types and then pass to the
C functions. We want to them to return ints, as the libuv functions do,
so we can start tracking status.
- the notable exceptions for structs above is due to ref gh-1402, which
prevents us from passing structs, by value, across the Rust<->C barrier
(they turn to garbage, pretty much). So in the cases where we get back
by-val structs from C (uv_buf_init(), uv_ip4_addr(), uv_err_t in callbacks)
, we're going to use *ctypes::void (or just errnum ints for uv_err_t) until
gh-1402 is resolved.
- using crust functions, in these uv::direct fns, for callbacks from libuv,
will eschew uv_err_t, if possible, in favor a struct int.. if at all
possible (probably isn't.. hm.. i know libuv wants to eventually move to
replace uv_err_t with an int, as well.. so hm).
- started flushing out a big, gnarly test case to exercise the tcp request
side of the uv::direct functions. I'm at the point where, after the
connection is established, we write to the stream... when the writing is
done, we will read from it, then tear the whole thing down.

overall, it turns out that doing "close to the metal" interaction with
c libraries is painful (and more chatty) when orchestrated from rust. My
understanding is that not much, at all, is written in this fashion in the
existant core/std codebase.. malloc'ing in C has been preferred, from what
I've gathered. So we're treading new ground, here!
2012-04-06 15:35:48 -07: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
fc202ca034 Remove support for old-style for
Closes #1619
2012-04-06 20:38:23 +02: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
Brian Anderson
5dd1677b0a rustc: Warn when linking to multiple versions of the same crate
This is not something most people want to be doing and may
be a source of error.
2012-04-06 10:58:03 -07:00
Brian Anderson
de3528846f rustc: Fail when there are multiple matches for 'use' 2012-04-06 10:58:03 -07:00
Niko Matsakis
0255bf30ea continue refactoring to remove commutativity assumption
and introduce more indirection where it may be needed
2012-04-06 10:35:44 -07:00
Niko Matsakis
586b072eef Make tps invariant for now. Fixes #1973. 2012-04-06 08:31:12 -07:00
Niko Matsakis
9de288c35f further refactoring away from commutativity 2012-04-06 08:10:07 -07:00
Niko Matsakis
4856eab844 refactor to make combine less inherently commutative 2012-04-06 08:03:59 -07:00
Niko Matsakis
2c56ba7e43 improve error messages 2012-04-06 06:59:00 -07:00
Brian Anderson
ce8023b9ac Merge pull request #2139 from Jonanin/add_str_len
Add len to str extensions
2012-04-05 23:49:55 -07:00
Jon Morton
d621ada003 Add len to str extensions 2012-04-06 01:12:49 -05:00
Niko Matsakis
051f24da25 add static region and also fix regions to be contravariant 2012-04-05 21:16:28 -07:00
Niko Matsakis
f1afb0b3e2 utilities for indented logs 2012-04-05 21:16:28 -07:00
Niko Matsakis
ef566acb8e handle the case where multiple instances of same error are expected on the same line 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
Brian Anderson
d13c0c77a2 Explicitly use version 0.2 of crates 2012-04-05 20:29:42 -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
5a3875e998 Print "expected a record with field..." fields in the right order
Because terr_record_mismatch was getting called by infer::flds,
which takes types a and b where it's trying to prove a <: b, the
expected and actual fields were switched. Fixed it. Closes #2094
2012-04-05 15:16:12 -07:00
Tim Chevalier
98b07ddc82 Rename task::task_builder to task::builder
Closes #2120.
2012-04-05 14:09:32 -07:00
Erick Tryzelaar
552677e598 std: time.rs should pass all args by "&&" to rustrt. 2012-04-05 12:23:37 -07:00
Patrick Walton
851fde879d rt: Add architecture-specific general-purpose register definitions
This will be used for stack crawling, which in turn will be used for GC and
unwinding.
2012-04-04 21:40:34 -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
Niko Matsakis
d961f054c5 new snapshot 2012-04-04 19:17:06 -07:00
Niko Matsakis
1956d11f84 refactor to condense common usage pattern 2012-04-04 19:17:06 -07:00
Graydon Hoare
ab4105d9e8 Make nonconstructable enums noncopyable, close #1907. 2012-04-04 19:07:52 -07:00
Graydon Hoare
0cf6b613d1 Mention --test in cargo usage string. Close #1452. 2012-04-04 18:40:41 -07:00
Graydon Hoare
2577e3eafc Tidy up predicate names in libcore. Should close #1431. 2012-04-04 18:08:55 -07:00
Brian Anderson
9aa7241f05 rustc: Don't allow recursive constants 2012-04-04 16:12:57 -07:00
Brian Anderson
38ed2ea096 rustc: Allow consts to refer to other consts 2012-04-04 15:03:39 -07:00
Brian Anderson
1ad62def6a build: Cleanup of test summary printing 2012-04-04 13:40:50 -07:00
Grahame Bowland
5cc050b265 Logfile output from tests; summarise in make check
Add an optional --logfile argument to std::test::test_main and to
compiletest.

Use this features and the new 'check-summary.py' script to
summarise all the tests performed by the 'check' target. This is
a short term fix for #2075.
2012-04-04 11:52:27 -07:00
Erick Tryzelaar
159d89604e std: add a pure rust strptime parser. 2012-04-03 22:43:10 -07:00
Erick Tryzelaar
ff9305cd99 std: add a pure rust strftime formatter. 2012-04-03 22:43:10 -07:00
Erick Tryzelaar
4a4889859e std: add localtime/gmtime support. 2012-04-03 22:43:10 -07:00
Erick Tryzelaar
72444636d3 std: Flesh out result::extensions. 2012-04-03 22:43:09 -07:00
Erick Tryzelaar
2ad20df40b std: Rename result::methods to result::extensions 2012-04-03 22:43:09 -07:00
Erick Tryzelaar
44c7386376 std: fix a typo. 2012-04-03 22:43:09 -07:00
Erick Tryzelaar
4871f11439 std: change timeval to ns resolution timespec
This lets us use the more precise clock_gettime on posix
machines.
2012-04-03 22:43:08 -07:00
Erick Tryzelaar
7aae7320db std: change time::timeval to be {sec: i64, usec: i32}.
It's possible to have negative times if expressing time before 1970, so
we should use signed types. Other platforms can return times at a higher
resolution, so we should use 64 bits.
2012-04-03 22:43:08 -07:00
Brian Anderson
12d3d4f125 core: Export is_null, is_not_null 2012-04-03 22:32:55 -07:00
Brian Anderson
3b8097dacc core: Add ptr::is_null/is_not_null 2012-04-03 21:56:16 -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
4cf7efc8f7 rt: Fix bugs in the osmain scheduler 2012-04-03 20:24:29 -07:00
Brian Anderson
bd97ee6520 rustdoc: Remove stray binary 2012-04-03 19:01:00 -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
Brian Anderson
81ce090643 rt: Include the correct header for alloca on windows 2012-04-03 17:19:15 -07:00
Tim Chevalier
bc5e10dd1b xfail - metadata encoding doesn't work, which breaks Windows 2012-04-03 17:16:14 -07:00
Brian Anderson
ab2158f070 rt: alloca is spelled differently on win32 2012-04-03 17:12:10 -07:00
Brian Anderson
f4b293f0e3 rt: Fix the 0 bytes lost issue
This is a workaround for #1815. libev uses realloc(0) to
free the loop, which valgrind doesn't like. We have suppressions
to make valgrind ignore them.

Valgrind also has a sanity check when collecting allocation backtraces
that the stack pointer must be at least 512 bytes into the stack (at
least 512 bytes of frames must have come before). When this is not
the case it doesn't collect the backtrace.

Unfortunately, with our spaghetti stacks that valgrind check triggers
sometimes and we don't get the backtrace for the realloc(0), it
fails to be suppressed, and it gets reported as 0 bytes lost
from a malloc with no backtrace.

This fixes the issue by alloca'ing 512 bytes before calling uv_loop_delete
2012-04-03 17:08:33 -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
4f4b7b10bb rt: Futz with headers to satisfy FreeBSD 2012-04-03 16:02:38 -07:00
Jon Morton
72ffb4b446 fix 'I don't know how C works' 2012-04-03 16:02:38 -07:00
Jon Morton
386069f39e actually remove memory.h; include cleanups 2012-04-03 16:02:38 -07:00
Jon Morton
632a4c9326 Refactor includes structure, getting rid of rust_internal.h
Many changes to code structure are included:
- removed TIME_SLICE_IN_MS
- removed sychronized_indexed_list
- removed region_owned
- kernel_owned move to kernel.h, task_owned moved to task.h
- global configs moved to rust_globals.h
- changed #pragma once to standard guard in rust_upcall.h
- got rid of memory.h
2012-04-03 16:02:38 -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
Niko Matsakis
704ca046a1 update make glob from .so to .dylib 2012-04-03 11:54:24 -07:00
Marijn Haverbeke
f65e26eeee Output type sizes in reinterpret_cast error message
Closes #2095
2012-04-03 16:37:54 +02:00
Marijn Haverbeke
90d3f0fb5e Ensure method names in iface and impl items are unique
Closes #2114
2012-04-03 16:37:28 +02:00
Tim Chevalier
fabd49bc2d Use os::copy_file in cargo 2012-04-02 22:57:28 -07:00
Tim Chevalier
e9ff495942 Merge branch 'issue-1983' of https://github.com/thomaslee/rust into issue-2090
This adds a new os::copy_file function, contributed by Thomas Lee.
I added test cases.
2012-04-02 21:47:20 -07:00
Graydon Hoare
28a0e9c999 Construct new strings through upcalls. 2012-04-02 17:38:06 -07: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
e1858882a4 rt: Run a single-threaded scheduler on the main thread 2012-04-02 15:35:47 -07:00
Graydon Hoare
987bc23629 Remove redundant **tydesc gepi/load pair in call_tydesc_glue_full. 2012-04-02 15:26:12 -07:00
Brian Anderson
dd63c5ef1d rt: Add an assert to rust_get_current_task 2012-04-02 14:23:24 -07:00
Jon Morton
fa88d15d63 remove unneeded assert, move get_task_tls to sched_loop 2012-04-02 14:21:09 -07:00
Jon Morton
33a949eed6 Add global rust_get_current_task
Previously two methods existed: rust_sched_loop::get_task and rust_task::get_task_from_tcb. Merge both of them into one, trying the faster one (tcb) first, and if that fails, the slower one from the tls.
2012-04-02 14:21:08 -07:00
Jon Morton
bcb9269d84 rt: cleanup passing around of rust_env 2012-04-02 03:11:58 -05:00
Brian Anderson
bee45f0ef0 rt: rust_env is a struct 2012-04-01 21:07:42 -07:00
Brian Anderson
3232c52a61 rt: Assert things that are true 2012-04-01 20:54:30 -07:00
Brian Anderson
6042aefeeb rt: Convert an old warning to an assert 2012-04-01 20:49:41 -07:00
Jon Morton
128a8b6ed5 remove rust_srv 2012-04-01 22:18:40 -05:00
Jon Morton
413994ea3e replace assertion macros with plain asserts 2012-04-01 21:14:16 -05:00
Brian Anderson
3654ef0078 rt: Introduce rust_manual_sched_launcher_factory. Again, so sorry 2012-04-01 17:35:35 -07:00
Brian Anderson
7c1be236a5 rt: Introduce rust_sched_launcher_factory. Sorry, I need one 2012-04-01 17:27:18 -07:00
Brian Anderson
fb528dd7d6 rt: Allow some schedulers to stay alive even without tasks to execute 2012-04-01 16:57:14 -07:00
Brian Anderson
0a5e9d45e1 rt: Introduce rust_manual_sched_launcher 2012-04-01 16:21:48 -07:00
Brian Anderson
efe4c6af23 core: Use the or binop instead of the double-star binop 2012-04-01 15:05:29 -07:00
Brian Anderson
252086c89a Merge pull request #2099 from jsternberg/master
os::list_dir to return only the contents of the directory
2012-04-01 14:59:07 -07:00
Brian Anderson
9d5c20ecca rt: rust_sched_launcher needs a virtual destructor 2012-04-01 13:25:49 -07:00
Jonathan Sternberg
3a0477c398 Fixing issue 1919. list_dir is the more general version that returns a vector with the contents of the directory. list_dir_path contains the old behavior (as a convenience function). 2012-04-01 11:39:17 -04:00
Brian Anderson
ac0381c0bb rt: rust_sched_launcher does not need a join() method 2012-04-01 00:24:25 -07:00
Brian Anderson
e78396850d Merge remote-tracking branch 'brson/mainthread'
Conflicts:
	src/rt/rust_sched_loop.cpp
	src/rt/rust_shape.cpp
	src/rt/rust_task.cpp
2012-04-01 00:15:04 -07:00
Brian Anderson
de47fcfdf9 rt: Extract rust_thread_sched_launcher from rust_sched_launcher 2012-03-31 23:35:41 -07:00
Brian Anderson
21064637ed rt: Fix whitespace 2012-03-31 23:12:06 -07:00
Brian Anderson
a17097a57b rt: Make rust_sched_launcher hide it's thread implementation 2012-03-31 21:48:52 -07:00
Brian Anderson
2d8ef7387e rt: Add some more locking asserts to rust_sched_loop 2012-03-31 19:51:30 -07:00
Brian Anderson
c8dc6fcb4c Revert "rt: Remove lock_held_by_current_thread"
Adds back the ability to make assertions about locks, but only under the
--enable-debug configuration

This reverts commit b247de6458.

Conflicts:

	src/rt/rust_sched_loop.cpp
2012-03-31 19:51:29 -07:00
Brian Anderson
609144f7a6 rt: Extract start_main_loop from rust_sched_loop to rust_sched_driver 2012-03-31 19:51:29 -07:00
Brian Anderson
218dd08469 rt: Introduce rust_sched_reaper
This just moves the responsibility for joining with scheduler threads
off to a worker thread. This will be needed when we allow tasks to be
scheduled on the main thread.
2012-03-31 19:51:29 -07:00
Brian Anderson
771c1be6a6 rt: Refactor the scheduler loop so that it can be driven from without 2012-03-31 19:51:29 -07:00
Brian Anderson
243790836a rt: Rename rust_task_thread to rust_sched_loop
This class no longer represents a thread; it just schedules tasks.
2012-03-31 19:51:29 -07:00
Brian Anderson
6bf8d19712 rt: Extract rust_sched_launcher from rust_task_thread
rust_sched_launcher is actually responsible for setting up the thread and
starting the loop. There will be other implementations that do not actually
set up a new thread, in order to support scheduling tasks on the main OS
thread.
2012-03-31 19:51:29 -07:00
Jon Morton
9851a906a5 initialize cur_thread, first task on thread 0 2012-03-31 13:14:54 -05:00
Jon Morton
8aee42a382 Choose task thread in rust_scheduler by round robin
Remove the random context from rust_scheduler and use a simple round robin system to choose which thread a new task gets put on. Also, some incorrect tab indents around scoped blocks were fixed.
2012-03-31 02:14:44 -05:00
Brian Anderson
0904f25507 rustc: Convert some error logs to debug 2012-03-30 17:31:40 -07:00
Marijn Haverbeke
a4906b81f7 Change a span_err back to span_fatal
Closes #2073
2012-03-30 08:25:45 +02:00
Brian Anderson
6e8cf935db core: Add each, each_char to str::extensions 2012-03-29 22:30:15 -07:00
Brian Anderson
8641c95221 core: Add str::each_char 2012-03-29 22:28:26 -07:00
Brian Anderson
9bff2f2545 core: Add each, eachi to vec::extensions 2012-03-29 22:17:11 -07:00
Brian Anderson
5d54defce4 core: Add extension methods for vec 2012-03-29 20:56:50 -07:00
Brian Anderson
f65ea0c812 core: Add extension methods for option 2012-03-29 20:56:50 -07:00
Brian Anderson
392d3c8d44 core: Add extension methods for str 2012-03-29 20:56:50 -07:00
Niko Matsakis
35a3fa0999 add some comments explaining how the tables work 2012-03-29 19:41:09 -07:00
Niko Matsakis
2b45da8a33 refactor to store the types during inference in tables in the fcx
this is a step towards separating out the repr. of
types during inference from the repr. in later stages.
2012-03-29 19:41:09 -07:00
Niko Matsakis
f682b99e36 generate correct constraints for assignments 2012-03-29 19:41:09 -07:00
Niko Matsakis
76d0a13ae5 resolve type variables with no constraints to bot 2012-03-29 19:41:09 -07:00
Brian Anderson
5b3740508a test: Prevent run-fail/too-much-recursion from being optimized to nothing 2012-03-29 16:43:18 -07:00
Brian Anderson
b17145b4ae rt: Track backtraces of all allocations with RUSTRT_TRACK_ALLOCATIONS=3 2012-03-29 16:43:18 -07:00
Brian Anderson
3ff01361d5 rt: Make the CC sweep use the box annihilator 2012-03-29 16:43:18 -07:00
Brian Anderson
ad26b00696 rustc: Generate fewer landing pads 2012-03-29 16:43:18 -07:00
Brian Anderson
15de9b3c95 rt: Make the box annihilator walk and delete contents 2012-03-29 16:43:18 -07:00
Brian Anderson
5747fe7a2c rt: For now, only run the box annihilator after task failure 2012-03-29 16:43:18 -07:00
Brian Anderson
7f9ed39040 rustc: Only invoke when there are cleanups 2012-03-29 16:43:18 -07:00
Brian Anderson
8780db2e0b rustc: Delete some unused invoke code 2012-03-29 16:43:18 -07:00
Brian Anderson
b420f46f03 rustc: Don't generate landing pad cleanups for boxy things 2012-03-29 16:43:18 -07:00
Brian Anderson
3a7a408386 rt: Free all outstanding boxes at task death 2012-03-29 16:43:18 -07:00
Brian Anderson
106c9faa59 rustc: Move ext to librustsyntax 2012-03-29 14:42:31 -07:00
Brian Anderson
14e9f58b50 build: Add librustsyntax to snapshots 2012-03-29 14:42:31 -07:00
Brian Anderson
0e87039348 rustc: Remove the rustsyntax::attr wrapper in front 2012-03-29 14:42:31 -07:00
Brian Anderson
ba69a738c7 rustc: Cleanup 2012-03-29 14:42:31 -07:00
Brian Anderson
442d0a783a rustc: Move attr, parse, print to rustsyntax 2012-03-29 14:42:31 -07:00
Brian Anderson
15947f8b19 rustc: Move lexer and token to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
ce216a5533 rustc: Remove the session dependency from front::attr 2012-03-29 14:42:30 -07:00
Brian Anderson
cb2840bcaf rustc: Add an accessor to get the diagnostic handler from the session 2012-03-29 14:42:30 -07:00
Brian Anderson
8f809f89d9 rustc: Move diagnostic to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
5c25e78b27 rustc: Move fold to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
454df53464 rustc: Move interner to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
9e299f53f4 rustc: Move ast, ast_util, visit to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
140151f3f9 rustc: Move codemap to rustsyntax 2012-03-29 14:42:30 -07:00
Brian Anderson
a0ed1fb20b build: Introduce rustsyntax crate 2012-03-29 14:42:30 -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
Patrick Walton
c2f28e231f stdlib: Remove the now-obsolete vec::alloc_len in favor of vec::capacity 2012-03-29 08:57:34 -07:00
Patrick Walton
8774493dd3 test: Rewrite binarytrees to use arenas
Perf isn't bad now. Still 50% slower than Java, but faster than other GC'd languages.
2012-03-29 08:41:26 -07:00
Patrick Walton
166d14e42d stdlib: Actually increase arena chunk sizes by powers of two 2012-03-29 08:41:26 -07:00
Patrick Walton
b210c7ad97 stdlib: Allow the fast path of arena allocation to be CCI'd. 15% improvement on binary-trees. 2012-03-29 08:41:26 -07:00
Patrick Walton
1d25594657 rustc: Add a vec::alloc_len and fix arena logic to use it 2012-03-29 08:41:26 -07:00
Patrick Walton
5ce3d35f41 rustc: Don't zero out arena chunks with vec::from_elem; that's slow because it calls the glue. 2012-03-29 08:41:25 -07:00
Patrick Walton
2663018792 rustc: Fix an infinite loop during size calculations for recursive region pointer types 2012-03-29 08:41:25 -07:00
Patrick Walton
6f0cbf4cd4 stdlib: Fix a pointer mistake in arenas 2012-03-29 08:41:25 -07:00
Brian Anderson
0d5d2e5e14 core: Don't use upcall_vec_grow from str::push_char 2012-03-29 00:20:05 -07:00
Grahame Bowland
7a87258155 Rewrite str::push_char in rust.
Avoid crossing to C to reallocate underlying array when possible,
if we must we now only cross once per char (not once per byte.)
2012-03-29 00:20:05 -07:00
Brian Anderson
b7b66b6cb3 core: Don't call into the runtime to reserve if we have capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
c0a99790cb core: Add str::capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
ad21976fbc core: Add vec::capacity 2012-03-29 00:20:05 -07:00
Brian Anderson
5e42c5cf19 core: Add str::reserve_at_least 2012-03-29 00:20:05 -07:00
Brian Anderson
b3d7823381 core: Add and use vec::reserve_at_least
This reserves in powers of two
2012-03-29 00:20:05 -07:00
Brian Anderson
8e743b2981 core: Improve docs for str::reserve 2012-03-29 00:20:05 -07:00
Brian Anderson
1446534271 core: Clarify docs on vec::reserve 2012-03-29 00:20:05 -07:00
Graydon Hoare
412dba5743 Update snaps for linux to point to snaps that actually work on RHEL5. 2012-03-28 20:58:43 -07:00
Graydon Hoare
e950313155 Remove execvpe use in general, it seems pointless and non-portable. 2012-03-28 20:58:43 -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
fe610f04d8 use fresh vars in place of _|_ when incorrect # of params supplied 2012-03-28 17:02:54 -07:00
Niko Matsakis
23f92ea370 Detect and report types which could never be instantiated.
Fixes #2063.
2012-03-28 17:02:54 -07:00
Brian Anderson
8cf44bed57 core: Add int8_t, etc. types to libc::types::common::c99 2012-03-28 16:32:02 -07:00
Graydon Hoare
0622a74c48 Fix long line. 2012-03-28 15:16:32 -07:00
Niko Matsakis
3955b3a41a refactor so that pretty mode tests also run aux-build. Fixes #2060. 2012-03-28 14:59:36 -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
Graydon Hoare
2aaca455b9 Tidy up multiple declarations and STDC_FOO_MACROS guards in headers. 2012-03-28 14:26:51 -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
Graydon Hoare
c141e7a068 Fix some gcc-4.4-isms, should build now on 4.1+. 2012-03-28 13:52:47 -07:00
Graydon Hoare
b37d7e26fe Update crate URLs to point to interesting things. 2012-03-28 13:52:47 -07:00
Jesse Ruderman
d0ddc69298 Update CC fuzzer 2012-03-28 12:30:07 -07:00
Jesse Ruderman
8d8581e7f9 Update AST fuzzer 2012-03-28 12:29:53 -07:00
Grahame Bowland
232c771105 python scripts run with Python 2.4 (for RHEL5) 2012-03-28 11:29:47 -07:00
Tim Chevalier
52f2a9a1c9 Test case to make sure typestate checks the body of class constructors 2012-03-28 10:38:57 -07:00
Marijn Haverbeke
90cf9e0d6f Make sure type_use.rs doesn't get lost in recursive enums
Closes #2059
2012-03-28 10:35:16 +02: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
Niko Matsakis
c9102ee7a1 make type_kind exhaustive, add an entry for type_self (in particular) 2012-03-27 15:44:36 -07:00
Brian Anderson
42f2810eca emacs: Make 'mut' a keyword 2012-03-27 15:10:25 -07:00
Brian Anderson
f4ee5582c7 core: Rename iter::to_list to to_vec. Closes #2056 2012-03-27 14:50:33 -07:00
Brian Anderson
ba3292d3be rust: Remove extensions' dependency on the session 2012-03-27 14:16:46 -07:00
Marijn Haverbeke
73d6df32cd Emergency safe-ref-checker maintenance
It still has some big problems, but at least it more or less
understands block arguments now.

Closes #1925
2012-03-27 17:22:57 +02:00
Marijn Haverbeke
b5a4fa9456 Move some code over to iterator-for to see how it performs. 2012-03-27 15:46:33 +02:00
Marijn Haverbeke
cbad6925c1 Register new snapshot 2012-03-27 13:53:11 +02:00
Marijn Haverbeke
eec6383771 Add vec::each, vec::eachi, and list::each
For use with the new for construct.

Issue #1619
2012-03-27 12:53:19 +02: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
Marijn Haverbeke
f6e3738b9c Support an alternate for syntax that calls a higher-order function
The last argument of the call must be a block, and the type of this
argument must a function returning bool. `break` and `cont` are
supported in the body of the block, and return `false` or `true` from
the function. When the end of the function is reached, `true` is
implicitly returned.

    for vec::all([1, 2, 3]) {|elt|
        if elt == 2 { break; }
        log(error, elt);
    }

Issue #1619
2012-03-27 09:27:31 +02:00
Graydon Hoare
9638e7fece Register new snapshots. 2012-03-26 22:10:02 -07:00
Graydon Hoare
6e6798c4e1 Bulk-edit mutable -> mut. 2012-03-26 18:35:18 -07:00
Graydon Hoare
bd0399863f Disable some advanced (post glibc-2.3) libuv features when building snaps. 2012-03-26 18:03:53 -07:00
Brian Anderson
45a709766c rustc: Begin eliminating ext's dependency on the session 2012-03-26 17:16:26 -07:00
Brian Anderson
a477aaba08 rustc: Move eval_const_expr to its own mod 2012-03-26 17:16:26 -07:00
Patrick Walton
b7a741b5d0 rustc: Combine and unify regions 2012-03-26 15:07:15 -07:00
Patrick Walton
03086c5304 rustc: "unkown" -> "unknown" 2012-03-26 12:53:06 -07:00
Patrick Walton
b86c603bdf rustc: Fix typo in infer 2012-03-26 12:52:31 -07:00
Patrick Walton
d877ebdd05 rustc: Remove obsolete FIXME in infer 2012-03-26 12:49:14 -07:00
Patrick Walton
407be52036 rustc: Generalize resolve_var to work with regions too 2012-03-26 12:42:38 -07:00
Brian Anderson
d92f3ac524 Merge pull request #2054 from j3parker/master
Minor fixes
2012-03-26 12:24:53 -07:00