Commit Graph

28390 Commits

Author SHA1 Message Date
bors
30348f4675 auto merge of #13647 : alexcrichton/rust/issue-13641, r=pcwalton
This gives a better NOTE error message when a privacy error is encountered with
a static method. Previously no note was emitted (due to lack of support), but
now a note is emitted indicating that the struct/enum itself is private.

Closes #13641
2014-04-20 16:26:26 -07:00
bors
97dd726200 auto merge of #13639 : alexcrichton/rust/rustdoc-tuple-fields, r=sfackler
The fields of tuple structs recently gained the ability to have privacy
associated with them, but rustdoc was not updated accodingly. This moves the
struct field filtering to the rendering phase in order to preserve the ordering
of struct fields to allow tuple structs to have their private fields printed as
underscores.

Closes #13594
2014-04-20 15:06:29 -07:00
bors
02081e7c41 auto merge of #13636 : nick29581/rust/ty_vec, r=pcwalton
Refactors all uses of ty_vec and associated things to remove the vstore abstraction (still used for strings, for now). Pointers to vectors are stored as ty_rptr or ty_uniq wrapped around a ty_vec. There are no user-facing changes. Existing behaviour is preserved by special-casing many instances of pointers containing vectors. Hopefully with DST most of these hacks will go away. For now it is useful to leave them hanging around rather than abstracting them into a method or something.

Closes #13554.
2014-04-20 13:46:30 -07:00
Alex Crichton
9d546d60c1 rustdoc: Display tuple structs correctly
The fields of tuple structs recently gained the ability to have privacy
associated with them, but rustdoc was not updated accodingly. This moves the
struct field filtering to the rendering phase in order to preserve the ordering
of struct fields to allow tuple structs to have their private fields printed as
underscores.

Closes #13594
2014-04-20 12:38:44 -07:00
Alex Crichton
c33cedf359 rustc: Improve errors on private static methods
This gives a better NOTE error message when a privacy error is encountered with
a static method. Previously no note was emitted (due to lack of support), but
now a note is emitted indicating that the struct/enum itself is private.

Closes #13641
2014-04-20 12:10:46 -07:00
bors
50671dc626 auto merge of #13410 : alexcrichton/rust/issue-12278, r=pcwalton
This commit removes the compiler support for floating point modulus operations,
as well as from the language. An implementation for this operator is now
required to be provided by libraries.

Floating point modulus is rarely used, doesn't exist in C, and is always lowered
to an fmod library call by LLVM, and LLVM is considering removing support
entirely.

Closes #12278
2014-04-20 11:41:29 -07:00
bors
4d496933dc auto merge of #13643 : aochagavia/rust/pr-2, r=alexcrichton
Fixed a typo in the documentation of std::mem, and refactored a function to use match instead of if.

