Commit Graph

27167 Commits

Author SHA1 Message Date
Ted Horst
0bdd31cc61 change FVN hash function to the FVN-1a variant 2014-03-07 01:25:25 -06:00
Liigo Zhuang
1c86179dba Explicitly write down 0.1 release date in RELEASES.txt, to confirm Rust's birthday. 2014-03-07 15:08:42 +08:00
Huon Wilson
ba05ca6962 std: stop vec!() warning about unused mutability.
If no arguments are given to `vec!` then no pushes are emitted and
so the compiler (rightly) complains that the mutability of `temp` is
never used.

This behaviour is rather annoying for users.
2014-03-07 18:07:25 +11:00
bors
28e7631d8b auto merge of #12746 : alexcrichton/rust/issue-12743, r=brson
The arguments were accidentally swapped in the wrong order.

Closes #12743
2014-03-06 19:31:37 -08:00
bors
5862c0c28b auto merge of #12635 : alexcrichton/rust/speedy-hash, r=brson
This leverages the new hashing framework and hashmap implementation to provide a
much speedier hashing algorithm for node ids and def ids. The hash algorithm
used is currentl FNV hashing, but it's quite easy to swap out.

I originally implemented hashing as the identity function, but this actually
ended up in slowing down rustc compiling libstd from 8s to 13s. I would suspect
that this is a result of a large number of collisions.

With FNV hashing, we get these timings (compiling with --no-trans, in seconds):

|           |  before  |  after  |
|-----------|---------:|--------:|
| libstd    |   8.324  |  6.703  |
| stdtest   |  47.674  | 46.857  |
| libsyntax |   9.918  |  8.400  |
2014-03-06 18:16:39 -08:00
Alex Crichton
0a84132928 syntax: Conditionally deriving(Hash) with Writers
If #[feature(default_type_parameters)] is enabled for a crate, then
deriving(Hash) will expand with Hash<W: Writer> instead of Hash<SipState> so
more hash algorithms can be used.
2014-03-06 18:11:02 -08:00
Alex Crichton
42389b7069 collections: Correct with_capacity_and_hasher
The arguments were accidentally swapped in the wrong order.

Closes #12743
2014-03-06 18:07:52 -08:00
Alex Crichton
bec7b766fb rustc: Move to FNV hashing for node/def ids
This leverages the new hashing framework and hashmap implementation to provide a
much speedier hashing algorithm for node ids and def ids. The hash algorithm
used is currentl FNV hashing, but it's quite easy to swap out.

I originally implemented hashing as the identity function, but this actually
ended up in slowing down rustc compiling libstd from 8s to 13s. I would suspect
that this is a result of a large number of collisions.

With FNV hashing, we get these timings (compiling with --no-trans, in seconds):

|           |  before  |  after  |
|-----------|---------:|--------:|
| libstd    |   8.324  |  6.703  |
| stdtest   |  47.674  | 46.857  |
| libsyntax |   9.918  |  8.400  |
2014-03-06 17:45:48 -08:00
bors
0e95b086db auto merge of #12738 : alexcrichton/rust/needstest, r=brson,just
Closes #6738
Closes #7061
Closes #7899
Closes #9719
Closes #10028
Closes #10228
Closes #10401
Closes #11192
Closes #11508
Closes #11529
Closes #11873
Closes #11925
2014-03-06 15:11:42 -08:00
bors
bd47f679fa auto merge of #12737 : alexcrichton/rust/issue-12736, r=brson
Turns out sundown has already escaped this content for us, so there's no need
for us to escape it again.

