Commit Graph

66597 Commits

Author SHA1 Message Date
Zack M. Davis
3645b0626c #[must_use] for functions (RFC 1940)
The return value of a function annotated with `must_use`, must be used.

This is in the matter of #43302.
2017-08-08 11:31:42 -07:00
Michael Howell
846d373ddf Clarify the language around RefCell::swap 2017-08-08 09:53:51 -07:00
Malo Jaffré
cf7f3055e5 Ignore tests that fail on stage1
That makes ./x.py test --stage 1 work on x86_64-unknown-linux-gnu.
2017-08-08 18:33:43 +02:00
kennytm
3cb23a714f
Type-check break value; even outside of loop {}.
Fix #43162, fix #43727.
2017-08-09 00:30:26 +08:00
Michael Woerister
d07dd4ab44 Implement HashStable for Xyz<'gcx> instead of Xyz<'lcx>. 2017-08-08 17:56:28 +02:00
bors
ddc02deb07 Auto merge of #43698 - MaloJaffre:confusables, r=eddyb
Update the list of confusable characters

Also reorder and space the list to make it clearer for futures updates
and to come closer to the original list.

This was tedious but somewhat rewarding!

Thanks @est31 for the instructions.

Fixes #43629.
r? @est31
2017-08-08 14:39:27 +00:00
Alexis Beingessner
6c0f2aa279 fix assertion - trait object pointers don't have infinite fields 2017-08-08 10:08:08 -04:00
Oliver Middleton
c62a8c5694 rustdoc: Don't add external impls to implementors js
Otherwise impls from not documented crates appear.
2017-08-08 15:01:37 +01:00
Inokentiy Babushkin
43760a4f9b
Encode proper spans in crate metadata.
The spans previously encoded only span the first token after the opening
brace, up to the closing brace of inline `mod` declarations. Thus, when
examining exports from an external crate, the spans don't include the
header of inline `mod` declarations.
2017-08-08 15:12:39 +02:00
bors
6d84a355c3 Auto merge of #43723 - arielb1:nonincremental-fast-reject, r=eddyb
make `for_all_relevant_impls` O(1) again

A change in #41911 had made `for_all_relevant_impls` do a linear scan over
all impls, instead of using an HashMap. Use an HashMap again to avoid
quadratic blowup when there is a large number of structs with impls.

I think this fixes #43141 completely, but I want better measurements in
order to be sure. As a perf patch, please don't roll this up.

r? @eddyb
beta-nominating because regression
2017-08-08 12:14:51 +00:00
bors
bcd75d661a Auto merge of #43694 - semarie:rustdoc-ldpath, r=Mark-Simulacrum
explicitly add SYSROOT/lib directory to dylib var

it makes platforms without (or partial) rpath support to be able to run
rustdoc binary.
2017-08-08 09:46:17 +00:00
est31
b6ac9c0d30 Avoid calling the column!() macro in panic 2017-08-08 11:35:09 +02:00
Ariel Ben-Yehuda
453ad8122c make for_all_relevant_impls O(1) again
A change in #41911 had made `for_all_relevant_impls` do a linear scan over
all impls, instead of using an HashMap. Use an HashMap again to avoid
quadratic blowup when there is a large number of structs with impls.