Also added a FIXME to the benchmarks at the end of the file stating that they should be moved to another place, because they have nothing to do with `mem` (see https://github.com/mozilla/rust/issues/13642)
2014-04-20 10:21:32 -07:00
Erick Tryzelaar
2df7601033 rustc: feature gates errors should use the new attribute syntax 2014-04-20 07:33:04 -07:00
Adrien Tétar
c494a06064 doc: unifying with rustdoc
Conflicts:
	src/doc/rust.md
2014-04-20 21:11:44 +09:00
Adolfo Ochagavía
49ff21ed87 Added run_flags directive to compiletest
Now it is possible to specify run-flags in tests. For example, by using `run-flags: --bench` the Bencher is run.
2014-04-20 12:54:34 +02:00
aochagavia
e36adee3ae Minor changes in std::mem
Fixed a typo in the documentation of std::mem, and refactored a function to use match instead of if.

Also added a FIXME to the benchmarks at the end of the file stating that they should be moved to another place, because they have nothing to do with `mem` (see https://github.com/mozilla/rust/issues/13642)
2014-04-20 12:46:21 +02:00
bors
a27dc534e4 auto merge of #13640 : jbcrail/rust/spelling-updates, r=alexcrichton 2014-04-20 03:06:29 -07:00
bors
9b5b21951b auto merge of #13635 : richo/rust/no-output-from-serialize, r=sfackler
As an aside, it seems like a lint for libraries calling println! might be a useful thing?
2014-04-20 01:51:31 -07:00
bors
412a18f12e auto merge of #13633 : TeXitoi/rust/shootout-fannkuch-redux-rewrite, r=alexcrichton
Less bound checking and parallelisation.  Brute speed improvement
is about 15% faster.

The unsafe block improve the brute speed by about 5%.
2014-04-20 00:31:34 -07:00
Joseph Crail
ae555e3830 Fix spelling mistakes in documentation and code. 2014-04-20 01:35:14 -04:00
bors
fc2815a5cc auto merge of #12562 : nick29581/rust/fields, r=nikomatsakis
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-19 22:26:32 -07:00
Alex Crichton
5bfb260cf8 rustuv: Fix a tcp connect timeout bug on windows
When a uv_tcp_t is closed in libuv, it will still invoke the pending connect_cb,
and I thought that it would always call it with ECANCELED, but it turns out that
sometimes we'll get a different error code instead. Handle this case by checking
to see if the request's data is NULL and bail out if so (the timeout expired).
2014-04-19 21:39:30 -07:00
Nick Cameron
ff04aa8e38 Allow inheritance between structs.
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-20 13:41:18 +12:00
Guillaume Pinot
57d693460b shootout-fannkuch-redux rewrite
Less bound checking and parallelisation.  Brute speed improvement
is about 15% faster.
2014-04-20 03:16:58 +02:00
Richo Healey
d46c737d3b serialize: Remove errant println!'s from decode 2014-04-19 17:59:04 -07:00
Nick Cameron
37306c1d25 Refactor ty_vec represent &[T] as &([T])
Refactores all uses of ty_vec and associated things to remove the vstore abstraction (still used for strings, for now). Pointers to vectors are stored as ty_rptr or ty_uniq wrapped around a ty_vec. There are no user-facing changes. Existing behaviour is preserved by special-casing many instances of pointers containing vectors. Hopefully with DST most of these hacks will go away. For now it is useful to leave them hanging around rather than abstracting them into a method or something.

Closes #13554.
2014-04-20 12:41:53 +12:00
Yuri Kunde Schlesner
9faef77b23 Eliminate the need for Options in LruEntry.
LruEntry nodes previously used Option to encapsulate the key and value
fields. This was used merely as a way avoid having values for the sigil
node. Apart from wasting a few bytes for the discriminant, this
cluttered the rest of the code, since these fields always contained
Some on regular nodes as a class invariant.

The Option wrapping was removed, and the values in the sigil field are
initialized using mem::init, so that they don't contain any real data.
2014-04-19 21:12:02 -03:00
bors
7b6e7ebe73 auto merge of #13613 : alexcrichton/rust/fix-freebsd-compile, r=brson
Ah, the wonders of not being gated on FreeBSD...
2014-04-19 15:31:28 -07:00
bors
3757f01c9b auto merge of #13610 : jsanders/rust/sender-try-send-docs, r=alexcrichton
I was getting a bit confused by these and (I think) managed to track it down to fallout from #13448 and #13465.
2014-04-19 14:11:28 -07:00
Alex Crichton
80bd176432 mk: Pass exact compile to rustc on cross compiles
Instead of passing through CC which may have things like ccache and other
arguments (when using clang) this commit filters out the necessary arguments
from CC to pass the right linker to rustc.

Closes #13562
2014-04-19 13:18:25 -07:00
Alex Crichton
97c91c9713 green: Fix missing Send bounds on procedures
These were mistakenly not updated as part of the removal of the Send bound by
default on procedures.

cc #13629
2014-04-19 12:35:56 -07:00
bors
3db2b6933d auto merge of #13628 : alexcrichton/rust/issue-13625, r=thestinger
In upgrading LLVM, only rust functions had the "split-stack" attribute added.
This commit changes the addition of LLVM's "split-stack" attribute to *always*
occur and then we remove it sometimes if the "no_split_stack" rust attribute is
present.

Closes #13625
2014-04-19 10:56:25 -07:00
Alex Crichton
50fb57bb10 rustc: Ensure closures are "split-stack"
In upgrading LLVM, only rust functions had the "split-stack" attribute added.
This commit changes the addition of LLVM's "split-stack" attribute to *always*
occur and then we remove it sometimes if the "no_split_stack" rust attribute is
present.

Closes #13625
2014-04-19 10:33:46 -07:00
James Sanders
29c291bb1b Rewrite paragraph describing difference between try_send and send_opt 2014-04-19 10:23:15 -06:00
bors
ba25fecfef auto merge of #13615 : alexcrichton/rust/improve-demangling, r=brson
Previously, symbols with rust escape sequences (denoted with dollar signs)
weren't demangled if the escape sequence showed up in the middle. This alters
the printing loop to look through the entire string for dollar characters.
2014-04-19 05:41:26 -07:00
Adrien Tétar
fb9ea2eaca doc: add webfonts and tweak the styles accordingly 2014-04-19 21:25:35 +09:00
bors
2c22ae4378 auto merge of #13614 : cgaebel/rust/master, r=brson
We previously allocated 3x for every HashMap creation and resize. This patch reduces it to 1x.
2014-04-19 04:26:28 -07:00
bors
c7553ea173 auto merge of #13609 : richo/rust/str-type-vim, r=alexcrichton
It seems really weird to me when StrSlice and str highlight sanely, but StrBuf doesn't.

I think I added it to the right place.
2014-04-19 02:11:30 -07:00
bors
158e0c86fe auto merge of #13604 : alexcrichton/rust/connect-timeout, r=brson
This adds a `TcpStream::connect_timeout` function in order to assist opening
connections with a timeout (cc #13523). There isn't really much design space for
this specific operation (unlike timing out normal blocking reads/writes), so I
am fairly confident that this is the correct interface for this function.

The function is marked #[experimental] because it takes a u64 timeout argument,
and the u64 type is likely to change in the future.
2014-04-19 00:56:30 -07:00
Alex Crichton
3915e17cd7 std: Add an experimental connect_timeout function
This adds a `TcpStream::connect_timeout` function in order to assist opening
connections with a timeout (cc #13523). There isn't really much design space for
this specific operation (unlike timing out normal blocking reads/writes), so I
am fairly confident that this is the correct interface for this function.

The function is marked #[experimental] because it takes a u64 timeout argument,
and the u64 type is likely to change in the future.
2014-04-19 00:47:14 -07:00
bors
5a2ecb828b auto merge of #13608 : tbu-/rust/pr_smallesthello, r=alexcrichton
It now hands `puts` a zero-terminated string, like it expects.

Fix #13603.
2014-04-18 23:36:33 -07:00
bors
9d5082e88a auto merge of #13606 : alexcrichton/rust/better-thread-errors, r=brson
On windows, correctly check for errors when spawning threads, and on both
windows and unix handle the error more gracefully rather than printing an opaque
assertion failure.

Closes #13589
2014-04-18 22:16:35 -07:00
bors
af24045ff0 auto merge of #13607 : brson/rust/to_owned, r=brson
Continues https://github.com/mozilla/rust/pull/13548
2014-04-18 18:46:33 -07:00
Brendan Zabarauskas
2d9dfc6479 Reorder Float methods in trait definition and make consistent in impls 2014-04-19 10:44:08 +10:00
Brendan Zabarauskas
42450ef022 Fix formatting in float implementations 2014-04-19 10:44:08 +10:00
Brendan Zabarauskas
bed70a42ec Have floating point functions take their parameters by value.
Make all of the methods in `std::num::Float` take `self` and their other parameters by value.

Some of the `Float` methods took their parameters by value, and others took them by reference. This standardises them to one convention. The `Float` trait is intended for the built in IEEE 754 numbers only so we don't have to worry about the trait serving types of larger sizes.

[breaking-change]
2014-04-19 10:44:08 +10:00
Brendan Zabarauskas
fe47202034 Merge the Round trait into the Float trait
Move the rounding functions into the `std::num::Float` trait and then remove `std::num::Round`.

This continues the flattening of the numeric traits tracked in #10387. The aim is to make `std::num` very simple and tied to the built in types, leaving the definition of more complex numeric towers to third-party libraries.

[breaking-change]
2014-04-19 10:41:45 +10:00
Alex Crichton
55310acbca std: Fix demangling with middle special chars
Previously, symbols with rust escape sequences (denoted with dollar signs)
weren't demangled if the escape sequence showed up in the middle. This alters
the printing loop to look through the entire string for dollar characters.
2014-04-18 17:37:27 -07:00
Richo Healey
919889a1d6 Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
Clark Gaebel
9f45484db5 Reduce HashMap allocations. 2014-04-18 20:15:41 -04:00
bors
9b7cfd3c72 auto merge of #13513 : alexcrichton/rust/up-llvm, r=brson
This is a bit of an interesting upgrade to LLVM. Upstream LLVM has started using C++11 features, so they require a C++11 compiler to build. I've updated all the bots to have a C++11 compiler, and they appear to be building LLVM successfully:

* Linux bots - I added gcc/g++ 4.7 (good enough)
* Android bots - same as the linux ones
* Mac bots - I installed the most recent command line tools for Lion which gives us clang 3.2, but LLVM wouldn't build unless it was explicitly asked to link to `libc++` instead of `libstdc++`. This involved tweaking `mklldeps.py` and the `configure` script to get things to work out
* Windows bots - mingw-w64 has gcc 4.8.1 which is sufficient for building LLVM (hurray!)
* BSD bots - I updated FreeBSD to 10.0 which brought with it a relevant version of clang.

The largest fallout I've seen so far is that the test suite doesn't work at all on FreeBSD 10. We've already stopped gating on FreeBSD due to #13427 (we used to be on freebsd 9), so I don't think this puts us in too bad of a situation. I will continue to attempt to fix FreeBSD and the breakage on there.

The LLVM update brings with it all of the recently upstreamed LLVM patches. We only have one local patch now which is just an optimization, and isn't required to use upstream LLVM. I want to maintain compatibility with LLVM 3.3 and 3.4 while we can, and this upgrade is keeping us up to date with the 3.5 release. Once 3.5 is release we will in theory no longer require a bundled LLVM.
2014-04-18 17:11:32 -07:00
Alex Crichton
79de910e1f std: Fix compiling on FreeBSD
Ah, the wonders of not being gated on FreeBSD...
2014-04-18 17:04:18 -07:00
Richo Healey
3ec9f05534 vim: Add StrBuf as type to hilighting 2014-04-18 16:57:03 -07:00
Alex Crichton
426d701f8b debuginfo: Clamp the maximum dwarf version to 3
This is a consequence of #13611 and our bots running a "fairly old" gdb which
doesn't understand the newer versions of dwarf.
2014-04-18 16:54:38 -07:00
James Sanders
fa64965d69 Fix a couple places in docs where try_send wasn't changed to send_opt 2014-04-18 17:40:34 -06:00