]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoadd support for the `cold` function attribute
Daniel Micay [Mon, 21 Oct 2013 03:13:48 +0000 (23:13 -0400)]
add support for the `cold` function attribute

This allows a function to marked as infrequently called, resulting in
any branch calling it to be considered colder.

10 years agoauto merge of #10080 : brson/rust/sched_queue, r=brson
bors [Mon, 28 Oct 2013 03:21:29 +0000 (20:21 -0700)]
auto merge of #10080 : brson/rust/sched_queue, r=brson

Rebase and update of #9710

10 years agoauto merge of #10098 : alexcrichton/rust/attempts, r=alexcrichton
bors [Mon, 28 Oct 2013 01:41:25 +0000 (18:41 -0700)]
auto merge of #10098 : alexcrichton/rust/attempts, r=alexcrichton

It was pretty much a miracle that these tests were ever passing. They would
never have passed in the single threaded case because only one sigint in the
tests is ever generated, but when run in parallel two sigints will be generated.

10 years agoIgnore a test which never completes on windows
Alex Crichton [Sun, 27 Oct 2013 17:58:32 +0000 (10:58 -0700)]
Ignore a test which never completes on windows

I'm not entirely sure why this is happening, but the server task is never seeing
the second send of the client task, and this test will very reliably fail to
complete on windows.

10 years agoauto merge of #10026 : luqmana/rust/mut-pat, r=pcwalton
bors [Sun, 27 Oct 2013 16:51:21 +0000 (09:51 -0700)]
auto merge of #10026 : luqmana/rust/mut-pat, r=pcwalton

Fixes #9792.

10 years agoFix a typo in a rt::io::signal test
Alex Crichton [Sun, 27 Oct 2013 06:31:14 +0000 (23:31 -0700)]
Fix a typo in a rt::io::signal test

It was pretty much a miracle that these tests were ever passing. They would
never have passed in the single threaded case because only one sigint in the
tests is ever generated, but when run in parallel two sigints will be generated.

10 years agoauto merge of #10072 : brson/rust/modelines, r=thestinger
bors [Sat, 26 Oct 2013 09:16:08 +0000 (02:16 -0700)]
auto merge of #10072 : brson/rust/modelines, r=thestinger

These are relics that serve no purpose.

10 years agoauto merge of #10048 : ibukanov/rust/mkdir-fix, r=brson
bors [Sat, 26 Oct 2013 08:11:11 +0000 (01:11 -0700)]
auto merge of #10048 : ibukanov/rust/mkdir-fix, r=brson

The patch replaces mkdir -p dir with (umask 022 && mkdir -p dir). Sadly mkdir -m 755 -p dir does not work if it creates parent directories as those parents will have umask permissions, not the one passed with -m option.

Closes #10046

10 years agoauto merge of #10070 : alexcrichton/rust/fewer-missiles, r=brson
bors [Sat, 26 Oct 2013 07:06:09 +0000 (00:06 -0700)]
auto merge of #10070 : alexcrichton/rust/fewer-missiles, r=brson

This optimizes the `home_for_io` code path by requiring fewer scheduler
operations in some situtations.

