Commit Graph

46758 Commits

Author SHA1 Message Date
Wesley Wiser
ed77fcc8a6 Split out the bad_style lints into a new module
Part of #22206
2015-09-19 17:35:18 -04:00
bors
783c3fcc1e Auto merge of #28345 - japaric:op-assign, r=nmatsakis
Implements overload-able augmented/compound assignments, like `a += b` via the `AddAssign` trait, as specified in RFC [953]

[953]: https://github.com/rust-lang/rfcs/blob/master/text/0953-op-assign.md

r? @nikomatsakis
2015-09-19 21:19:29 +00:00
Amit Aryeh Levy
85f48d300a Make FixedSizeArray an unsafe trait 2015-09-19 15:33:34 -04:00
bors
837840c61f Auto merge of #28516 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #28400, #28430, #28443, #28483, #28485, #28496, #28511, #28515
- Failed merges:
2015-09-19 19:28:59 +00:00
William Throwe
a51ae514ab Move test to the right directory and make it pass
I assume the expected error changed during the development of pull
request #28321 and that wasn't noticed because the test was
accidentally not running.
2015-09-19 13:54:42 -04:00
bors
6db1a0ea7c Auto merge of #28497 - apasel422:issue-28493, r=Gankro
When both the key and value types were zero-sized, `BTreeMap` previously
called `heap::allocate` with `size == 0` for leaf nodes, which is
undefined behavior, and jemalloc would attempt to read invalid memory,
crashing the process.

This avoids undefined behavior by allocating enough space to store one
edge in leaf nodes that would otherwise have `size == 0`. Although this
uses extra memory, maps with zero-sized key types that have sensible
implementations of the ordering traits can only contain a single
key-value pair (and therefore only a single leaf node), and maps with
key and value types that are both zero-sized have few uses, if any.

Furthermore, this is a temporary fix that will likely be unnecessary
once the `BTreeMap` implementation is rewritten to use parent pointers.

Closes #28493.
2015-09-19 17:40:56 +00:00
critiqjo
a0f214e257 trpl: Improve clarity in Concurrency 2015-09-19 21:11:17 +05:30
Steve Klabnik
234f81c4a9 Rollup merge of #28515 - alex:patch-1, r=steveklabnik
Repertory is a real world, but it doesn't really make sense in that context.
2015-09-19 11:15:49 -04:00
Steve Klabnik
0622cf3ddd Rollup merge of #28511 - llogiq:printdoc, r=steveklabnik
This closes #28510.
2015-09-19 11:15:49 -04:00
Steve Klabnik
b2c7e7791a Rollup merge of #28496 - davidszotten:fix_error_anchors, r=steveklabnik 2015-09-19 11:15:48 -04:00
Steve Klabnik
d557f4a60f Rollup merge of #28485 - Wallacoloo:clarify-let-lhs, r=alexcrichton
In code like `let x = 5`, I am initially confused as to the meaning of "let doesn't take a name on the left hand side, it actually accepts a pattern." - I interpret that as the pattern being located as: `<pattern> let [...]`.

I think what is meant is that the name/pattern is on the left hand side *of the assignment*, rather than to the left of the *let* statement. This change clarifies that.
2015-09-19 11:15:48 -04:00
Steve Klabnik
00d64d6768 Rollup merge of #28483 - dagnir:compiler-test-doc-cleanup, r=alexcrichton
Fix some minor spelling errors, remove a weirdly placed comma.
2015-09-19 11:15:48 -04:00
Steve Klabnik
f1473b6c00 Rollup merge of #28443 - GuillaumeGomez:error_codes, r=Manishearth
r? @Manishearth
2015-09-19 11:15:48 -04:00
Steve Klabnik
d407903898 Rollup merge of #28430 - apasel422:issue-14698, r=alexcrichton
Emit an error upon failing to create a temp dir instead of panicking

Closes #14698.
2015-09-19 11:15:47 -04:00
Steve Klabnik
6872d13e96 Rollup merge of #28400 - badboy:disable-browser-history-on-file, r=steveklabnik
history.pushState is defined, but not working whenever document.origin is "null"
(literally that string, not just the null object).
This is due to some security considerations and is unlikely to be ever working.

For now just disable the usage of the history API when the documentation
is accessed through a file:/// URL.

See https://code.google.com/p/chromium/issues/detail?id=301210 for a
Chrome-specific issue on the history API on file:/// URLs