Closes #12736
2014-03-06 13:56:41 -08:00
bors
987de29865 auto merge of #12732 : klutzy/rust/this-is-windows, r=alexcrichton
On Windows, `LLVMRustGetLastError()` may return non-utf8 mojibake string
if system uses non-English locale. It caused ICE when llvm fails.
This patch doesn't fix the real problem, but just make rustc not die.
2014-03-06 12:37:01 -08:00
Alex Crichton
13e10f5b7e test: Add some tests for closed issues
Closes #6738
Closes #7061
Closes #7899
Closes #9719
Closes #10028
Closes #10228
Closes #10401
Closes #11192
Closes #11508
Closes #11529
Closes #11873
Closes #11925
2014-03-06 10:45:08 -08:00
bors
1eb3f63d9d auto merge of #12720 : iliekturtles/rust/master, r=alexcrichton 2014-03-06 10:36:50 -08:00
Alex Crichton
9f6bcedb67 rustdoc: Don't escape contents of headers
Turns out sundown has already escaped this content for us, so there's no need
for us to escape it again.

Closes #12736
2014-03-06 09:34:04 -08:00
Mike Boutin
19ae05fa64 Added missing possessive apostrophe. 2014-03-06 12:27:31 -05:00
klutzy
f6afd40fc1 rustc: Get LLVM error message safely
On Windows, `LLVMRustGetLastError()` may return non-utf8 mojibake string
if system uses non-English locale. It caused ICE when llvm fails.
This patch doesn't fix the real problem, but just make rustc not die.
2014-03-07 00:18:32 +09:00
bors
fb80b384f4 auto merge of #12727 : lifthrasiir/rust/buffalo-buffalo, r=huonw
Cosmetic changes at best, but there are so many such typos that I couldn't ignore them. :) Some occurrences of typos are linked to the generated documentations but no changes should break the builds.
2014-03-06 06:51:35 -08:00
bors
0a7b06e955 auto merge of #12726 : alexcrichton/rust/travis, r=brson
This version is slightly more up to date and is closer to the 3.5 that we're
using. This also updates the travis config to have a build matrix which tests
rust against LLVM 3.3 and 3.4. For pull requests only LLVM 3.4 is tested to
reduce the load on travis.

This is mostly just fluff, there's no real reason to gate rust on these results,
it's more of just a nice thing to know when we break compatibility with LLVM 3.3
and 3.4 (and eventually 3.5). This turns off notifications of failed commits
(which are sent out for pushes to master).
2014-03-06 05:06:39 -08:00
Kang Seonghoon
1c52c81846 fix typos with with repeated words, just like this sentence. 2014-03-06 20:19:14 +09:00
bors
68903f2cdf auto merge of #12719 : alexcrichton/rust/fix-llvm-33, r=brson
The llvm.copysign and llvm.round intrinsics weren't added until LLVM 3.4, so if
we're on LLVM 3.3 we lower these to calls in libm instead of LLVM intrinsics.

This should fix our travis failures.
2014-03-06 03:11:39 -08:00
bors
14c620719c auto merge of #12714 : michaelwoerister/rust/limited-debuginfo, r=alexcrichton
This PR brings back limited debuginfo which allows for nice backtraces and breakpoints, but omits any info about variables and types.

The `-g` and `--debuginfo` command line options have been extended to take an optional argument:
`-g0` means no debug info.
`-g1` means line-tables only.
`-g2` means full debug info.

Specifying `-g` without argument is equivalent to `-g2`.

Fixes #12280
2014-03-06 01:56:43 -08:00
bors
2fba2fea12 auto merge of #12705 : alexcrichton/rust/issue-12692, r=brson
Details are in the commit messages, but this closes a few issues seen with `libnative` recently.
2014-03-06 00:41:48 -08:00
Alex Crichton
37b3a60b78 travis: Use LLVM 3.4 instead of LLVM 3.3
This version is slightly more up to date and is closer to the 3.5 that we're
using. This also updates the travis config to have a build matrix which tests
rust against LLVM 3.3 and 3.4. For pull requests only LLVM 3.4 is tested to
reduce the load on travis.

This is mostly just fluff, there's no real reason to gate rust on these results,
it's more of just a nice thing to know when we break compatibility with LLVM 3.3
and 3.4 (and eventually 3.5). This turns off notifications of failed commits
(which are sent out for pushes to master).
2014-03-06 00:25:19 -08:00
bors
2153293ae4 auto merge of #12687 : alexcrichton/rust/issue-12681, r=huonw
This commit adds a appear-on-over link to all section headers to generated
documentation. Each header also receives an id now, even those generated through
markdown. The purpose of this is to provide easy to link to sections.