When moving to your home scheduler, this no longer forces a context switch if
you're already on the home scheduler. Instead, the homing code now simply pins
you to your current scheduler (making it so you can't be stolen away). If you're
not on your home scheduler, then we context switch away, sending you to your
home scheduler.

When the I/O operation is done, then we also no longer forcibly trigger a
context switch. Instead, the action is cased on whether the task is homed or
not. If a task does not have a home, then the task is re-flagged as not having a
home and no context switch is performed. If a task is homed to the current
scheduler, then we don't do anything, and if the task is homed to a foreign
scheduler, then it's sent along its merry way.

I verified that there are about a third as many `write` syscalls done in print
operations now. Libuv uses write to implement async handles, and the homing
before and after each I/O operation was triggering a write on these async
handles. Additionally, using the terrible benchmark of printing 10k times in a
loop, this drives the runtime from 0.6s down to 0.3s (yay!).

10 years agoauto merge of #10082 : brson/rust/gyp, r=huonw
bors [Sat, 26 Oct 2013 04:09:37 +0000 (21:09 -0700)]
auto merge of #10082 : brson/rust/gyp, r=huonw

The upstream repo has been offline for hours. A single point of failure is plenty.

10 years agoPoint gyp submodule toward github
Brian Anderson [Sat, 26 Oct 2013 03:22:07 +0000 (20:22 -0700)]
Point gyp submodule toward github

10 years agoEncapsulate the lock-free mpsc queue in the MessageQueue type
Brian Anderson [Sat, 26 Oct 2013 02:52:02 +0000 (19:52 -0700)]
Encapsulate the lock-free mpsc queue in the MessageQueue type

10 years agoAdd links to original mpmc and mpsc implementations
Brian Anderson [Sat, 26 Oct 2013 02:46:35 +0000 (19:46 -0700)]
Add links to original mpmc and mpsc implementations

10 years agoTidy
Brian Anderson [Sat, 26 Oct 2013 01:33:05 +0000 (18:33 -0700)]
Tidy

10 years agominor
Jason Toffaletti [Tue, 8 Oct 2013 15:09:13 +0000 (08:09 -0700)]
minor

10 years agominor
Jason Toffaletti [Mon, 7 Oct 2013 21:51:23 +0000 (14:51 -0700)]
minor

10 years agofix bug introduced by previous clean up. more clean up.
Jason Toffaletti [Mon, 7 Oct 2013 08:17:09 +0000 (01:17 -0700)]
fix bug introduced by previous clean up. more clean up.

10 years agoclean up
Jason Toffaletti [Mon, 7 Oct 2013 07:43:51 +0000 (00:43 -0700)]
clean up

10 years agoadd padding to prevent false sharing
Jason Toffaletti [Mon, 7 Oct 2013 07:43:34 +0000 (00:43 -0700)]
add padding to prevent false sharing

10 years agoadd multi-producer multi-consumer bounded queue to use for sleeper list
Jason Toffaletti [Mon, 7 Oct 2013 07:07:04 +0000 (00:07 -0700)]
add multi-producer multi-consumer bounded queue to use for sleeper list

10 years agoadd cache line padding
Jason Toffaletti [Fri, 4 Oct 2013 08:25:55 +0000 (01:25 -0700)]
add cache line padding

10 years agolock-free queue for scheduler message queue
Jason Toffaletti [Fri, 4 Oct 2013 02:23:47 +0000 (19:23 -0700)]
lock-free queue for scheduler message queue

10 years agoRemove ancient emacs mode lines from test cases
Brian Anderson [Fri, 25 Oct 2013 21:28:38 +0000 (14:28 -0700)]
Remove ancient emacs mode lines from test cases

These are relics that serve no purpose.

10 years agoFire fewer homing missiles
Alex Crichton [Fri, 25 Oct 2013 18:11:30 +0000 (11:11 -0700)]
Fire fewer homing missiles

This optimizes the `home_for_io` code path by requiring fewer scheduler
operations in some situtations.

When moving to your home scheduler, this no longer forces a context switch if
you're already on the home scheduler. Instead, the homing code now simply pins
you to your current scheduler (making it so you can't be stolen away). If you're
not on your home scheduler, then we context switch away, sending you to your
home scheduler.

When the I/O operation is done, then we also no longer forcibly trigger a
context switch. Instead, the action is cased on whether the task is homed or
not. If a task does not have a home, then the task is re-flagged as not having a
home and no context switch is performed. If a task is homed to the current
scheduler, then we don't do anything, and if the task is homed to a foreign
scheduler, then it's sent along its merry way.

I verified that there are about a third as many `write` syscalls done in print
operations now. Libuv uses write to implement async handles, and the homing
before and after each I/O operation was triggering a write on these async
handles. Additionally, using the terrible benchmark of printing 10k times in a
loop, this drives the runtime from 0.6s down to 0.3s (yay!).

10 years agoauto merge of #10067 : sanxiyn/rust/addr-of-bot, r=thestinger
bors [Fri, 25 Oct 2013 19:56:20 +0000 (12:56 -0700)]
auto merge of #10067 : sanxiyn/rust/addr-of-bot, r=thestinger

Fix #5500.

10 years agoauto merge of #10066 : sanxiyn/rust/mut-ptr-clone, r=thestinger
bors [Fri, 25 Oct 2013 18:46:11 +0000 (11:46 -0700)]
auto merge of #10066 : sanxiyn/rust/mut-ptr-clone, r=thestinger

10 years agoauto merge of #10060 : alexcrichton/rust/cached-stdout, r=brson
bors [Fri, 25 Oct 2013 17:36:09 +0000 (10:36 -0700)]
auto merge of #10060 : alexcrichton/rust/cached-stdout, r=brson

Almost all languages provide some form of buffering of the stdout stream, and
this commit adds this feature for rust. A handle to stdout is lazily initialized
in the Task structure as a buffered owned Writer trait object. The buffer
behavior depends on where stdout is directed to. Like C, this line-buffers the
stream when the output goes to a terminal (flushes on newlines), and also like C
this uses a fixed-size buffer when output is not directed at a terminal.

We may decide the fixed-size buffering is overkill, but it certainly does reduce
write syscall counts when piping output elsewhere. This is a *huge* benefit to
any code using logging macros or the printing macros. Formatting emits calls to
`write` very frequently, and to have each of them backed by a write syscall was
very expensive.

In a local benchmark of printing 10000 lines of "what" to stdout, I got the
following timings:

  when |  terminal   |  redirected
----------|---------------|--------
before |  0.575s     |   0.525s
after  |  0.197s     |   0.013s
  C    |  0.019s     |   0.004s

I can also confirm that we're buffering the output appropriately in both
situtations. We're still far slower than C, but I believe much of that has to do
with the "homing" that all tasks due, we're still performing an order of
magnitude more write syscalls than C does.

10 years agoCache and buffer stdout per-task for printing
Alex Crichton [Fri, 25 Oct 2013 00:30:36 +0000 (17:30 -0700)]
Cache and buffer stdout per-task for printing

Almost all languages provide some form of buffering of the stdout stream, and
this commit adds this feature for rust. A handle to stdout is lazily initialized
in the Task structure as a buffered owned Writer trait object. The buffer
behavior depends on where stdout is directed to. Like C, this line-buffers the
stream when the output goes to a terminal (flushes on newlines), and also like C
this uses a fixed-size buffer when output is not directed at a terminal.

We may decide the fixed-size buffering is overkill, but it certainly does reduce
write syscall counts when piping output elsewhere. This is a *huge* benefit to
any code using logging macros or the printing macros. Formatting emits calls to
`write` very frequently, and to have each of them backed by a write syscall was
very expensive.

In a local benchmark of printing 10000 lines of "what" to stdout, I got the
following timings:

  when |  terminal   |  redirected
----------------------------------
before |  0.575s     |   0.525s
after  |  0.197s     |   0.013s
  C    |  0.019s     |   0.004s

I can also confirm that we're buffering the output appropriately in both
situtations. We're still far slower than C, but I believe much of that has to do
with the "homing" that all tasks due, we're still performing an order of
magnitude more write syscalls than C does.

10 years agoAllow taking address of bottom
Seo Sanghyeon [Fri, 25 Oct 2013 10:15:29 +0000 (19:15 +0900)]
Allow taking address of bottom

10 years agoImplement Clone trait for mutable unsafe pointers
Seo Sanghyeon [Fri, 25 Oct 2013 09:43:55 +0000 (18:43 +0900)]
Implement Clone trait for mutable unsafe pointers

10 years agoauto merge of #10054 : alexcrichton/rust/basic-event-loop, r=brson
bors [Fri, 25 Oct 2013 07:46:11 +0000 (00:46 -0700)]
auto merge of #10054 : alexcrichton/rust/basic-event-loop, r=brson

This is more progress towards #9128 and all its related tree of issues. This implements a new `BasicLoop` on top of pthreads synchronization primitives (wrapped in `LittleLock`). This also removes the wonky `callback_ms` function from the interface of the event loop.

After #9901 is taking forever to land, I'm going to try to do all this runtime work in much smaller chunks than before. Right now this will not work unless #9901 lands first, but I'm close to landing it (hopefully), and I wanted to go ahead and get this reviewed before throwing it at bors later on down the road.

This "pausible idle callback" is also a bit of a weird idea, but it wasn't as difficult to implement as callback_ms so I'm more semi-ok with it.

10 years agoImplement a basic event loop built on LittleLock
Alex Crichton [Tue, 22 Oct 2013 22:00:37 +0000 (15:00 -0700)]
Implement a basic event loop built on LittleLock

It's not guaranteed that there will always be an event loop to run, and this
implementation will serve as an incredibly basic one which does not provide any
I/O, but allows the scheduler to still run.

cc #9128

10 years agoauto merge of #10061 : thestinger/rust/rustc, r=alexcrichton
bors [Fri, 25 Oct 2013 06:36:10 +0000 (23:36 -0700)]
auto merge of #10061 : thestinger/rust/rustc, r=alexcrichton

10 years agolibsyntax: Get rid of obsolete obsolete warning.
Luqman Aden [Wed, 23 Oct 2013 07:56:52 +0000 (03:56 -0400)]
libsyntax: Get rid of obsolete obsolete warning.

10 years agolibrustc: Don't emit unused mut lint twice.
Luqman Aden [Wed, 23 Oct 2013 07:50:22 +0000 (03:50 -0400)]
librustc: Don't emit unused mut lint twice.

10 years agoTest for mut in ident patterns.
Luqman Aden [Wed, 23 Oct 2013 03:51:45 +0000 (23:51 -0400)]
Test for mut in ident patterns.

10 years agolibsyntax: Get rid of some logic for some obsolete syntax.
Luqman Aden [Wed, 23 Oct 2013 03:44:55 +0000 (23:44 -0400)]
libsyntax: Get rid of some logic for some obsolete syntax.

10 years agolibsyntax/librustc: Allow mut qualifier in patterns.
Luqman Aden [Sun, 20 Oct 2013 12:31:23 +0000 (08:31 -0400)]
libsyntax/librustc: Allow mut qualifier in patterns.

10 years agoremove some dead trans code
Daniel Micay [Fri, 25 Oct 2013 01:58:47 +0000 (21:58 -0400)]
remove some dead trans code

10 years agoauto merge of #10059 : thestinger/rust/glue, r=pcwalton
bors [Fri, 25 Oct 2013 01:56:05 +0000 (18:56 -0700)]
auto merge of #10059 : thestinger/rust/glue, r=pcwalton

Closes #10045

10 years agostop trying to outsmart LLVM inline heuristics
Daniel Micay [Fri, 25 Oct 2013 00:41:23 +0000 (20:41 -0400)]
stop trying to outsmart LLVM inline heuristics

Closes #10045

10 years agoauto merge of #10055 : pcwalton/rust/arc-clone-inline, r=alexcrichton
bors [Fri, 25 Oct 2013 00:36:07 +0000 (17:36 -0700)]
auto merge of #10055 : pcwalton/rust/arc-clone-inline, r=alexcrichton

r? @thestinger

10 years agoRemove the 'callback_ms' function from EventLoop
Alex Crichton [Thu, 24 Oct 2013 18:30:35 +0000 (11:30 -0700)]
Remove the 'callback_ms' function from EventLoop

This is a peculiar function to require event loops to implement, and it's only
used in one spot during tests right now. Instead, a possibly more robust apis
for timers should be used rather than requiring all event loops to implement a
curious-looking function.

10 years agoFix a bug with the scheduler and destructor order
Alex Crichton [Tue, 22 Oct 2013 21:59:21 +0000 (14:59 -0700)]
Fix a bug with the scheduler and destructor order

The PausibleIdleCallback must have some handle into the event loop, and because
struct destructors are run in order of top-to-bottom in order of fields, this
meant that the event loop was getting destroyed before the idle callback was
getting destroyed.

I can't confirm that this fixes a problem in how we use libuv, but it does
semantically fix a problem for usage with other event loops.

10 years agoauto merge of #9901 : alexcrichton/rust/unix-sockets, r=brson
bors [Thu, 24 Oct 2013 21:26:15 +0000 (14:26 -0700)]
auto merge of #9901 : alexcrichton/rust/unix-sockets, r=brson

Large topics:

* Implemented `rt::io::net::unix`. We've got an implementation backed by "named pipes" for windows for free from libuv, so I'm not sure if these should be `cfg(unix)` or whether they'd be better placed in `rt::io::pipe` (which is currently kinda useless), or to leave in `unix`. Regardless, we probably shouldn't deny windows of functionality which it certainly has.
* Fully implemented `net::addrinfo`, or at least fully implemented in the sense of making the best attempt to wrap libuv's `getaddrinfo` api
* Moved standard I/O to a libuv TTY instead of just a plain old file descriptor. I found that this interacted better when closing stdin, and it has the added bonus of getting things like terminal dimentions (someone should make a progress bar now!)
* Migrate to `~Trait` instead of a typedef'd object where possible. There are only two more types which are blocked on this, and those are traits which have a method which takes by-value self (there's an open issue on this)
* Drop `rt::io::support::PathLike` in favor of just `ToCStr`. We recently had a lot of Path work done, but it still wasn't getting passed down to libuv (there was an intermediate string conversion), and this allows true paths to work all the way down to libuv (and anything else that can become a C string).
* Removes `extra::fileinput` and `extra::io_util`

Closes #9895
Closes #9975
Closes #8330
Closes #6850 (ported lots of libraries away from std::io)
cc #4248 (implemented unix/dns)
cc #9128 (made everything truly trait objects)

10 years agoAnother round of test fixes and merge conflicts
Alex Crichton [Tue, 22 Oct 2013 16:36:30 +0000 (09:36 -0700)]
Another round of test fixes and merge conflicts

10 years agoBring io::signal up to date with changes to rt::rtio
Alex Crichton [Tue, 22 Oct 2013 15:51:44 +0000 (08:51 -0700)]
Bring io::signal up to date with changes to rt::rtio

10 years agowrapping libuv signal for use in Rust
Do Nhat Minh [Thu, 19 Sep 2013 04:03:50 +0000 (12:03 +0800)]
wrapping libuv signal for use in Rust
descriptive names
easier-to-use api
reorganize and document

10 years agoFixing some tests, adding some pipes
Alex Crichton [Tue, 22 Oct 2013 15:41:05 +0000 (08:41 -0700)]
Fixing some tests, adding some pipes

This adds constructors to pipe streams in the new runtime to take ownership of
file descriptors, and also fixes a few tests relating to the std::run changes
(new errors are raised on io_error and one test is xfail'd).

10 years agoMigrate std::run to libuv processes
Alex Crichton [Tue, 22 Oct 2013 06:44:11 +0000 (23:44 -0700)]
Migrate std::run to libuv processes

10 years agoRemove std::io once and for all!
Alex Crichton [Tue, 22 Oct 2013 06:06:12 +0000 (23:06 -0700)]
Remove std::io once and for all!

10 years agoRemove std::io from ebml
Alex Crichton [Tue, 22 Oct 2013 00:11:42 +0000 (17:11 -0700)]
Remove std::io from ebml

10 years agoTest fixes and merge conflicts
Alex Crichton [Fri, 18 Oct 2013 04:08:48 +0000 (21:08 -0700)]
Test fixes and merge conflicts

10 years agoMove stdin to using libuv's pipes instead of a tty
Alex Crichton [Fri, 18 Oct 2013 21:01:22 +0000 (14:01 -0700)]
Move stdin to using libuv's pipes instead of a tty

I was seeing a lot of weird behavior with stdin behaving as a tty, and it
doesn't really quite make sense, so instead this moves to using libuv's pipes
instead (which make more sense for stdin specifically).

This prevents piping input to rustc hanging forever.

10 years agoRemove io::read_error
Alex Crichton [Fri, 18 Oct 2013 18:52:23 +0000 (11:52 -0700)]
Remove io::read_error

The general idea is to remove conditions completely from I/O, so in the meantime
remove the read_error condition to mean the same thing as the io_error condition.

10 years agoStop logging task failure to task loggers
Alex Crichton [Fri, 18 Oct 2013 01:51:32 +0000 (18:51 -0700)]
Stop logging task failure to task loggers

The isn't an ideal patch, and the comment why is in the code. Basically uvio
uses task::unkillable which touches the kill flag for a task, and if the task is
failing due to mismangement of the kill flag, then there will be serious
problems when the task tries to print that it's failing.

10 years agoRemove even more of std::io
Alex Crichton [Mon, 14 Oct 2013 01:48:47 +0000 (18:48 -0700)]
Remove even more of std::io

Big fish fried here:

    extra::json
    most of the compiler
    extra::io_util removed
    extra::fileinput removed

Fish left to fry

    extra::ebml

10 years agoMove as much I/O as possible off of native::io
Alex Crichton [Fri, 18 Oct 2013 00:04:51 +0000 (17:04 -0700)]
Move as much I/O as possible off of native::io

When uv's TTY I/O is used for the stdio streams, the file descriptors are put
into a non-blocking mode. This means that other concurrent writes to the same
stream can fail with EAGAIN or EWOULDBLOCK. By all I/O to event-loop I/O, we
avoid this error.

There is one location which cannot move, which is the runtime's dumb_println
function. This was implemented to handle the EAGAIN and EWOULDBLOCK errors and
simply retry again and again.

10 years agoMigrate the last typedefs to ~Trait in rtio
Alex Crichton [Thu, 17 Oct 2013 19:13:29 +0000 (12:13 -0700)]
Migrate the last typedefs to ~Trait in rtio

There are no longer any remnants of typedefs, and everything is now built on
true trait objects.

10 years agoDon't attempt to export uv functions directly
Alex Crichton [Thu, 17 Oct 2013 18:28:05 +0000 (11:28 -0700)]
Don't attempt to export uv functions directly

10 years agoRemove IoFactoryObject for ~IoFactory
Alex Crichton [Thu, 17 Oct 2013 00:05:28 +0000 (17:05 -0700)]
Remove IoFactoryObject for ~IoFactory

This involved changing a fair amount of code, rooted in how we access the local
IoFactory instance. I added a helper method to the rtio module to access the
optional local IoFactory. This is different than before in which it was assumed
that a local IoFactory was *always* present. Now, a separate io_error is raised
when an IoFactory is not present, yet I/O is requested.

10 years agoRemove rt::io::support
Alex Crichton [Wed, 16 Oct 2013 23:48:30 +0000 (16:48 -0700)]
Remove rt::io::support

This removes the PathLike trait associated with this "support module". This is
yet another "container of bytes" trait, so I didn't want to duplicate what
already exists throughout libstd. In actuality, we're going to pass of C strings
to the libuv APIs, so instead the arguments are now bound with the 'ToCStr'
trait instead.

Additionally, a layer of complexity was removed by immediately converting these
type-generic parameters into CStrings to get handed off to libuv apis.

10 years agoMigrate Rtio objects to true trait objects
Alex Crichton [Wed, 16 Oct 2013 21:48:05 +0000 (14:48 -0700)]
Migrate Rtio objects to true trait objects

This moves as many as I could over to ~Trait instead of ~Typedef. The only
remaining one is the IoFactoryObject which should be coming soon...

10 years agoMove rt::io::stdio from FileStream to a TTY
Alex Crichton [Wed, 16 Oct 2013 18:47:12 +0000 (11:47 -0700)]
Move rt::io::stdio from FileStream to a TTY

We get a little more functionality from libuv for these kinds of streams (things
like terminal dimentions), and it also appears to more gracefully handle the
stream being a window. Beforehand, if you used stdio and hit CTRL+d on a
process, libuv would continually return 0-length successful reads instead of
interpreting that the stream was closed.

I was hoping to be able to write tests for this, but currently the testing
infrastructure doesn't allow tests with a stdin and a stdout, but this has been
manually tested! (not that it means much)

10 years agoRemove unbound pipes from io::pipe
Alex Crichton [Wed, 16 Oct 2013 18:39:51 +0000 (11:39 -0700)]
Remove unbound pipes from io::pipe

This isn't necessary for creating processes (or at least not right now), and
it inherently attempts to expose implementation details.

10 years agoAddress a few XXX comments throughout the runtime
Alex Crichton [Wed, 16 Oct 2013 03:55:50 +0000 (20:55 -0700)]
Address a few XXX comments throughout the runtime

* Implement Seek for Option<Seek>
* Remove outdated comment for io::process
* De-pub a component which didn't need to be pub

10 years agoFinish implementing io::net::addrinfo
Alex Crichton [Wed, 16 Oct 2013 03:37:39 +0000 (20:37 -0700)]
Finish implementing io::net::addrinfo

This fills in the `hints` structure and exposes libuv's full functionality for
doing dns lookups.

10 years agoImplement io::net::unix
Alex Crichton [Wed, 16 Oct 2013 02:44:08 +0000 (19:44 -0700)]
Implement io::net::unix

10 years agolibextra: Make arc::get and arc::new inline too.
Patrick Walton [Thu, 24 Oct 2013 20:50:21 +0000 (13:50 -0700)]
libextra: Make arc::get and arc::new inline too.

Should be a 2x improvement in a Servo test case.

10 years agolibextra: Make arc clone inline
Patrick Walton [Thu, 24 Oct 2013 20:21:49 +0000 (13:21 -0700)]
libextra: Make arc clone inline

10 years agoauto merge of #10007 : Kimundi/rust/add_docs_01, r=cmr
bors [Thu, 24 Oct 2013 20:01:18 +0000 (13:01 -0700)]
auto merge of #10007 : Kimundi/rust/add_docs_01, r=cmr

Additionally:
- Sorted the prelude reexports
- Removed unused import warning in std::mem and cleaned it up too

(I was bored :ghost: )

10 years agoCleaned, documented, wrote tests for up std::bool
Marvin Löbel [Mon, 21 Oct 2013 19:41:32 +0000 (21:41 +0200)]
Cleaned, documented, wrote tests for up std::bool
Removed unused import warning in std::mem and cleaned it up too

Removed is_true and is_false from std::bool

Removed freestanding functions in std::bool

10 years agoauto merge of #10042 : thestinger/rust/fail, r=sanxiyn
bors [Thu, 24 Oct 2013 12:11:06 +0000 (05:11 -0700)]
auto merge of #10042 : thestinger/rust/fail, r=sanxiyn

Closes #10023

10 years agorust / build: make install should use explicit permissions when creating directories
Igor Bukanov [Thu, 24 Oct 2013 08:23:12 +0000 (10:23 +0200)]
rust / build: make install should use explicit permissions when creating directories

Closes #10046

10 years agoauto merge of #10040 : thestinger/rust/frame_address, r=alexcrichton
bors [Thu, 24 Oct 2013 04:46:03 +0000 (21:46 -0700)]
auto merge of #10040 : thestinger/rust/frame_address, r=alexcrichton

Closes #10001

10 years agodrop unused `frame_address` intrinsic
Daniel Micay [Thu, 24 Oct 2013 01:15:14 +0000 (21:15 -0400)]
drop unused `frame_address` intrinsic

Closes #10001

10 years agomark some functions as returning !
Daniel Micay [Thu, 24 Oct 2013 02:22:59 +0000 (22:22 -0400)]
mark some functions as returning !

Closes #10023

10 years agoauto merge of #10032 : thestinger/rust/snapshot, r=huonw
bors [Wed, 23 Oct 2013 22:11:07 +0000 (15:11 -0700)]
auto merge of #10032 : thestinger/rust/snapshot, r=huonw

10 years agoregister snapshots
Daniel Micay [Wed, 23 Oct 2013 08:49:18 +0000 (04:49 -0400)]
register snapshots

10 years agoauto merge of #10022 : hatahet/rust/master, r=alexcrichton
bors [Wed, 23 Oct 2013 18:36:13 +0000 (11:36 -0700)]
auto merge of #10022 : hatahet/rust/master, r=alexcrichton

Fixes #9958

10 years agoMade uv_stat_t.{st_dev, st_ino} public, #9958
Ziad Hatahet [Wed, 23 Oct 2013 18:16:35 +0000 (11:16 -0700)]
Made uv_stat_t.{st_dev, st_ino} public, #9958

10 years agoMerge remote-tracking branch 'upstream/master'
Ziad Hatahet [Wed, 23 Oct 2013 17:09:06 +0000 (10:09 -0700)]
Merge remote-tracking branch 'upstream/master'

10 years agoauto merge of #10034 : sfackler/rust/time, r=alexcrichton
bors [Wed, 23 Oct 2013 16:41:14 +0000 (09:41 -0700)]
auto merge of #10034 : sfackler/rust/time, r=alexcrichton

These are supposed to be raw C-like structs mirroring time.h's struct tm
and struct timespec.

10 years agoRe-make time struct fields public
Steven Fackler [Wed, 23 Oct 2013 16:06:31 +0000 (09:06 -0700)]
Re-make time struct fields public

These are supposed to be raw C-like structs mirroring time.h's struct tm
and struct timespec.

10 years agoauto merge of #9810 : huonw/rust/rand3, r=alexcrichton
bors [Wed, 23 Oct 2013 15:31:21 +0000 (08:31 -0700)]
auto merge of #9810 : huonw/rust/rand3, r=alexcrichton

- Adds the `Sample` and `IndependentSample` traits for generating numbers where there are parameters (e.g. a list of elements to draw from, or the mean/variance of a normal distribution). The former takes `&mut self` and the latter takes `&self` (this is the only difference).
- Adds proper `Normal` and `Exp`-onential distributions
- Adds `Range` which generates `[lo, hi)` generically & properly (via a new trait) replacing the incorrect behaviour of `Rng.gen_integer_range` (this has become `Rng.gen_range` for convenience, it's far more efficient to use `Range` itself)
- Move the `Weighted` struct from `std::rand` to `std::rand::distributions` & improve it
- optimisations and docs

10 years agoauto merge of #10027 : catamorphism/rust/testcases-2013-10-22, r=catamorphism
bors [Wed, 23 Oct 2013 09:06:12 +0000 (02:06 -0700)]
auto merge of #10027 : catamorphism/rust/testcases-2013-10-22, r=catamorphism

10 years agoauto merge of #10021 : alexcrichton/rust/asm-now-analyzed-correctly, r=luqmana
bors [Wed, 23 Oct 2013 07:01:23 +0000 (00:01 -0700)]
auto merge of #10021 : alexcrichton/rust/asm-now-analyzed-correctly, r=luqmana

We got a snapshot, taking care of a note to myself.

10 years agoauto merge of #10015 : huonw/rust/minor-fixes, r=alexcrichton
bors [Wed, 23 Oct 2013 05:51:10 +0000 (22:51 -0700)]
auto merge of #10015 : huonw/rust/minor-fixes, r=alexcrichton

- Use ["nothing up my sleeve numbers"](http://en.wikipedia.org/wiki/Nothing_up_my_sleeve_number) for the ISAAC tests.
- Replace the default implementation of `Rng.fill_bytes` with something that doesn't try to do bad things with `transmute` and vectors just for the sake of a little speed.
- Replace the transmutes used to seed the ISAAC RNGs with calls into `vec::raw`.

10 years agotestsuite: Test cases, all except issue-5216 xfailed
Tim Chevalier [Wed, 23 Oct 2013 04:04:15 +0000 (21:04 -0700)]
testsuite: Test cases, all except issue-5216 xfailed

10 years agoauto merge of #9654 : catamorphism/rust/rustpkg-c-dependencies, r=brson
bors [Wed, 23 Oct 2013 03:56:05 +0000 (20:56 -0700)]
auto merge of #9654 : catamorphism/rust/rustpkg-c-dependencies, r=brson

r? @brson api::install_pkg now accepts an argument that's a list of
(kind, path) dependency pairs. This allows custom package scripts to
declare C dependencies, as is demonstrated in
rustpkg::tests::test_c_dependency_ok.

Closes #6403

10 years agorustpkg: Support arbitrary dependencies in the install API
Tim Chevalier [Tue, 1 Oct 2013 05:39:50 +0000 (22:39 -0700)]
rustpkg: Support arbitrary dependencies in the install API

api::install_pkg now accepts an argument that's a list of
(kind, path) dependency pairs. This allows custom package scripts to
declare C dependencies, as is demonstrated in
rustpkg::tests::test_c_dependency_ok.

Closes #6403

10 years agoauto merge of #9989 : luqmana/rust/mut-everywhere, r=alexcrichton
bors [Wed, 23 Oct 2013 02:46:09 +0000 (19:46 -0700)]
auto merge of #9989 : luqmana/rust/mut-everywhere, r=alexcrichton

10 years agoUpdate the manual.
Luqman Aden [Wed, 23 Oct 2013 01:37:42 +0000 (21:37 -0400)]
Update the manual.

10 years agoRemove thread-blocking call to `libc::stat` in `Path::stat`
Ziad Hatahet [Wed, 23 Oct 2013 01:25:07 +0000 (18:25 -0700)]
Remove thread-blocking call to `libc::stat` in `Path::stat`

Fixes #9958

10 years agoAdd tests for uniq & by-value self in mut slot.
Luqman Aden [Mon, 21 Oct 2013 07:50:09 +0000 (03:50 -0400)]
Add tests for uniq & by-value self in mut slot.

10 years agolibsyntax/librustc: Allow specifying mut on ~self.
Luqman Aden [Sun, 20 Oct 2013 06:34:01 +0000 (02:34 -0400)]
libsyntax/librustc: Allow specifying mut on ~self.

10 years agolibsyntax/librustc: Allow specifying mut on by-value self.
Luqman Aden [Sun, 20 Oct 2013 05:55:23 +0000 (01:55 -0400)]
libsyntax/librustc: Allow specifying mut on by-value self.

10 years agostd::rand: seed ISAAC with no transmutes.
Huon Wilson [Tue, 22 Oct 2013 12:11:17 +0000 (23:11 +1100)]
std::rand: seed ISAAC with no transmutes.

Slice transmutes are now (and, really, always were) dangerous, so we
avoid them and do the (only?) non-(undefined behaviour in C) pointer
cast: casting to *u8.

10 years agostd::rand: use "nothing up your sleeve numbers" for ISAAC tests.
Huon Wilson [Tue, 22 Oct 2013 11:49:51 +0000 (22:49 +1100)]
std::rand: use "nothing up your sleeve numbers" for ISAAC tests.

There's no value in using the "random" numbers, when nothing up your
sleeve numbers are perfectly serviceable.

http://en.wikipedia.org/wiki/Nothing_up_my_sleeve_number

10 years agostd::rand: simplify/safe-ify the default Rng.fill_bytes.
Huon Wilson [Tue, 22 Oct 2013 07:28:49 +0000 (18:28 +1100)]
std::rand: simplify/safe-ify the default Rng.fill_bytes.

The `&[u8]` -> `&[u64]` and `&[u32]` casts were not nice: they ignored
alignment requirements and are generally very unsafe.