Commit Graph

67296 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
3b0ff0d7e2 Fix errors on Windows 2017-08-09 09:31:10 +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
Steven Fackler
c9814fa485 Instant is monotonically nondecreasing
We don't want to guarantee that `Instant::now() != Instant::now()` is
always true since that depends on the speed of the processor and the
resolution of the clock.
2017-08-08 21:37:37 -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
Tobias Bucher
5704b07667 mem::unreachable: Add tracking issue 2017-08-09 01:03:50 +02:00
Tobias Bucher
315de9c58f Put intrinsics::unreachable on a possible path to stabilization
Mark it with the `unreachable` feature and put it into the `mem` module.
This is a pretty straight-forward API that can already be simulated in
stable Rust by using `transmute` to create an uninhabited enum that can
be matched.
2017-08-09 00:47:38 +02: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
Ralf Jung
21a707ee97 explain that the example is indeed UB, but that's okay 2017-08-08 14:50:27 -07:00
Stefan Schindler
702750c538 Use explicit wrapping_add to prevent potential unexpected behavior on debug builds 2017-08-08 22:58:09 +02:00
Natalie Boehm
fac6ce79e5 Fix trait name Deref 2017-08-08 16:57:11 -04:00
Guillaume Gomez
8ac4336692 Improve headers linking 2017-08-08 22:16:08 +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
Guillaume Gomez
aaa14d1d20 Improve error message when duplicate names for type and trait method 2017-08-08 21:17:33 +02:00
Natalie Boehm
40f5b308bc Update solution to add using &* as well as as_str() 2017-08-08 14:57:34 -04: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
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
panicbit
96182997da Assign tracking issue to option_ref_mut_cloned 2017-08-08 15:33:58 +02: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