Commit Graph

25005 Commits

Author SHA1 Message Date
bors
a96951048c auto merge of #11245 : alexcrichton/rust/issue-11225, r=pcwalton
Commit messages are a little more descriptive.
2014-01-01 20:56:54 -08:00
bors
b3b49d9873 auto merge of #11184 : jhasse/rust/patch-col, r=huonw 2014-01-01 19:41:55 -08:00
Jan Niklas Hasse
86835c95f4 Test column offset for #11184 2014-01-02 03:34:07 +01:00
bors
647525545b auto merge of #11235 : am0d/rust/doc_update, r=brson
Running a rust program with `RUST_LOG=::help` no longer shows all the logging modules that are mentioned in the docs.  These should be removed from the docs as they no longer do anything.
2014-01-01 18:26:57 -08:00
bors
1b14a9393a auto merge of #11242 : Dretch/rust/hashmap-key-value-iterators, r=pcwalton 2014-01-01 17:11:57 -08:00
Jan Niklas Hasse
3d43543c21 Output columns 1-based. Fixes #10848 2014-01-02 02:07:21 +01:00
bors
48918fab72 auto merge of #11212 : alexcrichton/rust/local-task-count, r=brson
For libgreen, bookeeping should not be global but rather on a per-pool basis.
Inside libnative, it's known that there must be a global counter with a
mutex/cvar.

The benefit of taking this strategy is to remove this functionality from libstd
to allow fine-grained control of it through libnative/libgreen. Notably, helper
threads in libnative can manually decrement the global count so they don't count
towards the global count of threads. Also, the shutdown process of *all* sched
pools is now dependent on the number of tasks in the pool being 0 rather than
this only being a hardcoded solution for the initial sched pool in libgreen.

This involved adding a Local::try_take() method on the Local trait in order for
the channel wakeup to work inside of libgreen. The channel send was happening
from a SchedTask when there is no Task available in TLS, and now this is
possible to work (remote wakeups are always possible, just a little slower).
2014-01-01 13:21:48 -08:00
Alex Crichton
3f11f87382 Move task count bookeeping out of libstd
For libgreen, bookeeping should not be global but rather on a per-pool basis.
Inside libnative, it's known that there must be a global counter with a
mutex/cvar.

The benefit of taking this strategy is to remove this functionality from libstd
to allow fine-grained control of it through libnative/libgreen. Notably, helper
threads in libnative can manually decrement the global count so they don't count
towards the global count of threads. Also, the shutdown process of *all* sched
pools is now dependent on the number of tasks in the pool being 0 rather than
this only being a hardcoded solution for the initial sched pool in libgreen.

This involved adding a Local::try_take() method on the Local trait in order for
the channel wakeup to work inside of libgreen. The channel send was happening
from a SchedTask when there is no Task available in TLS, and now this is
possible to work (remote wakeups are always possible, just a little slower).
2014-01-01 13:08:09 -08:00
Alex Crichton
aca1749493 Don't leave lingering files in doc tests
Closes #11234
2014-01-01 13:06:44 -08:00
bors
c34ef5d7e4 auto merge of #11255 : klutzy/rust/small-cleanup, r=pcwalton
This patchset removes some `@`s and unnecessary traits,
and replaces a function (`dummy_sp()`) returning constant value
by static variable.
2014-01-01 11:06:51 -08:00
bors
51ace54597 auto merge of #11254 : huonw/rust/impl-names, r=brson
The resulting symbol names aren't very pretty at all:

    trait Trait { fn method(&self); }
    impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

    Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
`Trait$__extensions__::method:...`, which is what the symbol name used
to be for anything other than `impl Trait for foo::bar::Baz` (which
became, and still becomes, `Trait$Baz::method`).
2014-01-01 07:56:49 -08:00
Huon Wilson
8f26d0b9b8 syntax: expand impl_pretty_name to handle more cases.
The resulting symbol names aren't very pretty at all:

    trait Trait { fn method(&self); }
    impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} }

gives

    Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0