This modifies the default header markdown generation because the default id
added looks like "toc_NN" which is difficult to reconcile among all sections (by
default each section gets a "toc_0" id), and it's also not very descriptive of
where you're going.

This chooses to adopt the github-style anchors by taking the contents of the
title and hyphen-separating them (after lower casing).

Closes #12681
2014-03-05 23:26:40 -08:00
Michael Woerister
a5b4d94e3d debuginfo: Add test case for limited debuginfo 2014-03-06 07:59:47 +01:00
Michael Woerister
e15fd400ba debuginfo: Expose limited debuginfo in command line options 2014-03-06 07:59:37 +01:00
Michael Woerister
1938e87393 debuginfo: Re-introduce the notion of line-table-only debuginfo. 2014-03-06 07:57:18 +01:00
Alex Crichton
31e7e676e1 rustdoc: Add anchors to section headers
This commit adds a appear-on-over link to all section headers to generated
documentation. Each header also receives an id now, even those generated through
markdown. The purpose of this is to provide easy to link to sections.

This modifies the default header markdown generation because the default id
added looks like "toc_NN" which is difficult to reconcile among all sections (by
default each section gets a "toc_0" id), and it's also not very descriptive of
where you're going.

This chooses to adopt the github-style anchors by taking the contents of the
title and hyphen-separating them (after lower casing).

Closes #12681
2014-03-05 22:51:56 -08:00
bors
253dbcb8c0 auto merge of #12703 : jld/rust/issue-8506, r=alexcrichton
Closes #8506.
2014-03-05 22:11:42 -08:00
Alex Crichton
9668ab58f3 std: Move libnative task count bookkeeping to std
When using tasks in Rust, the expectation is that the runtime does not exit
before all tasks have exited. This is enforced in libgreen through the
`SchedPool` type, and it is enforced in libnative through a `bookkeeping` module
and a global count/mutex pair. Unfortunately, this means that a process which
originates with libgreen will not wait for spawned native tasks.

In order to fix this problem, the bookkeeping module was moved from libnative to
libstd so the runtime itself can wait for native tasks to exit. Green tasks do
not manage themselves through this bookkeeping module, but native tasks will
continue to manage themselves through this module.

Closes #12684
2014-03-05 21:48:08 -08:00
Jed Davis
d90830221e Fix ICE on statics with fancy nullable enums.
Closes #8506.

The `trans::adt` code for statics uses fields with `C_undef` values to
insert alignment padding (because LLVM's own alignment padding isn't
always sufficient for aggregate constants), and assumes that all fields
in the actual Rust value are represented by non-undef LLVM values, to
distinguish them from that padding.

But for nullable pointer enums, if non-null variant has fields other
than the pointer used as the discriminant, they would be set to undef in
the null case, to reflect that they're never accessed.

To avoid the obvious conflict between these two items, the latter undefs
were wrapped in unary LLVM structs to distinguish them from the former
undefs.  Except this doesn't actually work -- LLVM, not unreasonably,
treats the "wrapped undef" as a regular undef.

So this commit just sets all fields to null in the null pointer case of
a nullable pointer enum static, because the other fields don't really
need to be undef in the first place.
2014-03-05 21:23:33 -08:00
Alex Crichton
9396452592 rustc: Fix support for LLVM 3.3
The llvm.copysign and llvm.round intrinsics weren't added until LLVM 3.4, so if
we're on LLVM 3.3 we lower these to calls in libm instead of LLVM intrinsics.

