Brian Anderson
3b6a32d7c9
core::rt: Add a test that rng works with new tasks
2013-05-07 12:08:03 -07:00
bors
154f3b00e0
auto merge of #6271 : pnkfelix/rust/issue6009-condition-pub-priv-variants, r=graydon
...
@brson: r? [please ignore the other one that was accidentally based off master due to back-button-bugs in github.com]
My goal is to resolve the question of whether we want to encourage (by example) consistent use of pub to make identifiers publicly-accessible, even in syntax extensions. (If people don't want that, then we can just let this pull request die.)
This is part one of two. Part two, whose contents should be clear from the FIXME's in this commit, would land after this gets incorporated into a snapshot.
(The eventual goal is to address issue #6009 , which was implied by my choice of branch name, but not mentioned in the pull request, so github did not notice it.)
2013-05-07 05:06:39 -07:00
Felix S. Klock II
1cbf0a84dc
Step one for 'proper' pub condition: support pub keyword in form.
2013-05-06 19:05:36 +02:00
Niko Matsakis
4300d4d2fa
Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
...
Conflicts:
src/libcore/core.rc
src/libcore/hashmap.rs
src/libcore/num/f32.rs
src/libcore/num/f64.rs
src/libcore/num/float.rs
src/libcore/num/int-template.rs
src/libcore/num/num.rs
src/libcore/num/strconv.rs
src/libcore/num/uint-template.rs
src/libcore/ops.rs
src/libcore/os.rs
src/libcore/prelude.rs
src/libcore/rt/mod.rs
src/libcore/unstable/lang.rs
src/librustc/driver/session.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/gather_loans.rs
src/librustc/middle/borrowck/loan.rs
src/librustc/middle/borrowck/preserve.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/region.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/inline.rs
src/librustc/middle/trans/reachable.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/regionck.rs
src/librustc/util/ppaux.rs
src/libstd/arena.rs
src/libstd/ebml.rs
src/libstd/json.rs
src/libstd/serialize.rs
src/libstd/std.rc
src/libsyntax/ast_map.rs
src/libsyntax/parse/parser.rs
src/test/compile-fail/borrowck-uniq-via-box.rs
src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
src/test/run-pass/borrowck-nested-calls.rs
2013-05-05 15:11:04 -04:00
Brian Anderson
8081e8debf
Register snapshots
2013-05-04 15:43:51 -07:00
Niko Matsakis
bf2d3c71e3
improve DEBUG_BORROW printouts
2013-05-04 14:25:15 -04:00
Daniel Micay
86efd97a10
add gitattributes and fix whitespace issues
2013-05-03 20:01:42 -04:00
Niko Matsakis
34024353e8
Change borrow debugging so it is disabled by -O
2013-05-03 05:42:00 -04:00
Niko Matsakis
4af2d90af5
add an option to debug borrows (RUST_DEBUG_BORROW) so you can
...
find out where the offending borrow occurred. This ... still needs
some work.
2013-05-01 10:30:54 -04:00
Brian Anderson
4a4646fd54
Merge remote-tracking branch 'brson/io'
...
Conflicts:
src/libcore/task/local_data_priv.rs
2013-04-30 17:01:27 -07:00
Niko Matsakis
418f991118
allover: numerous unused muts etc
2013-04-30 14:10:21 -04:00
Niko Matsakis
a896440ca1
new borrow checker (mass squash)
2013-04-30 06:59:32 -04:00
Niko Matsakis
b5a7e8b353
desnapshot
2013-04-30 06:46:02 -04:00
Niko Matsakis
202b8dcdc4
adapt to snapshot
2013-04-30 06:43:02 -04:00
Patrick Walton
876483dcf4
test: Fix tests.
2013-04-29 14:30:56 -07:00
Patrick Walton
b0522a497c
librustc: Remove ptr::addr_of
.
2013-04-29 14:30:53 -07:00
Brian Anderson
28ab152832
Merge remote-tracking branch 'brson/io'
...
Conflicts:
src/libcore/rt/uvio.rs
2013-04-24 19:06:05 -07:00
Brian Anderson
1962803854
core: Warning police
2013-04-24 13:47:52 -07:00
Brian Anderson
354460e53b
Tidy
2013-04-23 23:52:58 -07:00
Brian Anderson
c0e734d203
core::rt: Add more I/O docs
2013-04-23 23:52:56 -07:00
Brian Anderson
e944c7dade
Merge remote-tracking branch 'brson/io'
...
This also reverts some changes to TLS that were leaking memory.
Conflicts:
src/libcore/rt/uv/net.rs
src/libcore/task/local_data_priv.rs
src/libcore/unstable/lang.rs
2013-04-23 19:19:32 -07:00
Alex Crichton
0c2ab662b7
Fixing some various warnings about unused imports
2013-04-23 19:59:14 -04:00
Alex Crichton
4c08a8d6c3
Removing more unnecessary unsafe blocks throughout
2013-04-23 19:59:13 -04:00
Brian Anderson
2a819ae465
core::rt: Tasks to not require an unwinder
...
A task without an unwinder will abort the process on failure.
I'm using this in the runtime tests to guarantee that a call to
`assert!` actually triggers some kind of failure (an abort)
instead of silently doing nothing. This is essentially in lieu
of a working linked failure implementation.
2013-04-23 15:11:28 -07:00
Tim Chevalier
52d3f5558e
core, rustc: Warning police
2013-04-23 10:17:38 -07:00
Brian Anderson
8a2f9cae21
core::rt: Fix a use after free in uv 'write'
2013-04-22 19:20:31 -07:00
Brian Anderson
42c0f88232
core::rt: Add unwinding to newsched tasks
2013-04-22 17:15:31 -07:00
Brian Anderson
5fbb0949a5
core::rt: Add implementations of Reader, Writer, and Listener for Option
...
These will make it easier to write I/O code without worrying about errors
2013-04-22 15:08:47 -07:00
Brian Anderson
6644a034f0
core::rt: Move the definition of Listener to rt::io
2013-04-22 13:26:37 -07:00
Brian Anderson
e5d21b9ff1
core::rt: Make I/O constructors return Option instead of Result
...
For consistency, for all I/O calls, inspecting the error can be done with
the io_error condition.
2013-04-22 13:11:02 -07:00
Brian Anderson
d0786fdffc
core::rt Wire up task-local storage to the new scheduler
2013-04-22 13:05:16 -07:00
Brian Anderson
d7f5e437a2
core::rt: Add the local heap to newsched tasks
...
Reusing the existing boxed_region implementation from the runtime
2013-04-21 19:03:54 -07:00
Brian Anderson
f9069baa70
core::rt: Add LocalServices for thread-local language services
...
Things like the GC heap and unwinding are desirable everywhere the language
might be used, not just in tasks. All Rust code should have access to
LocalServices.
2013-04-21 16:28:19 -07:00
Alex Crichton
13537d2e0c
core: remove unused 'mut' variables
2013-04-20 21:02:38 -04:00
Brian Anderson
4eff3130c5
core::rt:: Implement Reader/Writer for MemReader/MemWriter
2013-04-20 17:25:00 -07:00
Brian Anderson
fa478f5775
core: Speed up a test case
2013-04-20 16:15:32 -07:00
Brian Anderson
d818ea8154
core::rt: Listener constructors are called and return a
2013-04-20 15:55:37 -07:00
Brian Anderson
bcb3cfb8ce
core::rt: Improve docs for run_in_newsched_task testing function
2013-04-20 15:55:07 -07:00
Brian Anderson
6e17202ff4
core::rt: Add next_test_ip4
for generating test addresses
2013-04-20 14:50:06 -07:00
Brian Anderson
a11c032f36
core::rt: Fix a broken uvio test
2013-04-20 02:16:21 -07:00
Brian Anderson
e564fc7f6b
core::rt: Don't directly create scheduler types in I/O tests
...
There are some better abstractions for this now
2013-04-20 01:55:10 -07:00
Brian Anderson
1a7561be4d
core::rt: Remove redundant copy of run_in_newsched_task
2013-04-20 01:37:59 -07:00
Brian Anderson
eac629bf5c
core::rt: Unignore some networking tests
...
These should work now, I hope
2013-04-20 01:32:08 -07:00
Brian Anderson
d24a3a4b01
core::rt: Use generated port numbers in tests
2013-04-20 01:16:06 -07:00
Brian Anderson
744ba627f3
core::rt: Add a test mod and put run_in_newsched_task there
2013-04-20 00:33:49 -07:00
Alex Crichton
98dfeb173f
core: clean up tests (mostly unused unsafe blocks)
2013-04-19 23:23:23 -04:00
Brian Anderson
6a5c4f68c2
core::rt: Just some poking at the I/O docs
2013-04-19 18:47:31 -07:00
Brian Anderson
e47ee779cd
wip
2013-04-19 15:18:38 -07:00
Brian Anderson
7270fadfcc
core::rt: Rename Closeable to Close, Seekable to Seek, blocking to native
2013-04-19 14:58:21 -07:00
Brian Anderson
e782e1f371
Tidy
2013-04-19 12:05:19 -07:00
Brian Anderson
b57611d10c
core::rt: Simplify some scheduler operations
2013-04-19 12:05:19 -07:00
Brian Anderson
eddd817bf0
core::rt: Add another context switching operation to the scheduler
...
`switch_running_tasks_and_then` does a context switch to another
task then immediatly runs a closure.
2013-04-19 12:05:18 -07:00
Brian Anderson
d261bb32d9
core: More tweaks to the thread-local scheduler interface
2013-04-19 12:05:18 -07:00
Brian Anderson
15ece0c23e
core: Wire up spawn
to the new scheduler
...
It will check which scheduler it is running under and create the
correct type of task as appropriate. Most options aren't supported
but basic spawning works.
2013-04-19 12:05:18 -07:00
Brian Anderson
b96765179e
core: Add rt::context for figuring out what runtime services are available
...
Conflicts:
src/libcore/rt/sched/mod.rs
2013-04-19 12:05:18 -07:00
Brian Anderson
c44d7a6486
core::rt: Declare large parts of the I/O API
2013-04-19 12:05:18 -07:00
bors
16652c9c17
auto merge of #5909 : brson/rust/rt4, r=graydon
...
This is just a bunch of minor changes and simplifications to the structure of core::rt. It makes ownership of the ~Scheduler more strict (though it is still mutably aliased sometimes), turns the scheduler cleanup_jobs vector into just a single job, shunts the thread-local scheduler code off to its own file.
2013-04-17 20:42:58 -07:00
bors
fdb4ef321e
auto merge of #5726 : brson/rust/struct-return, r=brson
...
r? @nikomatsakis
This doesn't completely fix the x86 ABI for structs, but it does fix some cases. On linux, structs appear to be returned correctly now. On windows, structs are only returned by pointer when they are greater than 8 bytes. That scenario works now.
In the case where the struct is less than 8 bytes our generated code looks peculiar. When returning a pair of u16, C packs both variables into %eax to return them. Our generated code though expects to find one of the pair in %ax and the other in %dx. Similar for u8. I haven't looked into it yet.
There appears to also be struct passing problems on linux, where my `extern-pass-TwoU8s` and `extern-pass-TwoU16s` tests are failing.
2013-04-17 18:45:58 -07:00
Brian Anderson
a5ddc00982
rustc: Use an out pointer to return structs in x86 C ABI. #5347
...
This Adds a bunch of tests for passing and returning structs
of various sizes to C. It fixes the struct return rules on unix,
and on windows for structs of size > 8 bytes. Struct passing
on unix for structs under a certain size appears to still be broken.
2013-04-17 15:49:19 -07:00
Brian Anderson
7bfd0e5035
Merge remote-tracking branch 'brson/sched-cleanup'
...
Conflicts:
src/libcore/rt/sched/mod.rs
2013-04-16 11:23:13 -07:00
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
Alex Crichton
d9595d1737
core: remove unnecessary unsafe blocks/functions
2013-04-14 01:15:46 -04:00
Niko Matsakis
61b9e0ebfa
core: changes in response to #5656
2013-04-10 17:32:03 -07:00
Jyun-Yan You
fdf48a7b52
rt: improve mips backend
2013-04-04 18:53:58 +08:00
Graydon Hoare
0647a0fc28
remove stray mode on callback, seems to not change anything
2013-04-01 14:18:07 -07:00
Luqman Aden
eadd358b2a
Correct type signature for start lang item.
2013-03-30 19:59:21 -07:00
Niko Matsakis
6965fe4bce
Add AbiSet and integrate it into the AST.
...
I believe this patch incorporates all expected syntax changes from extern
function reform (#3678 ). You can now write things like:
extern "<abi>" fn foo(s: S) -> T { ... }
extern "<abi>" mod { ... }
extern "<abi>" fn(S) -> T
The ABI for foreign functions is taken from this syntax (rather than from an
annotation). We support the full ABI specification I described on the mailing
list. The correct ABI is chosen based on the target architecture.
Calls by pointer to C functions are not yet supported, and the Rust type of
crust fns is still *u8.
2013-03-29 18:36:20 -07:00
Patrick Walton
1e91595520
librustc: Remove fail_unless!
2013-03-29 16:39:08 -07:00
bors
5da9e12778
auto merge of #5570 : alexcrichton/rust/fix-unused-imports, r=sanxiyn
...
Before it wouldn't warn about unused imports in the list if something in the list was used. These commits fix that case, add a test, and remove all unused imports in lists of imports throughout the compiler.
2013-03-29 05:57:44 -07:00
Young-il Choi
e6f2d7a48c
libcore: language change minor fix for ARM & MIPS
2013-03-29 15:46:13 +09:00
Alex Crichton
be57d745d2
Removing unused imports
2013-03-28 23:56:46 -04:00
Patrick Walton
e5dda811a9
librustc: Allow expr_repeat to be used with any vstore
2013-03-27 13:53:03 -07:00
Patrick Walton
8b56a8380b
librustc: Modify all code to use new lifetime binder syntax
2013-03-26 21:30:17 -07:00
Patrick Walton
142dbd65da
librustc: Remove all uses of the old [T * N]
fixed-length vector syntax
2013-03-26 21:29:34 -07:00
Alex Crichton
fa7772893a
Remove unused imports throughout
2013-03-26 19:20:02 -04:00
Brian Anderson
e5f8026eba
core: Make sure every module at least has a one-line description
2013-03-26 11:48:22 -07:00
Brian Anderson
30d4124a37
Merge remote-tracking branch 'brson/rt'
...
Conflicts:
src/libcore/rt/context.rs
src/libcore/rt/sched.rs
src/libcore/rt/thread.rs
src/libcore/rt/uv.rs
2013-03-25 12:28:54 -07:00
Patrick Walton
85c9fc6f8f
librustc: Remove the const
declaration form everywhere
2013-03-22 22:24:35 -07:00
Patrick Walton
fa70709e07
libsyntax: Stop parsing pure
and static
2013-03-22 22:24:33 -07:00
Patrick Walton
be9bddd463
libcore: Remove pure
from libcore. rs=depure
2013-03-22 10:29:17 -07:00
Patrick Walton
4634f7edae
librustc: Remove all uses of static
from functions. rs=destatic
2013-03-22 10:27:39 -07:00
Marvin Löbel
9d9a209e9a
back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> slice_unique
2013-03-21 14:05:57 +01:00
Marvin Löbel
a7d296f24c
renamed str::view -> slice_DBG_BRWD
...
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method -> slice_V_DBG_BRWD
2013-03-21 01:50:32 +01:00
Patrick Walton
ca3bc644f4
libcore: Make a couple of constructors public. rs=testfixing
2013-03-19 20:37:53 -07:00
Patrick Walton
2e7ec80bcc
librustc: Enforce privacy for static methods.
...
This starts moving a bunch of privacy checks into the privacy
checking phase and out of resolve.
2013-03-19 13:40:48 -07:00
Patrick Walton
352c070365
librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming
2013-03-18 17:21:14 -07:00
Brian Anderson
5af5766512
core: Initialize global state lazily in the Scheduler ctor
...
I don't want any global one-time initalization functions because
that will make embedding harder.
2013-03-18 17:00:35 -07:00