Closes #25953
2015-09-19 11:15:47 -04:00
Guillaume Gomez
1adcfb8c13 Add librustc_trans error codes 2015-09-19 17:04:27 +02:00
bors
0b5b029da1 Auto merge of #28494 - bluss:vecdeque-zst, r=eddyb
VecDeque: Use power of two capacity even for zero sized types

VecDeque depends on using a power of two capacity. Use the largest
possible power of two capacity for ZSTs.

Fixes #28488
2015-09-19 14:23:46 +00:00
bors
655b2ef45f Auto merge of #28495 - semarie:stdcpp-name, r=alexcrichton
it makes rustc compatible with gcc installation that are using
`--program-transform-name' configure flag (on OpenBSD for example).

- detects at configure the name of stdc++ library on the system

- use the detected name in llvm makefile (with enable-static-stdcpp),
  and pass it to mklldeps.py

- generate mklldeps.rs using this detected name

note that CFG_STDCPP_NAME is about stdc++ name, not about libc++. If
using libc++, the default name will be `stdc++', but it won't be used
when linking.

r? @alexcrichton 

I added this support globally instead of just for OpenBSD as it isn't specially related to OpenBSD (except OpenBSD use it for gcc-4.9). And as I would had to change `llvm.mk', having just a default value in `configure' for others platforms won't be very useful.
2015-09-19 12:35:23 +00:00
Alex Gaynor
a2fbf9da29 Fixed an apparent typo
Repertory is a real world, but it doesn't really make sense in that context.
2015-09-19 08:10:54 -04:00
David Szotten
5ab3058569 change back to anchors; divs break md 2015-09-19 12:06:36 +01:00
Ulrik Sverdrup
66f5dc1347 VecDeque: Use power of two capacity even for zero sized types
VecDeque depends on using a power of two capacity. Use the largest
possible power of two capacity for ZSTs.
2015-09-19 12:50:52 +02:00
David Szotten
f7d8b41814 missing punctuation 2015-09-19 11:45:30 +01:00
David Szotten
436e8d69bf its vs it's 2015-09-19 11:45:09 +01:00
David Szotten
3a5e9a3f99 wrap more referenced code blocks in divs 2015-09-19 11:44:55 +01:00
David Szotten
30c91cd7f7 angle brackets get mis-parsed. bug? 2015-09-19 11:43:57 +01:00
David Szotten
4e42fcd92a link needs puncuation 2015-09-19 11:43:32 +01:00
Vadim Petrochenkov
b44cb01bd7 Don't use std in stability tests 2015-09-19 12:16:30 +03:00
bors
b3afb16d24 Auto merge of #28491 - dotdash:noadjust, r=nikomatsakis
That allows us to keep using trans_into() in case of adjustments that
may actually be ignored in trans because they are a plain deref/ref pair
with no overloaded deref or unsizing.

Unoptimized(!) benchmarks from servo/servo#7638

Before
```
test goser::bench_clone                          ... bench:      17,701 ns/iter (+/- 58) = 30 MB/s
test goser::bincode::bench_decoder               ... bench:      33,715 ns/iter (+/- 300) = 11 MB/s
test goser::bincode::bench_deserialize           ... bench:      36,804 ns/iter (+/- 329) = 9 MB/s
test goser::bincode::bench_encoder               ... bench:      34,695 ns/iter (+/- 149) = 11 MB/s
test goser::bincode::bench_populate              ... bench:      18,879 ns/iter (+/- 88)
test goser::bincode::bench_serialize             ... bench:      31,668 ns/iter (+/- 156) = 11 MB/s
test goser::capnp::bench_deserialize             ... bench:       2,049 ns/iter (+/- 87) = 218 MB/s
test goser::capnp::bench_deserialize_packed      ... bench:      10,707 ns/iter (+/- 258) = 31 MB/s
test goser::capnp::bench_populate                ... bench:         635 ns/iter (+/- 5)
test goser::capnp::bench_serialize               ... bench:      35,657 ns/iter (+/- 155) = 12 MB/s
test goser::capnp::bench_serialize_packed        ... bench:      37,881 ns/iter (+/- 146) = 8 MB/s
test goser::msgpack::bench_decoder               ... bench:      50,634 ns/iter (+/- 307) = 5 MB/s
test goser::msgpack::bench_encoder               ... bench:      25,738 ns/iter (+/- 90) = 11 MB/s
test goser::msgpack::bench_populate              ... bench:      18,900 ns/iter (+/- 138)
test goser::protobuf::bench_decoder              ... bench:       2,791 ns/iter (+/- 29) = 102 MB/s
test goser::protobuf::bench_encoder              ... bench:      75,414 ns/iter (+/- 358) = 3 MB/s
test goser::protobuf::bench_populate             ... bench:      19,248 ns/iter (+/- 92)
test goser::rustc_serialize_json::bench_decoder  ... bench:     109,999 ns/iter (+/- 797) = 5 MB/s
test goser::rustc_serialize_json::bench_encoder  ... bench:      58,777 ns/iter (+/- 418) = 10 MB/s
test goser::rustc_serialize_json::bench_populate ... bench:      18,887 ns/iter (+/- 76)
test goser::serde_json::bench_deserializer       ... bench:     104,803 ns/iter (+/- 770) = 5 MB/s
test goser::serde_json::bench_populate           ... bench:      18,890 ns/iter (+/- 69)
test goser::serde_json::bench_serializer         ... bench:      75,046 ns/iter (+/- 435) = 8 MB/s
```

After
```
test goser::bench_clone                          ... bench:      16,052 ns/iter (+/- 188) = 34 MB/s
test goser::bincode::bench_decoder               ... bench:      31,194 ns/iter (+/- 941) = 12 MB/s
test goser::bincode::bench_deserialize           ... bench:      33,934 ns/iter (+/- 352) = 10 MB/s
test goser::bincode::bench_encoder               ... bench:      30,737 ns/iter (+/- 1,969) = 13 MB/s
test goser::bincode::bench_populate              ... bench:      17,234 ns/iter (+/- 176)
test goser::bincode::bench_serialize             ... bench:      28,269 ns/iter (+/- 452) = 12 MB/s
test goser::capnp::bench_deserialize             ... bench:       2,019 ns/iter (+/- 85) = 221 MB/s
test goser::capnp::bench_deserialize_packed      ... bench:      10,662 ns/iter (+/- 527) = 31 MB/s
test goser::capnp::bench_populate                ... bench:         607 ns/iter (+/- 2)
test goser::capnp::bench_serialize               ... bench:      30,488 ns/iter (+/- 219) = 14 MB/s
test goser::capnp::bench_serialize_packed        ... bench:      33,731 ns/iter (+/- 201) = 9 MB/s
test goser::msgpack::bench_decoder               ... bench:      46,921 ns/iter (+/- 461) = 6 MB/s
test goser::msgpack::bench_encoder               ... bench:      22,315 ns/iter (+/- 96) = 12 MB/s
test goser::msgpack::bench_populate              ... bench:      17,268 ns/iter (+/- 73)
test goser::protobuf::bench_decoder              ... bench:       2,658 ns/iter (+/- 44) = 107 MB/s
test goser::protobuf::bench_encoder              ... bench:      71,024 ns/iter (+/- 359) = 4 MB/s
test goser::protobuf::bench_populate             ... bench:      17,704 ns/iter (+/- 104)
test goser::rustc_serialize_json::bench_decoder  ... bench:     107,867 ns/iter (+/- 759) = 5 MB/s
test goser::rustc_serialize_json::bench_encoder  ... bench:      52,327 ns/iter (+/- 479) = 11 MB/s
test goser::rustc_serialize_json::bench_populate ... bench:      17,262 ns/iter (+/- 68)
test goser::serde_json::bench_deserializer       ... bench:      99,156 ns/iter (+/- 657) = 6 MB/s
test goser::serde_json::bench_populate           ... bench:      17,264 ns/iter (+/- 77)
test goser::serde_json::bench_serializer         ... bench:      66,135 ns/iter (+/- 392) = 9 MB/s