This should fix our travis failures.
2014-03-05 18:05:05 -08:00
bors
67c5d793ad auto merge of #12718 : thestinger/rust/min_max, r=alexcrichton 2014-03-05 16:21:43 -08:00
Daniel Micay
a871068b47 stats: fix handling of NaN in min and max
The `cmp::min` and `cmp::max` functions are not correct with partially
ordered values. #12712
2014-03-05 19:20:06 -05:00
Daniel Micay
5973b0c4ad add tests for min and max from Float 2014-03-05 19:20:03 -05:00
bors
ff22e47c19 auto merge of #12715 : dmski/rust/no-extern-fn-pat, r=alexcrichton
Fixes #10877

There was another PR which attempted to fix this in the parser (#11804) and which was closed due to inactivity.
This PR modifies typeck instead (as suggested in #11804), which indeed seems to be simpler than modifying the parser and allows for a better error message.
2014-03-05 12:51:48 -08:00
Dmitry Promsky
53f3442ef7 Disallowed patterns in extern fn declarations.
Closes #10877
2014-03-06 00:01:16 +04:00
bors
8a55cd988f auto merge of #12711 : edwardw/rust/mtwt, r=pcwalton
- Moves mtwt hygiene code into its own file
- Fixes FIXME's which leads to ~2x speed gain in expansion pass
- It is now @-free
2014-03-05 11:11:42 -08:00
bors
db4f757367 auto merge of #12709 : aepsil0n/rust/update_man_version, r=alexcrichton
Just realized that these were quite outdated and quickly fixed it. I have to admit that I did not run the test suite on this one though…
2014-03-05 09:56:44 -08:00
Alex Crichton
e6acff8287 native: Fix usage of a deallocated mutex
When the timer_helper thread exited, it would attempt to re-acquire the global
task count mutex, but the mutex had previously been deallocated, leading to
undefined behavior of the mutex, and in some cases deadlock.

Another mutex is used to coordinate shutting down the timer helper thread.

Closes #12699
2014-03-05 09:11:11 -08:00
Alex Crichton
d8bd8de82e native: Move from usleep() to nanosleep()
Using nanosleep() allows us to gracefully recover from EINTR because on error it
fills in the second parameter with the remaining time to sleep.

Closes #12689
2014-03-05 09:11:10 -08:00
Alex Crichton
8334dd445f native: Stop using readdir()
This function is not threadsafe, and is deprecated in favor of the threadsafe
readdir_r variant.

Closes #12692
2014-03-05 09:11:10 -08:00
bors
a7da925b02 auto merge of #12700 : thestinger/rust/float, r=cmr 2014-03-05 08:38:10 -08:00
Daniel Micay
28d4f80836 consistently use LLVM floating point intrinsics 2014-03-05 11:21:00 -05:00
Daniel Micay
2760974ec0 add correct floating point min and max methods.
The `std::cmp` functions are not correct for floating point types.

`min(NaN, 2.0)` and `min(2.0, NaN)` return different values, because
these functions assume a total order. Floating point types need special
`min`, `max` and `clamp` functions.
2014-03-05 11:20:50 -05:00
Edward Wang
2302ce903d Refactor and fix FIXME's in mtwt hygiene code
- Moves mtwt hygiene code into its own file
- Fixes FIXME's which leads to ~2x speed gain in expansion pass
- It is now @-free
2014-03-05 22:45:51 +08:00
bors
ea71a08f6b auto merge of #12708 : SimonSapin/rust/patch-6, r=huonw
Feel free to reject this if I’m mistaken, but the `count` in the for loop does look like it’s going from 0 to `end`.
2014-03-05 02:51:45 -08:00
Eduard Bopp
a27501112a Update version and date info in man pages
Both for rustc and rustdoc the man pages contained out-of-date version info.
2014-03-05 11:22:58 +01:00
Simon Sapin
c92cdad3dd Str::slice_chars() is O(end), not O(end - begin) 2014-03-05 09:41:35 +00:00
bors
87a31f6f0f auto merge of #12491 : eddyb/rust/deref, r=nikomatsakis
Add the `Deref` and `DerefMut` traits and implement overloading explicit dereferences.
2014-03-04 23:21:42 -08:00