Brian Anderson
1f94364aef
core::rt: Clean up some more hacks
2013-04-15 18:56:39 -07:00
Brian Anderson
ed74ac169e
core::rt: Narrow down the unsafety of the thread-local scheduler
...
Only when borrowing the I/O implementation do we need unsafety
2013-04-15 18:54:02 -07:00
Brian Anderson
68583a25a0
core::rt: Restructure context switches to take ownership of the Scheduler
...
In order to do a context switch you have to give up ownership of the scheduler,
effectively passing it to the next execution context. This could help avoid
some situations here tasks retain unsafe pointers to schedulers between context
switches, across which they may have changed threads.
There are still a number of uses of unsafe scheduler pointers.
2013-04-15 17:45:34 -07:00
Brian Anderson
ebefe07792
core::rt: Make Scheduler::unsafe_local return a fabricated region pointer
...
Instead of taking a closure. It's unsafe either way. Rename it to unsafe_local_borrow.
2013-04-15 16:00:15 -07:00
Brian Anderson
473b4d19ad
core::rt: Rename Scheduler::local to Scheduler::unsafe_local
2013-04-15 15:32:43 -07:00
Brian Anderson
3b8a354c21
core::rt: A little bit of cleanup to thread-local scheduler
2013-04-15 15:25:29 -07:00
Brian Anderson
1f8ebb6a8e
core::rt: Move thread-local scheduler to its own module
2013-04-15 15:18:49 -07:00
Brian Anderson
4f1dd1fd21
core::rt: Fix two incorrect uses of the thread-local scheduler
...
These would not be threadsafe
2013-04-15 15:13:36 -07:00
Brian Anderson
93757d8185
core::rt: Clean up the thread-local scheduler code
...
Remove the ThreadLocalScheduler type in favor of functions.
Move everything into the sched::local module.
2013-04-14 21:53:37 -07:00
Brian Anderson
a2e5827866
core::rt: All context switches are followed by a cleanup action
2013-04-14 20:49:22 -07:00
Brian Anderson
5f52aecb1e
core::rt: Schedulers only need a single cleanup_job at a time
...
Each context switch has up to one cleanup job and it is always
executed immediately after the context switch.
2013-04-14 19:24:43 -07:00
Brian Anderson
6b084bad25
core::rt: Insert calls to run_cleanup_tasks after all context switches
2013-04-14 18:56:22 -07:00
Brian Anderson
1cb78e736f
core::rt: Rename block_running_task_and_then to deschedul_...
2013-04-14 16:12:30 -07:00
Brian Anderson
8e966216c7
core::rt: Restructure task_from_last_cleanup_job to borrow correctly
...
We need a number of mutable references to contexts so name it
`get_contexts` and return a tuple of all of them.
2013-04-14 16:05:16 -07:00
bors
cf34b31704
auto merge of #5825 : danluu/rust/rngdoc, r=erickt
...
This adds an example for most of the methods in Rng.
As a total newcomer to Rust, it took a while to figure out how to do basic things like use library functions, because there aren't many usage examples, and most examples that Google turns up are out of date. Something like this would have saved me a bit of time.
This might be a bit verbose. Some alternative options would be to consolidate all the examples into one section, or to only have code for the specific function call inline.
2013-04-11 09:37:01 -07:00
bors
a3c8f524b8
auto merge of #5823 : Kimundi/rust/str_from_bytes_slice, r=erickt
...
Added str::from_bytes_with_null
Added str::subslice_offset
Misc cleanup
Closes #5422
2013-04-11 08:25:00 -07:00
bors
2f8b36fc16
auto merge of #5819 : erickt/rust/incoming, r=erickt
...
Good morning,
This first patch series adds support for `#[deriving(Decodable, Encodable)]`, but does not yet remove `#[auto_encode]` and `#[auto_decode]`. I need a snapshot to remove the old code. Along the way it also extends support for tuple structs and struct enum variants.
Also, it includes a minor fix to the pretty printer. We decided a while ago to use 4 spaces to indent a match arm instead of 2. This updates the pretty printer to reflect that.
2013-04-11 06:55:01 -07:00
Dan Luu
aff558998e
Fix formatting
2013-04-11 09:12:26 -04:00
bors
e0defb8466
auto merge of #5826 : brson/rust/0.7-pre, r=brson
...
I accidentally changed the version to `0.7-rc` when `0.7-pre` is what @graydon and I agreed on. This fixes.
2013-04-11 02:48:59 -07:00
bors
c27fad7353
auto merge of #5811 : sanxiyn/rust/parse-uint, r=catamorphism
...
It does not handle signs.
2013-04-11 00:31:03 -07:00
Brian Anderson
5b457c1469
xail all debuginfo tests
...
The broke with the LLVM upgrade
2013-04-11 00:16:09 -07:00
ILyoan
03116f251d
add unwind information on morestack
2013-04-10 18:49:51 -07:00
Brian Anderson
a34948a2c5
rustllvm: Initialize target analysis passes
...
Without this the target info for certain optimizations will not be
created and the compiler will sometimes crash
2013-04-10 18:49:51 -07:00
ILyoan
344628fe91
FIX meta_section_name for macos
2013-04-10 18:49:51 -07:00
ILyoan
3d0d144283
rust morestack assembly for arm
...
Conflicts:
src/rt/arch/arm/morestack.S
2013-04-10 18:49:50 -07:00
Young-il Choi
4b4f48283b
rustllvm: followup latest LLVM
2013-04-10 18:49:50 -07:00
Brian Anderson
a9741bd33d
Update LLVM for ARM changes
2013-04-10 18:49:50 -07:00
Erick Tryzelaar
26ecb30f55
test: update serialization tests to use new macro
2013-04-10 16:32:09 -07:00
Erick Tryzelaar
f3ab67ec5f
syntax: add {read,emit}_enum_struct_variant{,_field}
2013-04-10 16:32:09 -07:00
Erick Tryzelaar
e31f7b7c74
std: add serialize {read,emit}_tuple{,_arg,_struct,_struct_arg}
2013-04-10 16:32:09 -07:00
Erick Tryzelaar
441df26f5a
syntax: add support for #[deriving(Decodable)]
2013-04-10 16:32:09 -07:00
Erick Tryzelaar
5841564bf9
syntax: add support for #[deriving(Encodable)]
2013-04-10 16:32:09 -07:00
Erick Tryzelaar
f50a8e2833
syntax: Simplify deriving to handle classes that take generics, like Encodable
2013-04-10 16:32:09 -07:00
Erick Tryzelaar
419f6acf0e
std: rename {read,emit}_field to {read,emit}_struct_field
2013-04-10 16:08:22 -07:00
Erick Tryzelaar
97cc571358
std: clean up the order of {De,En}codable methods
2013-04-10 16:08:22 -07:00
Erick Tryzelaar
4464e44750
syntax: update a deriving error message to use the new syntax
2013-04-10 16:08:22 -07:00
Erick Tryzelaar
74807b1594
syntax: match variants use 4 space indent by default
2013-04-10 16:08:22 -07:00
Marvin Löbel
4ad76e66aa
Add example for str::subslice_offset
2013-04-11 00:48:31 +02:00
Marvin Löbel
9a16179fd3
Added str::from_slice_with_null() to cast a &[u8] to &str
...
Added str::subslice_offset()
Renamed slice_bytes_uniqe to slice_bytes_owned
2013-04-11 00:36:28 +02:00
Brian Anderson
23e44a529b
Bump version to 0.7-pre
2013-04-10 13:12:53 -07:00
Dan Luu
ccae209b0d
Clarify comment
2013-04-10 15:54:28 -04:00
Dan Luu
4b7d363495
Add examples for Rng functions.
2013-04-10 15:08:19 -04:00
bors
11f5f73b2b
auto merge of #5818 : Kimundi/rust/iter_to_vec, r=catamorphism
2013-04-10 11:31:01 -07:00
bors
2c649830be
auto merge of #5709 : jbclements/rust/miscellaneous-cleanup, r=jbclements
...
There's no unifying theme here; I'm just trying to clear a bunch of small commits: removing dead code, adding comments, renaming to an upper-case type, fixing one test case.
2013-04-10 09:43:01 -07:00
John Clements
9deb2f2dfa
libsyntax comments only
2013-04-10 09:15:08 -07:00
John Clements
05bbaf9e9f
removed test referring to WONTFIX bug #2443
2013-04-10 09:15:08 -07:00
John Clements
09bcd3837c
unneccessary since tjc's commit 78ec6fe30c
, fixing #2804
2013-04-10 09:15:08 -07:00
John Clements
27700472b9
removed eval.rs: dead code
...
@brson confirms that eval.rs is now dead code
2013-04-10 09:15:08 -07:00
John Clements
48e7bda826
path -> Path
2013-04-10 09:15:04 -07:00
bors
ac9dc69bf3
auto merge of #5796 : nikomatsakis/rust/issue-5656-fix-map-iteration, r=nikomatsakis
...
Revert map.each to something which takes two parameters rather than a tuple. The current setup iterates over `BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared *in the `each()` method*. You can't place such a type in the impl declaration. The compiler currently allows it, but this will not be legal under #5656 and I'm pretty sure it's not sound now. It's too bad that maps can't implement `BaseIter` (at least not over a tuple as they do here) but I think it has to be this way for the time being.
r? @thestinger
2013-04-10 08:28:02 -07:00