Commit Graph

66366 Commits

Author SHA1 Message Date
Seiichi Uchida
601e3dac6c Add reset_err_count() to errors::Handler
The motivation here is to allow rustfmt to recover from parse errors
after failing to parse macros.
2017-08-23 21:56:09 +09:00
bors
f142499539 Auto merge of #43484 - estebank:point-to-return, r=arielb1
Point at return type always when type mismatch against it

Before this, the diagnostic errors would only point at the return type
when changing it would be a possible solution to a type error. Add a
label to the return type without a suggestion to change in order to make
the source of the expected type obvious.

Follow up to #42850, fixes #25133, fixes #41897.
2017-08-09 19:50:03 +00:00
Esteban Küber
9bd62a4691 Readd backticks around () 2017-08-09 10:48:33 -07:00
bors
33d71944cd Auto merge of #43732 - kennytm:pass-wrapper-warning, r=arielb1
Fix covered-switch-default warnings in PassWrapper

(See #39063 for explanation)
2017-08-09 17:08:13 +00:00
bors
b2bf1639ac Auto merge of #43726 - zackmdavis:extended_information_summer_block_party, r=GuillaumeGomez
E05XX odyssey

chipping away at the surface exposed by #43709

r? @GuillaumeGomez
2017-08-09 13:33:36 +00:00
bors
c2de81f4c9 Auto merge of #43588 - dns2utf8:wrapping_add, r=sfackler
Use explicit wrapping_add …

… to prevent potential unexpected behavior on debug builds.
2017-08-09 11:10:23 +00:00
Zack M. Davis
116bf07c32 extended information for E0557 feature has been removed 2017-08-09 01:33:50 -07:00
Zack M. Davis
93bc599d65 extended information for E0552 unrecognized representation hint 2017-08-09 01:33:49 -07:00
Zack M. Davis
6fa140b869 extended information for E0554 feature attributes only work on nightlies
It's more pleasing to use the inner-attribute syntax (`#!` rather than
`#`) in the error message, as that is how `feature` attributes in
particular will be declared (as they apply to the entire crate).
2017-08-09 01:33:49 -07:00
Zack M. Davis
78d1442808 extended information for E0571 break with value in non-loop loop 2017-08-09 01:33:49 -07:00
Esteban Küber
3fcdb8ba72 Only refer to return type when it matches 2017-08-08 22:59:55 -07:00
bors
3f977baf34 Auto merge of #43728 - zackmdavis:fnused, r=eddyb
#[must_use] for functions

This implements [RFC 1940](https://github.com/rust-lang/rfcs/pull/1940).

The RFC and discussion thereof seem to suggest that tagging `PartialEq::eq` and friends as `#[must_use]` would automatically lint for unused comparisons, but it doesn't work out that way (at least the way I've implemented it): unused `.eq` method calls get linted, but not `==` expressions. (The lint operates on the HIR, which sees binary operations as their own thing, even if they ultimately just call `.eq` _&c._.)

What do _you_ think??

Resolves #43302.
2017-08-09 04:03:49 +00:00
bors
0f9317d37e Auto merge of #43595 - oyvindln:master, r=aturon
Add an overflow check in the Iter::next() impl for Range<_> to help with vectorization.

This helps with vectorization in some cases, such as (0..u16::MAX).collect::<Vec<u16>>(),
 as LLVM is able to change the loop condition to use equality instead of less than and should help with #43124. (See also my [last comment](https://github.com/rust-lang/rust/issues/43124#issuecomment-319098625) there.) This PR makes collect on ranges of u16, i16, i8, and u8 **significantly** faster (at least on x86-64 and i686), and pretty close, though not quite equivalent to a [manual unsafe implementation](https://is.gd/nkoecB). 32 ( and 64-bit values on x86-64) bit values were already vectorized without this change, and they still are. This PR doesn't seem to help with 64-bit values on i686, as they still don't vectorize well compared to doing a manual loop.

I'm a bit unsure if this was the best way of implementing this, I tried to do it with as little changes as possible and avoided changing the step trait and the behavior in RangeFrom (I'll leave that for others like #43127 to discuss wider changes to the trait). I tried simply changing the comparison to `self.start != self.end` though that made the compiler segfault when compiling stage0, so I went with this method instead for now.

As for `next_back()`, reverse ranges seem to optimise properly already.
2017-08-09 01:30:02 +00:00
bors
78efb23586 Auto merge of #43691 - GuillaumeGomez:fix-rustdoc, r=QuietMisdreavus
Fix rustdoc

Fixes #43625.

r? @rust-lang/dev-tools

cc @rust-lang/docs
2017-08-08 22:14:12 +00:00
Stefan Schindler
702750c538 Use explicit wrapping_add to prevent potential unexpected behavior on debug builds 2017-08-08 22:58:09 +02:00
bors
215e0b10ea Auto merge of #43711 - lu-zero:master, r=nagisa
More Altivec intrinsics

Beside the usual json + generated files, I added two additional modifiers in the generator.
2017-08-08 19:34:05 +00:00
Guillaume Gomez
ec0ca3a7c6 Remove all usage of hoedown_buffer_puts 2017-08-08 21:25:39 +02:00
Zack M. Davis
f5ac228b36 mark comparison trait methods as #[must_use]
Note that this doesn't actually give us warnings on `a == b;` and the like, as
some observers may have hoped.

This is in the matter of #43302.
2017-08-08 11:32:10 -07:00
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
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
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
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
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
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
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
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
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
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
Zack M. Davis
7efeade268 de-orphan extended information
Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax
weren't getting their error explanations registered.

Resolves #35284.
2017-08-06 21:29:05 -07:00
Nick Cameron
17d5f6a086 update rls 2017-08-07 12:16:04 +12:00
Guillaume Gomez
08188c3c92 Add missing error code for private method 2017-08-06 22:37:31 +02:00
Guillaume Gomez
26dd77f4f3 Fix hoedown error in rustdoc 2017-08-06 21:30:39 +02:00