Commit Graph

25640 Commits

Author SHA1 Message Date
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
Kiet Tran
576a85105f Mark provided methods in dead-code pass 2013-12-31 16:19:57 -05: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
Julia Evans
f0322371dd Add testing tutorial to docs 2013-12-31 10:34:55 -05: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
Simon Sapin
80d0f60d29 Add .insert() and .insert_char() methods to ~str. 2013-12-31 11:20:40 +01: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
Steven Fackler
b74613bdc4 Rewrite SyntaxEnv
I'd really like to be able to do something like

struct MapChain<'next, K, V> {
    info: BlockInfo,
    map: HashMap<K, V>,
    next: Option<&'next mut MapChain<'next, K, V>
}

but I can't get the lifetimes to work out.
2013-12-30 17:50:05 -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
Vadim Chugunov
856222987d Revert "Embed Windows application manifest." 2013-12-30 13:22:54 -08:00
g3xzh
9f1adf07ad Add more benchmark tests to path/posix
Benchmark testing `is_ancestor_of` and `path_relative_from`
2013-12-30 22:59:48 +02:00
bors
1502b1197b auto merge of #11199 : alexcrichton/rust/windows-isnt-waiting, r=pcwalton
Turns out with an argument of 0 the function always returns immediately!

Closes #11003
2013-12-30 09:51:49 -08:00
bors
f7fd61876a auto merge of #11194 : kballard/rust/gitignore-doc-green-native, r=alexcrichton 2013-12-30 08:36:48 -08:00
Alex Crichton
fe30087080 Add metadata from a tempdir instead of a build dir
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-30 08:21:41 -08:00
Volker Mische
e0a6910f70 Implement Ratio:from_float()
The Ratio::from_float() converts a float (f32 and f64) into a
Ratio<BigInt>.

Closes #9838
2013-12-30 16:55:13 +01:00
bors
6db7e35c59 auto merge of #11190 : eliovir/rust/patch-3, r=alexcrichton
#[ author = "Jane Doe" ]; raises "warning: unknown crate attribute"
replace `pkgid` by `crate_id`
add `comment`
2013-12-30 07:16:48 -08:00
bors
a4f30bf0c0 auto merge of #11185 : huonw/rust/doc-ignore, r=cmr
Currently any line starting with `#` is filtered from the output,
including line like `#[deriving]`; this patch makes it so lines are only
filtered when followed by a space similar to the current behaviour of
the tutorial/manual tester.
2013-12-30 05:51:51 -08:00
bors
f37b746699 auto merge of #11182 : luisbg/rust/crateid, r=cmr
Issue #11048
2013-12-30 04:32:09 -08:00
bors
ac0c376c36 auto merge of #11169 : alexcrichton/rust/snapshots, r=sanxiyn
Hurray trait coercion!
2013-12-30 03:11:56 -08:00
bors
28a091fc7c auto merge of #10885 : kballard/rust/as_mut_slice, r=cmr
This method is primarily intended to allow for converting a [T, ..N] to
a &mut [T].
2013-12-30 01:41:55 -08:00
bors
adc5eefa23 auto merge of #11168 : sfackler/rust/de-at-extctxt, r=alexcrichton
* Pass `&ExtCtxt` instead of `@ExtCtxt`.
* Stop passing duplicate parameters around in `expand`.
* Make `ast_fold` methods take `&mut self`.

After these, it should be possible to remove the `@mut` boxes from `ExtCtxt` altogether, though #11167 is doing some of that so I'm holding off on that for now. This will probably conflict with that PR, so I'm guessing that one will have to be rebased on top of the other.

r? @pcwalton
2013-12-30 00:11:55 -08:00
Steven Fackler
dc830345e8 Remove @muts from ExtCtxt 2013-12-29 23:41:09 -08:00
Steven Fackler
8143662836 Start passing around &mut ExtCtxt 2013-12-29 23:41:09 -08:00
Steven Fackler
3965dddf49 Make ast_fold take &mut self 2013-12-29 23:41:05 -08:00
Huon Wilson
dedc29f128 rustdoc: Unify the handling of the hidden example lines. 2013-12-30 16:55:49 +11:00
Huon Wilson
582ad8ffc2 rustdoc: only filter lines starting with '# ' from the shown code.
Currently any line starting with `#` is filtered from the output,
including line like `#[deriving]`; this patch makes it so lines are only
filtered when followed by a space similar to the current behaviour of
the tutorial/manual tester.
2013-12-30 16:55:49 +11:00