Commit Graph

24102 Commits

Author SHA1 Message Date
klutzy
fcf9844891 test: Clean up xfail-{fast,win32} tests
Rename {struct-update,fsu}-moves-and-copies, since win32
failed to run the test since UAC prevents any executable whose
name contaning "update". (#10452)

Some tests related to #9205 are expected to fail on gcc 4.8,
so they are marked as `xfail-win32` instead of `xfail-fast`.

Some tests using `extra::tempfile` fail on win32 due to #10462.
Mark them as `xfail-win32`.
2013-11-14 14:25:44 +09:00
bors
58b5c618cf auto merge of #10457 : alexcrichton/rust/native-io, r=brson
This commit re-organizes the io::native module slightly in order to have a
working implementation of rtio::IoFactory which uses native implementations. The
goal is to seamlessly multiplex among libuv/native implementations wherever
necessary.

Right now most of the native I/O is unimplemented, but we have existing bindings
for file descriptors and processes which have been hooked up. What this means is
that you can now invoke println!() from libstd with no local task, no local
scheduler, and even without libuv.

There's still plenty of work to do on the native I/O factory, but this is the
first steps into making it an official portion of the standard library. I don't
expect anyone to reach into io::native directly, but rather only std::io
primitives will be used. Each std::io interface seamlessly falls back onto the
native I/O implementation if the local scheduler doesn't have a libuv one
(hurray trait ojects!)
2013-11-13 19:46:18 -08:00
Alex Crichton
9bcf557589 Implement native::IoFactory
This commit re-organizes the io::native module slightly in order to have a
working implementation of rtio::IoFactory which uses native implementations. The
goal is to seamlessly multiplex among libuv/native implementations wherever
necessary.

Right now most of the native I/O is unimplemented, but we have existing bindings
for file descriptors and processes which have been hooked up. What this means is
that you can now invoke println!() from libstd with no local task, no local
scheduler, and even without libuv.

There's still plenty of work to do on the native I/O factory, but this is the
first steps into making it an official portion of the standard library. I don't
expect anyone to reach into io::native directly, but rather only std::io
primitives will be used. Each std::io interface seamlessly falls back onto the
native I/O implementation if the local scheduler doesn't have a libuv one
(hurray trait ojects!)
2013-11-13 18:34:59 -08:00
Joe Schafer
e91cb479a4 Add Window build directory to .gitignore 2013-11-13 21:05:01 -05:00
bors
8a3b35f68a auto merge of #10464 : gutworth/rust/snap-err, r=pnkfelix
...tatement
2013-11-13 16:26:15 -08:00
Jason Toffaletti
91de538c98 add rust_trylock_little_lock
Try to acquire lock and succeed only if lock is not already held.
Uses TryEnterCriticalSection or pthread_mutex_trylock.
2013-11-13 14:44:50 -08:00
bors
49c6ae10cb auto merge of #10421 : adridu59/rust/patch-www, r=alexcrichton
* Closes #10330
* Improves on #9873
* Adds favicon for tutorial files
2013-11-13 14:41:19 -08:00
bors
2b2a89d97f auto merge of #10447 : alexcrichton/rust/flaky-time-test, r=catamorphism
This test was failing periodically on windows and other platforms, and in
debugging the issue locally I've found that the previous test was failing
at the assertion `ns0 <= ns1`. Upon inspecting the values, the two numbers were
very close to one another, but off by a little bit.

I believe that this is because `precise_time_s` goes from `u64` -> `f64` and
then we go again back to `u64` for the assertion. This conversion is a lossy one
that's not always guaranteed to succeed, so instead I've changed the test to
only compare against u64 instances.
2013-11-13 13:31:24 -08:00
bors
a79ed57beb auto merge of #10451 : zkamsler/rust/buf_writer, r=alexcrichton
I implemented BufWriter. I realize the use of conditions are on their way out for IO, but it does raise a condition if a write will not fit in the buffer for now.

I also replaced the seek code for MemWriter. It was adding the offset as a uint, which is unsound for negative offsets. It only happened to work because unsigned addition performs the same operation with two's complement, and sizeof(uint) <= sizeof(i64) so there was no (lack of) sign extension. I replaced this with computing an offset as an i64 and clamping to zero. I don't expect anyone will have use BufWriter with a byte buffer greater than 2^63 bytes any time soon.

@alexcrichton

Closes #10433
2013-11-13 12:21:28 -08:00
Alex Crichton
7bc092f109 Introduce an io::Buffer trait
This trait is meant to abstract whether a reader is actually implemented with an
underlying buffer. For all readers which are implemented as such, we can
efficiently implement things like read_char, read_line, read_until, etc. There
are two required methods for managing the internal buffer, and otherwise
read_line and friends can all become default methods.

Closes #10334
2013-11-13 11:36:13 -08:00
Zach Kamsler
c2c7a2497d Implemented BufWriter
Filled in the implementations of Writer and Seek for BufWriter. It
raises the io_error condition if a write cannot fit in the buffer.

The Seek implementation for MemWriter, which was incorrectly using
unsigned arithmatic to add signed offsets, has also been replaced.
2013-11-13 14:22:03 -05:00
bors
314d6f693f auto merge of #10277 : dcrewi/rust/missing-doc-and-visibility-rules, r=alexcrichton
Now the privacy pass returns enough information that other passes do not need to duplicate the visibility rules, and the missing_doc implementation is more consistent with other lint checks.
2013-11-13 10:16:29 -08:00
David Creswick
1f7eb4f9aa make missing_doc lint respect the visibility rules
Previously, the `exported_items` set created by the privacy pass was
incomplete. Specifically, it did not include items that had been defined
at a private path but then `pub use`d at a public path. This commit
finds all crate exports during the privacy pass. Consequently, some code
in the reachable pass and in rustdoc is no longer necessary. This commit
then removes the separate `MissingDocLintVisitor` lint pass, opting to
check missing_doc lint in the same pass as the other lint checkers using
the visibility result computed by the privacy pass.

Fixes #9777.
2013-11-13 11:31:59 -06:00
Benjamin Peterson
d328ab765b be more robust when removing download artifacts and remove bogus raise statement 2013-11-13 12:02:50 -05:00
Adrien Tétar
3d57b240ab doc: tidy up makefile rules 2013-11-13 09:40:45 +01:00
Adrien Tétar
58aa18c8ba doc: add favicon to tutorial/manual
Since tutorial/manual files are stored on static.rust-lang.org, browsers
try to fetch the favicon from there while it should be retrieved from the
main domain.
2013-11-13 09:32:50 +01:00
Adrien Tétar
5a01dbe67b doc: disable parser error highlighting + a few fixes
CodeMirror parser errors are related to #9873.
2013-11-13 09:32:29 +01:00
Zack Corr
57486994d5 Add build_lib_with_cfgs, build_bin_with_cfgs to rustpkg API. Closes #9944. 2013-11-13 14:54:17 +10:00
bors
825b127d47 auto merge of #10441 : cmr/rust/bench_bufferedstream, r=alexcrichton
https://github.com/mozilla/rust/pull/10424 did optimizations without adding a
way to measure their effect and ensure no regressions. This fixes that.
2013-11-12 18:56:13 -08:00
Corey Richardson
67692b21b5 io: benchmarks for creation of the various Buffered objects 2013-11-12 21:51:15 -05:00
bors
1bfa45cfd9 auto merge of #10342 : catamorphism/rust/rustpkg-dir-checking-and-monitor, r=erickt
r? @brson
2013-11-12 16:41:14 -08:00
Tim Chevalier
65aacd083a rustpkg: Eliminate the spurious os::path_exists(&pkg_src.start_dir.join(p)) assertion failure
This addresses the problem reported in #10253 and possibly elsewhere.

Closes #10253
2013-11-12 15:32:31 -08:00
bors
2d6952e54a auto merge of #10410 : willingc/rust/shoot-done, r=huonw
...e.

Cleaned up unneeded imports and type changes to resolve compiler warnings.

Work in process
2013-11-12 15:31:21 -08:00
Carol W
33ee4335b9 Fixed xfail for nbody shootout benchmark by correcting command line parse.
Cleaned up unneeded imports and type changes to resolve compiler warnings.
2013-11-12 15:14:07 -08:00
Adrien Tétar
123e0cefb6 doc: CSS: fix code fonts
Closes #10330.
2013-11-12 21:36:09 +01:00
bors
3b0d48634f auto merge of #10427 : alexcrichton/rust/no-xray, r=brson
Just a few triage issues that I ran into.
2013-11-12 12:16:21 -08:00
Alex Crichton
b9b908f62f Make a time test less flaky
This test was failing periodically on windows and other platforms, and in
debugging the issue locally I've found that the previous test was failing
at the assertion `ns0 <= ns1`. Upon inspecting the values, the two numbers were
very close to one another, but off by a little bit.

I believe that this is because `precise_time_s` goes from `u64` -> `f64` and
then we go again back to `u64` for the assertion. This conversion is a lossy one
that's not always guaranteed to succeed, so instead I've changed the test to
only compare against u64 instances.
2013-11-12 11:44:14 -08:00
bors
f1a67bd4c0 auto merge of #10423 : alexcrichton/rust/move-io, r=pcwalton
I still plan on reorganizing the internals of the IO module a bit, but this is the major move which has been on the horizon for awhile.
2013-11-12 11:01:24 -08:00
Florian Hahn
20627c7430 Check inferred integer literals for overflows, closes #4220 2013-11-12 19:36:46 +01:00
Florian Hahn
be09626148 Remove type overflow checks from check_const.rs, refs #4220
The checks are now handled by the linter
2013-11-12 19:35:55 +01:00
Alex Crichton
5fdbcc4020 Improve error message for breaks in blocks
Before it was always stated that it was a "break outside of a loop" when you
could very well be in a loop, but just in a block instead.

Closes #3064
2013-11-12 09:40:21 -08:00
bors
2ee72ba5c6 auto merge of #10439 : brson/rust/rmcxx, r=bstrie 2013-11-12 08:01:20 -08:00
Brian Anderson
6b6f89b0ec rt: Delete more C++ 2013-11-12 06:05:03 -08:00
bors
11b07847e6 auto merge of #10435 : jayanderson/rust/docs, r=huonw
This fills in some missing docs in the nums package. Let me know if this is on the right track for what's wanted for docs. I can probably fill in more in the future. Thanks.

(As a side note the precedence of the unary negative operator '-' tripped me up for a bit. Essentially I would expect `-25.0f32.sqrt()` to result in NaN instead of `-5.0`.)
2013-11-12 02:31:15 -08:00
bors
34035036e3 auto merge of #10198 : alexcrichton/rust/darwin-quiet, r=jdm
Instead of running dsymutil for all builds, this changes it to only run the program for debug builds.

Closes #3495
2013-11-11 22:56:07 -08:00
bors
4320a0caff auto merge of #10425 : astrieanna/rust/rm-issue-912, r=brson
According to rust's issue #912, this will not be fixed. There's no point in keeping the test if it is never intended to pass.
2013-11-11 20:46:11 -08:00
Alex Crichton
49ee49296b Move std::rt::io to std::io 2013-11-11 20:44:07 -08:00
Jay Anderson
8a4be8080b Use constants instead of raw values. 2013-11-11 20:52:42 -07:00
bors
8b4683d79d auto merge of #10424 : alexcrichton/rust/optimize-buffered, r=brson
I was benchmarking rust-http recently, and I saw that 50% of its time was spent
creating buffered readers/writers. Albeit rust-http wasn't using
std::rt::io::buffered, but the same idea applies here. It's much cheaper to
malloc a large region and not initialize it than to set it all to 0. Buffered
readers/writers never use uninitialized data, and their internal buffers are
encapsulated, so any usage of uninitialized slots are an implementation bug in
the readers/writers.
2013-11-11 19:31:14 -08:00
bors
86787f8bef auto merge of #10109 : pcmattman/rust/pass-nonzero-exit-status-on-termination-by-signal, r=alexcrichton
The UvProcess exit callback is called with a zero exit status and non-zero termination signal when a child is terminated by a signal.

If a parent checks only the exit status (for example, only checks the return value from `wait()`), it may believe the process completed successfully when it actually failed.

Helpers for common use-cases are in `std::rt::io::process`.

Should resolve https://github.com/mozilla/rust/issues/10062.
2013-11-11 18:11:17 -08:00
Jay Anderson
deefb1f4b7 Got directions backwards in to_degrees and to_radians docs. 2013-11-11 18:56:48 -07:00
Jay Anderson
6c02e81c70 Add docs for traits Exponential, Hyperbolic, BitCount. 2013-11-11 18:49:48 -07:00
Jay Anderson
f4bedded8b Update docs for Fractional, Algebraic, Round, and Trigonometric traits. 2013-11-11 18:49:48 -07:00
Matthew Iselin
f698decf37 Implemented a ProcessExit enum and helper methods to std::rt::io::process for getting process termination status, or the signal that terminated a process.
A test has been added to rtio-processes.rs to ensure signal termination is picked up correctly.
2013-11-12 11:37:14 +10:00
bors
c0b7972f7d auto merge of #10422 : alexcrichton/rust/explicit-crate-map, r=pcwalton
As we start to move runtime components into the crate map, it's becoming harder
and harder to start the runtime from a C function as rust is embedded in another
application. Right now if you compile a rust crate as a dynamic library which is
then linked to another application, when using std::rt::start there are no I/O
local services, even though rustuv was linked against and requested. The reason
for this is that there is no top level crate map available specifying where to
find libuv I/O.

This option is not meant to be used regularly, but rather whenever compiling a
final library crate and linking it into another application. This lifts the
requirement that to get a crate map you must have the final destination be an
executable.
2013-11-11 16:11:22 -08:00
bors
88e383ef1e auto merge of #10419 : brson/rust/conditiondocs, r=alexcrichton
Fixes #8553 by just not mentioning TLS, and instead just referring to the 'task-local condition handler'.
2013-11-11 13:16:24 -08:00
bors
23746ae990 auto merge of #10403 : poiru/rust/issue-2675, r=alexcrichton
Closes #2675.
2013-11-11 12:06:25 -08:00
Alex Crichton
0cc5e6c83f Remove resolve's xray infrastructure
Since the removal of privacy from resolve, this flag is no longer necessary to
get the test runner working. All of the privacy checks are bypassed by a special
item attribute in the privacy visitor.

Closes #4947
2013-11-11 11:26:31 -08:00
Leah Hanson
a5b6d8d7c2 Remove test issue-3461
According to issue #3461, it doesn't sound like this is planned to be fixed.
2013-11-11 13:25:07 -06:00
Birunthan Mohanathas
36afd60609 Add asserts to check for faililng QueryPerformance* calls in precise_time_ns
Closes #2675.
2013-11-11 21:21:51 +02:00