I think this fixes #43141 completely, but I want better measurements in
order to be sure. As a perf patch, please don't roll this up.
2017-08-08 11:18:12 +03:00
kennytm
15e8b0fd3d
Fix covered-switch-default warnings in PassWrapper
(See #39063 for explanation)
2017-08-08 16:17:33 +08:00
bors
d69cdca153 Auto merge of #42998 - behnam:uni-ver-type, r=sfackler
[libstd_unicode] Change UNICODE_VERSION to use u32

Looks like there's no strong reason to keep these values at `u64`.

With the current plans for the Unicode Standard, `u8` should be enough for the next 200 years. To stay on the safe side, I'm using `u16` here. I don't see a reason to go with anything machine-dependent/more-efficient.
2017-08-08 06:48:45 +00:00
Sébastien Marie
c982d6a6eb pass rustc_libdir instead of sysroot_libdir() for running rustdoc from rustbuild
suggestion from Mark-Simulacrum
2017-08-08 06:37:40 +02:00
Nick Cameron
8d8876c0b7 driver: factor out a helper and make another helper public 2017-08-08 16:32:47 +12:00
bors
7c4e1a5036 Auto merge of #43725 - dhduvall:libc-update, r=alexcrichton
Update libc to 0.2.29

Cargo pulls in libc from crates.io for a number of dependencies, but 0.2.27 is too old to work properly with Solaris.  In particular, it needs the change to make Solaris' `PTHREAD_PROCESS_PRIVATE` a 16-bit integer.
2017-08-08 04:24:48 +00:00
bors
c5e2051f07 Auto merge of #43714 - ollie27:rustbuild_create_dir_all, r=alexcrichton
rustbuild: Replace create_dir_racy with create_dir_all

`create_dir_all` has since been fixed (in #39799) so no need for `create_dir_racy`.
2017-08-08 02:08:23 +00:00
bors
65b0a0c2c7 Auto merge of #43708 - dhduvall:solaris-sparc-addrinfo, r=alexcrichton
addrinfo hint in lookup_host() clean initialization on all platforms

Fixes #43649
2017-08-07 23:39:46 +00:00
Danek Duvall
9c5397d033 Update libc to 0.2.29
Cargo pulls in libc from crates.io for a number of dependencies, but
0.2.27 is too old to work properly with Solaris.  In particular, it
needs the change to make Solaris' PTHREAD_PROCESS_PRIVATE a 16-bit
integer.
2017-08-07 15:42:30 -07:00
lukaramu
99e44d8680 Added to core::ops module docs
Part of #29365.
* Added paragraph adapted from API guidelines that operator implementations
  should be unsurprising
* Modified Point example to be more clear when just reading it
2017-08-08 00:37:20 +02:00
lukaramu
f1cc7d6c14 Revised core::ops::range::* docs
Part of #29365.
* Strenghtened summary/explanation split, making phrasings more parallel
* Added links throughout
* Fixed some example formatting & removed extraneous `fn main()`s (or hid
  then when needed because of `#![features]`.
* Emphasized note on `RangeFrom`'s `Iterator` implementation
* Added summary sentences to (unstable) `contains` methods
2017-08-08 00:04:44 +02:00
lukaramu
5414c85689 Revise Fn/FnMut/FnOnce documentation
Part of #29365.
* Moved explanations out of Examples section and expanded on them.
* Made the super-/subtrait relationships more explicit.
* Added links to the other traits, TRPL and the nomicon where appropriate
* Changed method summaries to be in 3rd person singular
* General copyediting
2017-08-07 23:10:16 +02:00
lukaramu
ffa327b3a4 Revise Index and IndexMut docs.
Part of #29365.
* Shortened summary sentences, removing "stuttering"
* Small copyediting
* Changed method summary sentences to be in 3rd person singular
* Removed extraneous explicit `fn main()` in example for `IndexMut`
2017-08-07 23:10:16 +02:00
lukaramu
4b945fd9fe Revise Drop docs
Part of #29365.
* Removed "stuttering" in summary sentence.
* Copy-edited the explanaition sections
* Added sub-headings in Examples section to aid linking
* Actually implement `Drop` in the `PrintOnDrop` exampl
* Add link to Drop chapter in TRPL
* Changed `drop` summary sentence to be in 3rd person singular
* Added missing link to `panic!`
2017-08-07 23:10:16 +02:00
lukaramu
5990be523d Expand docs on Deref and DerefMut
Part of #29365.
* Expanded the explanaition sections, adapting some parts from the book,
  the reference, as well as the API guidelines. As such, the docs now
  explicitly state that `Deref` and `DerefMut` should only be implemented
  for smart pointers and that they should not fail. Additionally, there
  is now a short primer on `Deref` coercion.
* Added links to `DerefMut` from `Deref` and vice versa
* Added links to relevant reference sections
* Removed "stuttering" in summary sentences
* Changed summary sentences of `Deref::deref` and `Deref::deref_mut` to
  be in 3rd person singular
* Removed explicit uses of `fn main()` in the examples
2017-08-07 23:10:16 +02:00
lukaramu
f2ff646f5f Revise documentation in core::ops::bit
Part of #29365.
* Added "real" examples for `BitOrAssign`, `BitXorAssign`, `ShlAssign`,
  and `ShrAssign`
* Rewrote method summary senteces to be in 3rd person singular
* Rephrased example introductions to be less redundant ("in this example"
  etc.) and to not use "trivial"
* Removed superfluous explicit `fn main()`s in examples
* Added some missing periods
2017-08-07 23:10:16 +02:00
lukaramu
63fc1faf82 Revise documentation in core::ops::arith
Part of #29365.
* Replaced examples for Mul-/Div-/RemAssign with more illustrative ones
* Made summary senteces for the trait methods use third person singular
* Moved some explanations from Examples section to main explanation
* Switched around argument order for the vector-scalar multiplication
  example such that the vector is on the left side (as it would be expected
  if one were to switch from `*` to `*=`)
* Replaced mostly redundant example introductions with headings in traits
  with more than one example (where it made sense)
* Cleaned up some examples to derive `PartialEq` instead of implementing it
  manually when that wasn't needed
* Removed explicit `fn main()`s in examples where they weren't necessary
* Rephrased some things
* Added some missing periods
* Fixed some formatting/punctuation in examples
2017-08-07 23:10:16 +02:00
bors
cbbe17aa7f Auto merge of #43695 - mehcode:patch-1, r=QuietMisdreavus
Preface 'cares' with 'only'

Minor doc edit to make it clear that `collect` _only_ needs the collection type and is not just being caring.
2017-08-07 21:05:14 +00:00
Aidan Hobson Sayers
458ba7aeb5 Make a disable-jemalloc build work
Fixes #43510
2017-08-07 21:44:02 +01:00
Guillaume Gomez
d0916c57ca Remove \0 printing 2017-08-07 22:25:15 +02:00
bors
0188ec6ef8 Auto merge of #43558 - GuillaumeGomez:union-const-colors, r=QuietMisdreavus
Union const colors

Fixes #43523

What do you think of these colors:

<img width="1440" alt="screen shot 2017-07-30 at 15 10 57" src="https://user-images.githubusercontent.com/3050060/28753752-6b175a22-7539-11e7-978e-949f3a947d18.png">

?
2017-08-07 18:19:07 +00:00
Natalie Boehm
2a62b91343 Update explanation of deref coercion 2017-08-07 13:56:20 -04:00
Kornel
ff0513c697 Hint correct extern constant syntax 2017-08-07 18:23:15 +01:00
Danek Duvall
378a618864 addrinfo hint in lookup_host() needs clean initialization on all platforms
Fixes #43649
2017-08-07 09:07:26 -07:00
bors
2bb6d3dd89 Auto merge of #43713 - arielb1:legacy-dataflow, r=eddyb
rustc::middle::dataflow - visit the CFG in RPO

We used to propagate bits in node-id order, which sometimes caused an
excessive number of iterations, especially when macros were present. As
everyone knows, visiting the CFG in RPO bounds the number of iterators
by 1 plus the depth of the most deeply nested loop (times the height of
the lattice, which is 1).

I have no idea how this affects borrowck perf in the non-worst-case, so it's probably a good idea to not roll this up so we can see the effects.

Fixes #43704.

r? @eddyb
2017-08-07 15:42:35 +00:00
Oliver Middleton
49310a9d4d Stop using URL shortener in docs
tidy will no longer complain about long lines containing links so there
is no reason to use a URL shortener here.
2017-08-07 16:33:04 +01:00
Oliver Middleton
94c90e79e1 rustbuild: Replace create_dir_racy with create_dir_all
`create_dir_all` has since been fixed so no need for `create_dir_racy`.
2017-08-07 16:04:46 +01:00
bors
e8f558543b Auto merge of #43706 - nrc:update-rls, r=sfackler
update rls
2017-08-07 13:02:57 +00:00
Ariel Ben-Yehuda
4e3a0b636f rustc::middle::dataflow - visit the CFG in RPO
We used to propagate bits in node-id order, which sometimes caused an
excessive number of iterations, especially when macros were present. As
everyone knows, visiting the CFG in RPO bounds the number of iterators
by 1 plus the depth of the most deeply nested loop (times the height of
the lattice, which is 1).

Fixes #43704.
2017-08-07 16:00:31 +03:00
bors
95936375a0 Auto merge of #43709 - zackmdavis:de-orphan_extended_information, r=GuillaumeGomez
de-orphan extended information

Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax [weren't getting their error explanations registered](https://github.com/rust-lang/rust/issues/35284) (leaving _several_ error codes absent from [the index](https://doc.rust-lang.org/nightly/error-index.html) and `--explain`). This surfaced a few latent doctest failures that were fixed where readily possible and ignored (with a recorded excuse) if not.

Also, we don't issue E0563 anymore.

r? @GuillaumeGomez
2017-08-07 10:01:06 +00:00
Oliver Schneider
970c78094f Reexport all SyntaxExtension variants 2017-08-07 10:22:28 +02:00
Luca Barbato
8b78ea5b84 Add support for Vector Average on PowerPC 2017-08-07 07:44:27 +00:00
Luca Barbato
19c4bdb4e1 Add support for Vector Multiply Odd on PowerPC 2017-08-07 07:41:15 +00:00
Luca Barbato
9c6ab920ab Add support for Vector Multiply Even on PowerPC 2017-08-07 07:35:32 +00:00
bors
3de807a00b Auto merge of #43699 - GuillaumeGomez:e0623, r=eddyb
Add missing error code for private method
2017-08-07 07:34:04 +00:00
Luca Barbato
380b81853e Narrow or widen the vector element without changing the vector size 2017-08-07 07:25:59 +00:00
Zack M. Davis
75b7a6f1a6 comment out record of now-unused error code E0563
The sole appearance of this code was deleted in 6383de15; the existing practice
in these cases seems to be to comment out its mention in
`register_diagnostics!`.
2017-08-06 21:50:41 -07:00
Zack M. Davis
86b7546204 fixing doctest failures in resurfaced extended information
After repatriating error explanations to the global registry, some lurking
doctest failures surfaced and needed to be chased down. Sadly, a few doctests
needed to be ignored due to a not-yet-understood regression in the doctest
`compile_fail` functionality (filed #43707).
2017-08-06 21:36:57 -07:00