Commit graph

17010 commits

Author SHA1 Message Date
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
a089c6f8fc auto merge of #5908 : jbclements/rust/add-hygiene-machinery, r=graydon
This pull request changes the representation of identifiers by adding an integer to the side of each one.  This integer will eventually be a reference to a side-table of syntax contexts, presumably stored in TLS. This pull request also adds a bunch of utility functions required for hygiene, and associated tests, but doesn't actually deploy those functions.

Finally, it also has a number of small cleanup items.
2013-04-17 19:48:59 -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
bors
68dea75296 auto merge of #5725 : jdm/rust/muttrait, r=nikomatsakis 2013-04-17 17:57:59 -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
Josh Matthews
97303703ee Allow casting to mutable trait objects. 2013-04-17 00:34:25 +02:00
bors
c2f5a87cdd auto merge of #5913 : brson/rust/valgrind, r=brson 2013-04-16 13:42:58 -07:00
Brian Anderson
c6f7b595f0 More valgrind suppressions 2013-04-16 13:40:47 -07:00
bors
07e087bf31 auto merge of #5890 : youknowone/rust/const-eval, r=catamorphism
This will help not to meet confusing errors.
In issue #5873, the error was "expected constant expr for vector length: Can't cast str to int".
It was originally "expected constant expr for vector length: Non-constant path in constant expr" (though still invalid error).
This patch make the original error to be printed.
2013-04-16 12:48:56 -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
John Clements
e7aa24de18 add self.token_to_str and is_any_keyword convenience abstractions 2013-04-16 10:06:06 -07:00
John Clements
7e4cd09e2e added MTWT functions 2013-04-16 10:06:06 -07:00
John Clements
1083ae6b06 better error message on failure to parse type 2013-04-16 10:06:06 -07:00
John Clements
313a5ab946 move interner_key macro 2013-04-16 10:06:05 -07:00
bors
7cacd87efd auto merge of #5904 : huonw/rust/core-vec-windowed, r=thestinger
And add some documentation.
2013-04-16 06:12:55 -07:00
Huon Wilson
21723d5bdc libcore: vec::windowed iterates, not allocates. 2013-04-16 23:07:46 +10:00
bors
76e77af380 auto merge of #5901 : thestinger/rust/iterator, r=sanxiyn
Can now use them like `x.transform(|i| i + 3).zip(y.filter(|i| i % 2)`.
2013-04-15 21:03:55 -07:00
bors
16e8af9e47 auto merge of #5895 : huonw/rust/no-pub-tests, r=thestinger
This patch is a sledge hammer that moves all tests into `#[cfg(test)] mod test { .. }`, and makes them private, there were several instances of `pub mod tests { #[test] pub fn ... } `.

(The reason for this is I was playing with using `syntax` to index code ([result so far](http://www.ug.it.usyd.edu.au/~hwil7821/rust-api/)) and it was getting some junk from the tests.)

The rustdoc commit is particularly brutal, so it's fine if that one isn't landed.
2013-04-15 20:00:56 -07:00
bors
447caf9bdb auto merge of #5899 : catamorphism/rust/copy-cops, r=catamorphism 2013-04-15 19:09:56 -07:00
Tim Chevalier
39d45b75cc rustc: Anti-copy police 2013-04-15 19:06:36 -07:00
Huon Wilson
40e3577b08 libcore: missed an import for a test 2013-04-16 12:04:49 +10: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
Daniel Micay
f82c96446f iterator: use an IteratorUtil trait 2013-04-15 21:35:41 -04:00
Daniel Micay
a581926f57 update RELEASES.txt 2013-04-15 21:09:23 -04: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
bors
442b8e5901 auto merge of #5894 : catamorphism/rust/authors, r=catamorphism 2013-04-15 17:15:56 -07:00
Huon Wilson
ef3a8ebb9b librustdoc: move tests into dedicated tests module. 2013-04-16 09:57:47 +10:00
Huon Wilson
d3be98e9f5 libcore,std,syntax,rustc: move tests into mod tests, make them private (no pub mod or pub fn). 2013-04-16 09:57:47 +10:00
Tim Chevalier
0ef3e1eb25 Update AUTHORS.txt w/ Brett Cannon, Diggory Hardy, Jack Moffitt, James Miller 2013-04-15 16:26:49 -07:00
bors
dd2c7f61a9 auto merge of #5879 : astrieanna/rust/document_std_base64, r=catamorphism
This adds examples for the methods in std::base64.

Each example is complete in the sense that you can copy-paste it into a file and compile it successfully without adding anything (imports, etc). The hardest part of figuring out how to use this was figuring out the right import statements to put at the top.
2013-04-15 16:18:52 -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
bors
f10cf26e25 auto merge of #5861 : catamorphism/rust/rustpkg, r=catamorphism
r? @graydon

Pulled out tests into their own modules inside the files they test,
as per the draft style guidelines.

Started a new module, path_util, for utility functions to do with
paths and directories.

Changed default_dest_dir to use a condition and return Path
instead of Option<Path>.
2013-04-15 14:48:55 -07:00
bors
6ce689d61c auto merge of #5891 : brson/rust/valgrind, r=brson
Hopefully this puts out the final fire
2013-04-15 13:54:57 -07:00
Brian Anderson
7cd681684f rt: Move test functions to rust_test_helpers.cpp 2013-04-15 13:39:15 -07:00
Brian Anderson
6beddb966d Make valgrind suppressions more liberal
Hopefully this puts out the final fire
2013-04-15 13:20:23 -07:00
bors
4beebc427c auto merge of #5797 : alexcrichton/rust/issue-1913, r=catamorphism
Closes #5487, #1913, and #4568

I tracked this by adding all used unsafe blocks/functions to a set on the `tcx` passed around, and then when the lint pass comes around if an unsafe block/function isn't listed in that set, it's unused.

I also removed everything from the compiler that was unused, and up to stage2 is now compiling without any known unused unsafe blocks.

I chose `unused_unsafe` as the name of the lint attribute, but there may be a better name...
2013-04-15 13:00:56 -07:00
Jeong YunWon
9b55d86e74 Prevent eval_const_expr_partial hides prior error in expr_cast arm.
This will help not to meet confusing errors.
In issue #5873, the error was "expected constant expr for vector length: Can't cast str to int".
It was originally "expected constant expr for vector length: Non-constant path in constant expr"
This patch make the original error to be printed.
2013-04-16 04:13:37 +09:00
Tim Chevalier
7881bde027 Tidy 2013-04-15 11:52:38 -07:00
bors
39e2ab5e8b auto merge of #5888 : sawrubh/rust/mybranch, r=pnkfelix 2013-04-15 11:24:57 -07:00
Saurabh Anand
672ddeac37 Modified submodules to use https instead of git for git URL 2013-04-15 22:51:24 +05:30
bors
3809a04bf7 auto merge of #5778 : jld/rust/reflect-abstract-enum, r=graydon
This takes care of one of the last remnants of assumptions about enum layout.  A type visitor is now passed a function to read a value's discriminant, then accesses fields by being passed a byte offset for each one.  The latter may not be fully general, despite the constraints imposed on representations by borrowed pointers, but works for any representations currently planned and is relatively simple.

Closes #5652.
2013-04-15 09:57:55 -07:00
bors
7b152baddf auto merge of #5881 : danluu/rust/xfail_bind_by_move, r=graydon
Update an old test to pass. I'm not 100% sure what the intent of the test was, but it's hard to see how I could have corrupted the intent of the test from the tiny changes I made.
2013-04-15 08:06:57 -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