However, at least it contain some reference to the Self type, unlike
`Trait$__extensions__::method:...`, which is what the symbol name used
to be for anything other than `impl Trait for foo::bar::Baz` (which
became, and still becomes, `Trait$Baz::method`).
2014-01-02 02:53:54 +11:00
bors
2897549d51 auto merge of #11249 : brson/rust/no_rustdoc_ng, r=alexcrichton 2014-01-01 04:36:54 -08:00
bors
736f5a8ea8 auto merge of #11247 : eddyb/rust/symbol-cleanup, r=alexcrichton 2014-01-01 02:51:53 -08:00
klutzy
9cdad685a3 syntax::codemap: Add static DUMMY_SP
It replaces `dummy_sp()`.
2014-01-01 19:51:35 +09:00
klutzy
db204b20ab syntax::diagnostic: Remove @ from Emitter 2014-01-01 19:10:43 +09:00
klutzy
fe10c63326 syntax::diagnostic: Remove unnecessary traits
This removes trait `handler` and `span_handler`,
and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2014-01-01 19:10:43 +09:00
klutzy
a52cdfdfce rustc::driver: Remove two @s 2014-01-01 19:10:43 +09:00
bors
7fc4df366f auto merge of #11244 : johnwalker/rust/issue-11239, r=brson
forward-to-word is undefined, and so Emacs would throw errors in
rust-align-to-expr-after-brace. This change yields the expected
behavior discussed in issue #11239 by handling the case when
whitespace follows a left bracket.
2014-01-01 01:02:27 -08:00
bors
03b510297c auto merge of #11215 : alexcrichton/rust/metadata-filename, r=pcwalton
Right now if you have concurrent builds of two libraries in the same directory
(such as rustc's bootstrapping process), it's possible that two libraries will
stomp over each others' metadata, producing corrupt rlibs.

By placing the metadata file in a tempdir we're guranteed to not conflict with
ay other builds happening concurrently. Normally this isn't a problem because
output filenames are scoped to the name of the crate, but metadata is special in
that it has the same name across all crates.
2013-12-31 22:26:55 -08:00
bors
e61937a6bf auto merge of #11187 : alexcrichton/rust/once, r=brson
Rationale can be found in the first commit, but this is basically the same thing as `pthread_once`
2013-12-31 20:41:56 -08:00
Alex Crichton
c22fed9424 Convert relevant static mutexes to Once 2013-12-31 20:15:03 -08:00
bors
02cec05c55 auto merge of #11137 : g3xzh/rust/benchm, r=cmr
Benchmark testing `is_ancestor_of` and `pop`

ref: https://github.com/mozilla/rust/issues/9694
2013-12-31 18:32:19 -08:00
bors
09a561ac9c auto merge of #11186 : alexcrichton/rust/native-udp, r=brson
I personally do not have huge amounts of experience in this area, so there's likely a thing or two wrong around the edges. I tried to just copy what libuv is doing as closely as possible with a few tweaks in a few places, but all of the `std::io::net::udp` tests are now run in both native and green settings so the published functionality is all being tested.
2013-12-31 16:21:55 -08:00
Eduard Burtescu
4e752651f4 Truncate symbol hashes to 64 bits. 2014-01-01 01:42:24 +02:00
bors
1dcc986d52 auto merge of #11173 : whitequark/rust/master, r=thestinger
This PR adds `std::unsafe::intrinsics::{volatile_load,volatile_store}`, which map to LLVM's `load volatile` and `store volatile` operations correspondingly.

This would fix #11172.

I have addressed several uncertainties with this PR in the line comments.
2013-12-31 15:06:55 -08:00
Brian Anderson
14f59e8902 Remove references to rustdoc_ng 2013-12-31 14:50:38 -08:00
bors
bd52e6acc6 auto merge of #11157 : alexcrichton/rust/issue-11154, r=pcwalton
Closes #11154
2013-12-31 13:52:03 -08:00
Alex Crichton
0daaeab244 Conservatively export all trait methods and impls
The comments have more information as to why this is done, but the basic idea is
that finding an exported trait is actually a fairly difficult problem. The true
answer lies in whether a trait is ever referenced from another exported method,
and right now this kind of analysis doesn't exist, so the conservative answer of
"yes" is always returned to answer whether a trait is exported.

Closes #11224
Closes #11225
2013-12-31 12:42:13 -08:00
bors
8ec03b37c0 auto merge of #11155 : SiegeLord/rust/early_deps, r=pcwalton
The `--dep-info` command line option allows a nice way to generate make-style dependencies, but it currently does so alongside building of the output binary. This isn't a problem for make, as it mixes dependency graph generation and actual building, but it is problematic for other tools (e.g. CMake) which keep them separate.

To play more nicely with those tools, I've moved the --dep-info output from phase 6 (linking) up to after phase 2 (expansion of macros). Also, since there was no prior option to do so, I added a command line switch (`--no-analysis`) to stop compilation just before phase 3 (type-checking) which speeds this up even further.

Here's the beginning of a CMake function which is enabled by this change:

~~~cmake
function(get_rust_deps root_file out_var)
	execute_process(COMMAND rustc ${RUSTC_FLAGS} --no-analysis --dep-info "${CMAKE_BINARY_DIR}/.deps" "${root_file}")
	
	# Read and parse the dependency information
	file(READ "${CMAKE_BINARY_DIR}/.deps" crate_deps)
	file(REMOVE "${CMAKE_BINARY_DIR}/.deps")
	# parsing follows...
~~~
2013-12-31 12:37:17 -08:00
Gareth Smith
d435f4f059 Fix issue #11216 - Replace std::hashmap::{each_key, each_value} with iterators. 2013-12-31 20:29:39 +00:00
SiegeLord
cbe8c61fed Add a --no-analysis command line switch 2013-12-31 15:28:08 -05:00
SiegeLord
a7a9e488a4 Generate --dep-info earlier in the compillation. 2013-12-31 15:28:02 -05:00
Alex Crichton
870024a160 Disallow LTO with a preference to dynamic linking
Closes #11154
2013-12-31 11:48:47 -08:00
Alex Crichton
bba78a2a89 Implement native UDP I/O 2013-12-31 11:34:22 -08:00
John Louis Walker
8271ba8239 Fix rust-align-to-expr-after-brace, closes #11239.
forward-to-word is undefined, and so Emacs would throw errors in
rust-align-to-expr-after-brace. This change yields the expected
behavior discussed in the issue.
2013-12-31 14:19:36 -05:00
bors
5ff7b28373 auto merge of #11208 : alexcrichton/rust/less-c, r=cmr
Right now on linux, an empty executable with LTO still depends on librt becaues
of the clock_gettime function in rust_builtin.o, but this commit moves this
dependency into a rust function which is subject to elimination via LTO.

At the same time, this also drops libstd's dependency on librt on unices that
are not OSX because the library is only used by extra::time (and now the
dependency is listed in that module instead).
2013-12-31 09:51:50 -08:00
bors
250ca0eb85 auto merge of #11236 : huonw/rust/sort-rust-log-help, r=sanxiyn
Fixes #8949.
2013-12-31 08:36:52 -08:00
Huon Wilson
d255d4a4ff std: print RUST_LOG=::help in sorted order.
Fixes #8949.
2013-12-31 23:47:15 +11:00
a_m0d
7a8ca91e1d Update documentation to remove reference to ::rt logging 2013-12-31 07:25:53 -05:00
bors
d459e805df auto merge of #11142 : alan-andrade/rust/improve_opts_example, r=cmr
Ran into this in practice, fixing it to improve example correctness.
2013-12-30 23:11:49 -08:00
Alan Andrade
ff801d662e Fix tests 2013-12-31 00:51:11 -06:00
bors
b88138a3ec auto merge of #11231 : brson/rust/rust_fail, r=alexcrichton
Closes #11219
2013-12-30 20:46:49 -08:00
Alan Andrade
6bc278c8c6 Remove features from librustdoc 2013-12-30 22:37:44 -06:00
Alan Andrade
a60f12d84c Avoid compiler error about glob imports in getopts example 2013-12-30 22:37:43 -06:00
bors
a1d3cc5386 auto merge of #11221 : vadimcn/rust/revert-manifest, r=alexcrichton
In view of the problems outlined in #11207, I think manifest embedding should be removed, until we find a better solution.  :-(
2013-12-30 18:56:54 -08:00
Brian Anderson
705f472c55 Add rust_fail. #11219 2013-12-30 18:44:57 -08:00
Peter Zotov
f98f83a15d Implement volatile_load and volatile_store intrinsics. 2013-12-31 02:54:25 +04:00
Alex Crichton
726091fea5 Convert some C functions to rust functions
Right now on linux, an empty executable with LTO still depends on librt becaues
of the clock_gettime function in rust_builtin.o, but this commit moves this
dependency into a rust function which is subject to elimination via LTO.

At the same time, this also drops libstd's dependency on librt on unices that
are not OSX because the library is only used by extra::time (and now the
dependency is listed in that module instead).
2013-12-30 14:35:55 -08:00
bors
df25bb65eb auto merge of #11125 : vmx/rust/rational, r=huonw
The Ratio::rational() converts a float (f32 and f64) into a
Ratio<BigInt>.

Closes #9838
2013-12-30 14:31:57 -08:00