```
2015-09-19 08:26:55 +00:00
Chris Wong
7f43941110 Don't include *.pyc files in source tarball
Closes #28508
2015-09-19 20:04:10 +12:00
llogiq
49b1902345 added panic docs for print\! and println\! macros 2015-09-19 09:04:12 +02:00
bors
791cc1616a Auto merge of #28489 - kud1ing:patch-1, r=alexcrichton
As of http://blog.rust-lang.org/2015/09/17/Rust-1.3.html
2015-09-19 06:38:55 +00:00
bors
d97be7bd70 Auto merge of #28486 - nrc:pub-extern-crate, r=alexcrichton
Temporary 'fix' for #26775

r? @brson
2015-09-19 04:51:13 +00:00
Manish Goregaokar
19d41ef6a8 Remove check_mac 2015-09-19 08:30:00 +05:30
Jorge Aparicio
f5569ecd76 address Niko's comments 2015-09-18 21:36:40 -05:00
Jorge Aparicio
3ae3a5fc3c Overloaded augmented assignments 2015-09-18 21:20:15 -05:00
Andrew Paseltiner
a6c8c7d0db Always pass /DEBUG flag to MSVC linker
Closes #28448.
2015-09-18 22:07:15 -04:00
bors
2915f89167 Auto merge of #28468 - nagisa:revert-negate-unsigned-warning, r=alexcrichton
This reverts commit 0ca8e4994e.

Fixes #27141
2015-09-19 01:59:56 +00:00
bors
6e5a325474 Auto merge of #28484 - nrc:fix-save, r=alexcrichton
Should be lowering ast expressions to HIR expressions, not cheating via the hir map. That goes wrong now that there is not a 1:1 mapping between ast and hir (in the case of the crash due to ExprParen).
2015-09-19 00:08:38 +00:00
Eljay
f4f95eb3a9 Remove unnecessary trait accessibility check. 2015-09-19 00:58:36 +01:00
Marcus Klaas
e2f3e3ac4f Include visibility modifier in span of foreign item 2015-09-19 00:34:04 +02:00
David Szotten
634ffe5624 remove preceeding blank line 2015-09-18 22:16:31 +01:00
David Szotten
9d3deb4766 fix anchor link 2015-09-18 22:12:16 +01:00
bors
fb5de8ce57 Auto merge of #28465 - apasel422:tidy, r=alexcrichton
It is likely that these were committed by mistake.
2015-09-18 20:43:34 +00:00
Andrew Paseltiner
9526813f5b Avoid zero-sized leaf allocations in BTreeMap
When both the key and value types were zero-sized, `BTreeMap` previously
called `heap::allocate` with `size == 0` for leaf nodes, which is
undefined behavior, and jemalloc would attempt to read invalid memory,
crashing the process.

This avoids undefined behavior by allocating enough space to store one
edge in leaf nodes that would otherwise have `size == 0`. Although this
uses extra memory, maps with zero-sized key types that have sensible
implementations of the ordering traits can only contain a single
key-value pair (and therefore only a single leaf node), and maps with
key and value types that are both zero-sized have few uses, if any.

Furthermore, this is a temporary fix that will likely be unnecessary
once the `BTreeMap` implementation is rewritten to use parent pointers.

Closes #28493.
2015-09-18 15:27:17 -04:00
bors
72a10fa1d3 Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichton
Followup on #28440 

Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
2015-09-18 18:51:04 +00:00
Simonas Kazlauskas
5104a93a0d Revert "Convert negate_unsigned feature gate to a warning"
This reverts commit 0ca8e4994e and fixes the code to work with
current rustc.

Fixes #27141
2015-09-18 20:22:16 +03:00
Guillaume Gomez
7badafa593 Add url to rust-book 2015-09-18 19:12:27 +02:00
bors
dc1c7975b0 Auto merge of #28336 - petrochenkov:empstr, r=pnkfelix
Closes https://github.com/rust-lang/rust/issues/24266
Closes https://github.com/rust-lang/rust/issues/16819
2015-09-18 16:57:21 +00:00
Sébastien Marie
913fe6dbe9 add support for non-standard name of stdc++ library
it makes rustc compatible with gcc installation that are using
`--program-transform-name' configure flag (on OpenBSD for example).

- detects at configure the name of stdc++ library on the system

- use the detected name in llvm makefile (with enable-static-stdcpp),
  and pass it to mklldeps.py

- generate mklldeps.rs using this detected name

note that CFG_STDCPP_NAME is about stdc++ name, not about libc++. If
using libc++, the default name will be `stdc++', but it won't be used
when linking.
2015-09-18 18:03:59 +02:00
bors
53ba768b8a Auto merge of #28492 - Ms2ger:a-name, r=steveklabnik
The id attribute has been an official part of HTML since 1997. There is no
reason not to use it.
2015-09-18 14:06:51 +00:00