]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRemove plugins chapter
steveklabnik [Mon, 14 Aug 2017 21:02:15 +0000 (17:02 -0400)]
Remove plugins chapter

we don't want to support plugins

6 years agolink to the rustdoc book from the main docs
steveklabnik [Mon, 14 Aug 2017 17:58:21 +0000 (13:58 -0400)]
link to the rustdoc book from the main docs

6 years agostart building the rustdoc book
steveklabnik [Mon, 14 Aug 2017 17:56:41 +0000 (13:56 -0400)]
start building the rustdoc book

6 years agoAuto merge of #43720 - pornel:staticconst, r=petrochenkov
bors [Thu, 10 Aug 2017 15:10:17 +0000 (15:10 +0000)]
Auto merge of #43720 - pornel:staticconst, r=petrochenkov

Hint correct extern constant syntax

Error message for `extern "C" { const …}` is terse, and the right syntax is hard to guess given unfortunate difference between meaning of `static` in C and Rust.

I've added a hint for the right syntax.

6 years agoReword error hint
Kornel [Thu, 10 Aug 2017 11:16:01 +0000 (12:16 +0100)]
Reword error hint

6 years agoAuto merge of #43522 - alexcrichton:rewrite-lints, r=michaelwoerister
bors [Thu, 10 Aug 2017 11:20:15 +0000 (11:20 +0000)]
Auto merge of #43522 - alexcrichton:rewrite-lints, r=michaelwoerister

rustc: Rearchitect lints to be emitted more eagerly

In preparation for incremental compilation this commit refactors the lint
handling infrastructure in the compiler to be more "eager" and overall more
incremental-friendly. Many passes of the compiler can emit lints at various
points but before this commit all lints were buffered in a table to be emitted
at the very end of compilation. This commit changes these lints to be emitted
immediately during compilation using pre-calculated lint level-related data
structures.

Linting today is split into two phases, one set of "early" lints run on the
`syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
"early" lints to running as late as possible in compilation, just before HIR
lowering. This notably means that we're catching resolve-related lints just
before HIR lowering. The early linting remains a pass very similar to how it was
before, maintaining context of the current lint level as it walks the tree.

Post-HIR, however, linting is structured as a method on the `TyCtxt` which
transitively executes a query to calculate lint levels. Each request to lint on
a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
from there about whether the lint should be emitted or not.

The query depends on the entire HIR crate but should be very quick to calculate
(just a quick walk of the HIR) and the red-green system should notice that the
lint level data structure rarely changes, and should hopefully preserve
incrementality.

Overall this resulted in a pretty big change to the test suite now that lints
are emitted much earlier in compilation (on-demand vs only at the end). This in
turn necessitated the addition of many `#![allow(warnings)]` directives
throughout the compile-fail test suite and a number of updates to the UI test
suite.

Closes https://github.com/rust-lang/rust/issues/42511

6 years agoAuto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1
bors [Thu, 10 Aug 2017 08:53:22 +0000 (08:53 +0000)]
Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1

Fixed mutable vars being marked used when they weren't

#### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue.

Fixes #43526, Fixes #30280, Fixes #25049

### Issue
Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings
```
fn do_thing<T>(mut arg : &mut T) {
    ... // don't touch arg - just deref it to access the T
}
```

### Fix
Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables.
#### Why not on things other than local variables?
  * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted.
  * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.

6 years agoAuto merge of #43737 - GuillaumeGomez:duplicate-method, r=eddyb
bors [Thu, 10 Aug 2017 06:32:19 +0000 (06:32 +0000)]
Auto merge of #43737 - GuillaumeGomez:duplicate-method, r=eddyb

Improve error message when duplicate names for type and trait method

Fixes #43626.

6 years agoAuto merge of #43735 - est31:master, r=alexcrichton
bors [Thu, 10 Aug 2017 04:01:21 +0000 (04:01 +0000)]
Auto merge of #43735 - est31:master, r=alexcrichton

Avoid calling the column!() macro in panic

Closes #43057

This "fix" adds a new macro called `__rust_unstable_column` and to use it instead of the `column` macro inside panic. The new macro can be shadowed as well as `column` can, but its very likely that there is no code that does this in practice.

There is no real way to make "unstable" macros that are usable by stable macros, so we do the next best thing and prefix the macro with `__rust_unstable` to make sure people recognize it is unstable.

r? @alexcrichton

6 years agoAuto merge of #43730 - nrc:driver-shim, r=eddyb
bors [Thu, 10 Aug 2017 01:22:43 +0000 (01:22 +0000)]
Auto merge of #43730 - nrc:driver-shim, r=eddyb

Make the driver API a little more useful for a tools shim

Example use case: https://github.com/nrc/rls-rustc

6 years agoUpdated cargo submodule to fix compile error
Isaac van Bakel [Thu, 10 Aug 2017 01:00:48 +0000 (02:00 +0100)]
Updated cargo submodule to fix compile error

6 years agoAdd a feature gate
est31 [Wed, 9 Aug 2017 23:42:36 +0000 (01:42 +0200)]
Add a feature gate

@alexcrichton figured out a way how to do it :)

6 years agoBetter diagnostics and recovery for `const` in extern blocks
Vadim Petrochenkov [Wed, 9 Aug 2017 22:43:06 +0000 (01:43 +0300)]
Better diagnostics and recovery for `const` in extern blocks

6 years agoAuto merge of #43627 - Aaronepower:master, r=alexcrichton
bors [Wed, 9 Aug 2017 22:41:10 +0000 (22:41 +0000)]
Auto merge of #43627 - Aaronepower:master, r=alexcrichton

Updated release notes for 1.20

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

6 years agodriver: factor out `continue_parse_after_error` so it can be controlled via driver API
Nick Cameron [Tue, 8 Aug 2017 05:10:08 +0000 (17:10 +1200)]
driver: factor out `continue_parse_after_error` so it can be controlled via driver API

6 years agoAuto merge of #43484 - estebank:point-to-return, r=arielb1
bors [Wed, 9 Aug 2017 19:50:03 +0000 (19:50 +0000)]
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.

6 years agoReadd backticks around ()
Esteban Küber [Wed, 9 Aug 2017 16:57:28 +0000 (09:57 -0700)]
Readd backticks around ()

6 years agoAuto merge of #43732 - kennytm:pass-wrapper-warning, r=arielb1
bors [Wed, 9 Aug 2017 17:08:13 +0000 (17:08 +0000)]
Auto merge of #43732 - kennytm:pass-wrapper-warning, r=arielb1

Fix covered-switch-default warnings in PassWrapper

(See #39063 for explanation)

6 years agorustc: Rearchitect lints to be emitted more eagerly
Alex Crichton [Thu, 27 Jul 2017 04:51:09 +0000 (21:51 -0700)]
rustc: Rearchitect lints to be emitted more eagerly

In preparation for incremental compilation this commit refactors the lint
handling infrastructure in the compiler to be more "eager" and overall more
incremental-friendly. Many passes of the compiler can emit lints at various
points but before this commit all lints were buffered in a table to be emitted
at the very end of compilation. This commit changes these lints to be emitted
immediately during compilation using pre-calculated lint level-related data
structures.

Linting today is split into two phases, one set of "early" lints run on the
`syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
"early" lints to running as late as possible in compilation, just before HIR
lowering. This notably means that we're catching resolve-related lints just
before HIR lowering. The early linting remains a pass very similar to how it was
before, maintaining context of the current lint level as it walks the tree.

Post-HIR, however, linting is structured as a method on the `TyCtxt` which
transitively executes a query to calculate lint levels. Each request to lint on
a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
from there about whether the lint should be emitted or not.

The query depends on the entire HIR crate but should be very quick to calculate
(just a quick walk of the HIR) and the red-green system should notice that the
lint level data structure rarely changes, and should hopefully preserve
incrementality.

Overall this resulted in a pretty big change to the test suite now that lints
are emitted much earlier in compilation (on-demand vs only at the end). This in
turn necessitated the addition of many `#![allow(warnings)]` directives
throughout the compile-fail test suite and a number of updates to the UI test
suite.

6 years agoUpdate RELEASES.md
Aaron Power [Wed, 9 Aug 2017 15:19:54 +0000 (16:19 +0100)]
Update RELEASES.md

6 years agoAuto merge of #43726 - zackmdavis:extended_information_summer_block_party, r=Guillaum...
bors [Wed, 9 Aug 2017 13:33:36 +0000 (13:33 +0000)]
Auto merge of #43726 - zackmdavis:extended_information_summer_block_party, r=GuillaumeGomez

E05XX odyssey

chipping away at the surface exposed by #43709

r? @GuillaumeGomez

6 years agoAuto merge of #43588 - dns2utf8:wrapping_add, r=sfackler
bors [Wed, 9 Aug 2017 11:10:23 +0000 (11:10 +0000)]
Auto merge of #43588 - dns2utf8:wrapping_add, r=sfackler

Use explicit wrapping_add …

… to prevent potential unexpected behavior on debug builds.

6 years agoFix errors on Windows
Ariel Ben-Yehuda [Wed, 9 Aug 2017 09:31:10 +0000 (09:31 +0000)]
Fix errors on Windows

6 years agoextended information for E0557 feature has been removed
Zack M. Davis [Mon, 7 Aug 2017 22:37:13 +0000 (15:37 -0700)]
extended information for E0557 feature has been removed

6 years agoextended information for E0552 unrecognized representation hint
Zack M. Davis [Mon, 7 Aug 2017 22:09:53 +0000 (15:09 -0700)]
extended information for E0552 unrecognized representation hint

6 years agoextended information for E0554 feature attributes only work on nightlies
Zack M. Davis [Mon, 7 Aug 2017 17:57:08 +0000 (10:57 -0700)]
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).

6 years agoextended information for E0571 break with value in non-`loop` loop
Zack M. Davis [Mon, 7 Aug 2017 17:38:16 +0000 (10:38 -0700)]
extended information for E0571 break with value in non-`loop` loop

6 years agoOnly refer to return type when it matches
Esteban Küber [Wed, 9 Aug 2017 01:20:36 +0000 (18:20 -0700)]
Only refer to return type when it matches

6 years agoAuto merge of #43728 - zackmdavis:fnused, r=eddyb
bors [Wed, 9 Aug 2017 04:03:49 +0000 (04:03 +0000)]
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.

6 years agoAuto merge of #43595 - oyvindln:master, r=aturon
bors [Wed, 9 Aug 2017 01:30:02 +0000 (01:30 +0000)]
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.

6 years agoAuto merge of #43691 - GuillaumeGomez:fix-rustdoc, r=QuietMisdreavus
bors [Tue, 8 Aug 2017 22:14:12 +0000 (22:14 +0000)]
Auto merge of #43691 - GuillaumeGomez:fix-rustdoc, r=QuietMisdreavus

Fix rustdoc

Fixes #43625.

r? @rust-lang/dev-tools

cc @rust-lang/docs

6 years agoUse explicit wrapping_add to prevent potential unexpected behavior on debug builds
Stefan Schindler [Tue, 1 Aug 2017 14:25:36 +0000 (16:25 +0200)]
Use explicit wrapping_add to prevent potential unexpected behavior on debug builds

6 years agoAuto merge of #43711 - lu-zero:master, r=nagisa
bors [Tue, 8 Aug 2017 19:34:05 +0000 (19:34 +0000)]
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.

6 years agoRemove all usage of hoedown_buffer_puts
Guillaume Gomez [Tue, 8 Aug 2017 19:25:39 +0000 (21:25 +0200)]
Remove all usage of hoedown_buffer_puts

6 years agoImprove error message when duplicate names for type and trait method
Guillaume Gomez [Tue, 8 Aug 2017 12:12:06 +0000 (14:12 +0200)]
Improve error message when duplicate names for type and trait method

6 years agomark comparison trait methods as #[must_use]
Zack M. Davis [Tue, 8 Aug 2017 04:23:58 +0000 (21:23 -0700)]
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.

6 years ago#[must_use] for functions (RFC 1940)
Zack M. Davis [Tue, 8 Aug 2017 00:20:19 +0000 (17:20 -0700)]
#[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.

6 years agoAuto merge of #43698 - MaloJaffre:confusables, r=eddyb
bors [Tue, 8 Aug 2017 14:39:27 +0000 (14:39 +0000)]
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

6 years agoAuto merge of #43723 - arielb1:nonincremental-fast-reject, r=eddyb
bors [Tue, 8 Aug 2017 12:14:51 +0000 (12:14 +0000)]
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

6 years agoAuto merge of #43694 - semarie:rustdoc-ldpath, r=Mark-Simulacrum
bors [Tue, 8 Aug 2017 09:46:17 +0000 (09:46 +0000)]
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.

6 years agoAvoid calling the column!() macro in panic
est31 [Tue, 8 Aug 2017 09:24:30 +0000 (11:24 +0200)]
Avoid calling the column!() macro in panic

6 years agomake `for_all_relevant_impls` O(1) again
Ariel Ben-Yehuda [Mon, 7 Aug 2017 20:50:34 +0000 (20:50 +0000)]
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.

6 years agoFix covered-switch-default warnings in PassWrapper
kennytm [Tue, 8 Aug 2017 08:17:33 +0000 (16:17 +0800)]
Fix covered-switch-default warnings in PassWrapper

(See #39063 for explanation)

6 years agoAuto merge of #42998 - behnam:uni-ver-type, r=sfackler
bors [Tue, 8 Aug 2017 06:48:45 +0000 (06:48 +0000)]
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.

6 years agopass rustc_libdir instead of sysroot_libdir() for running rustdoc from rustbuild
Sébastien Marie [Tue, 8 Aug 2017 04:37:31 +0000 (06:37 +0200)]
pass rustc_libdir instead of sysroot_libdir() for running rustdoc from rustbuild

suggestion from Mark-Simulacrum

6 years agodriver: factor out a helper and make another helper public
Nick Cameron [Tue, 8 Aug 2017 04:32:47 +0000 (16:32 +1200)]
driver: factor out a helper and make another helper public

6 years agoAuto merge of #43725 - dhduvall:libc-update, r=alexcrichton
bors [Tue, 8 Aug 2017 04:24:48 +0000 (04:24 +0000)]
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.

6 years agoAuto merge of #43714 - ollie27:rustbuild_create_dir_all, r=alexcrichton
bors [Tue, 8 Aug 2017 02:08:23 +0000 (02:08 +0000)]
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`.

6 years agoAuto merge of #43708 - dhduvall:solaris-sparc-addrinfo, r=alexcrichton
bors [Mon, 7 Aug 2017 23:39:46 +0000 (23:39 +0000)]
Auto merge of #43708 - dhduvall:solaris-sparc-addrinfo, r=alexcrichton

addrinfo hint in lookup_host() clean initialization on all platforms

Fixes #43649

6 years agoUpdate libc to 0.2.29
Danek Duvall [Mon, 7 Aug 2017 22:42:30 +0000 (15:42 -0700)]
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.

6 years agoAuto merge of #43695 - mehcode:patch-1, r=QuietMisdreavus
bors [Mon, 7 Aug 2017 21:05:14 +0000 (21:05 +0000)]
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.

6 years agoRemove \0 printing
Guillaume Gomez [Mon, 7 Aug 2017 18:17:45 +0000 (20:17 +0200)]
Remove \0 printing

6 years agoAuto merge of #43558 - GuillaumeGomez:union-const-colors, r=QuietMisdreavus
bors [Mon, 7 Aug 2017 18:19:07 +0000 (18:19 +0000)]
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">

?

6 years agoHint correct extern constant syntax
Kornel [Mon, 7 Aug 2017 17:23:15 +0000 (18:23 +0100)]
Hint correct extern constant syntax

6 years agoaddrinfo hint in lookup_host() needs clean initialization on all platforms
Danek Duvall [Mon, 7 Aug 2017 03:12:53 +0000 (20:12 -0700)]
addrinfo hint in lookup_host() needs clean initialization on all platforms

Fixes #43649

6 years agoAuto merge of #43713 - arielb1:legacy-dataflow, r=eddyb
bors [Mon, 7 Aug 2017 15:42:35 +0000 (15:42 +0000)]
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

6 years agorustbuild: Replace create_dir_racy with create_dir_all
Oliver Middleton [Mon, 7 Aug 2017 15:04:46 +0000 (16:04 +0100)]
rustbuild: Replace create_dir_racy with create_dir_all

`create_dir_all` has since been fixed so no need for `create_dir_racy`.

6 years agoAuto merge of #43706 - nrc:update-rls, r=sfackler
bors [Mon, 7 Aug 2017 13:02:57 +0000 (13:02 +0000)]
Auto merge of #43706 - nrc:update-rls, r=sfackler

update rls

6 years agorustc::middle::dataflow - visit the CFG in RPO
Ariel Ben-Yehuda [Mon, 7 Aug 2017 12:56:43 +0000 (15:56 +0300)]
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.

6 years agoAuto merge of #43709 - zackmdavis:de-orphan_extended_information, r=GuillaumeGomez
bors [Mon, 7 Aug 2017 10:01:06 +0000 (10:01 +0000)]
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

6 years agoAdd support for Vector Average on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Average on PowerPC

6 years agoAdd support for Vector Multiply Odd on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Multiply Odd on PowerPC

6 years agoAdd support for Vector Multiply Even on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Multiply Even on PowerPC

6 years agoAuto merge of #43699 - GuillaumeGomez:e0623, r=eddyb
bors [Mon, 7 Aug 2017 07:34:04 +0000 (07:34 +0000)]
Auto merge of #43699 - GuillaumeGomez:e0623, r=eddyb

Add missing error code for private method

6 years agoNarrow or widen the vector element without changing the vector size
Luca Barbato [Mon, 7 Aug 2017 07:25:59 +0000 (07:25 +0000)]
Narrow or widen the vector element without changing the vector size

6 years agocomment out record of now-unused error code E0563
Zack M. Davis [Mon, 7 Aug 2017 04:50:41 +0000 (21:50 -0700)]
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!`.

6 years agofixing doctest failures in resurfaced extended information
Zack M. Davis [Mon, 7 Aug 2017 04:36:06 +0000 (21:36 -0700)]
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).

6 years agode-orphan extended information
Zack M. Davis [Mon, 31 Jul 2017 06:22:09 +0000 (23:22 -0700)]
de-orphan extended information

Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax
weren't getting their error explanations registered.

Resolves #35284.

6 years agoupdate rls
Nick Cameron [Mon, 7 Aug 2017 00:16:04 +0000 (12:16 +1200)]
update rls

6 years agoAdd missing error code for private method
Guillaume Gomez [Sun, 6 Aug 2017 16:20:08 +0000 (18:20 +0200)]
Add missing error code for private method

6 years agoFix hoedown error in rustdoc
Guillaume Gomez [Sat, 5 Aug 2017 21:54:48 +0000 (23:54 +0200)]
Fix hoedown error in rustdoc

6 years agoAuto merge of #43397 - GuillaumeGomez:unused-union-field, r=petrochenkov
bors [Sun, 6 Aug 2017 18:57:57 +0000 (18:57 +0000)]
Auto merge of #43397 - GuillaumeGomez:unused-union-field, r=petrochenkov

Don't warn on unused field on union

Fixes #43393.

6 years agoHandle type aliases as well
Guillaume Gomez [Sun, 6 Aug 2017 18:46:32 +0000 (20:46 +0200)]
Handle type aliases as well

6 years agoAdded closure test case.
Isaac van Bakel [Sun, 6 Aug 2017 17:25:31 +0000 (18:25 +0100)]
Added closure test case.

6 years agoFix union unused fields check
Guillaume Gomez [Sun, 6 Aug 2017 16:49:33 +0000 (18:49 +0200)]
Fix union unused fields check

6 years agoFix typo in unicode_chars.rs
Malo Jaffré [Sun, 6 Aug 2017 16:34:36 +0000 (18:34 +0200)]
Fix typo in unicode_chars.rs

6 years agoUpdate the list of confusable characters
Malo Jaffré [Sun, 6 Aug 2017 15:36:50 +0000 (17:36 +0200)]
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.

Thanks @est31 for the instructions.

Fixes #43629.
r? @est31

6 years agoImprove union unused field detection
Guillaume Gomez [Sun, 6 Aug 2017 15:19:15 +0000 (17:19 +0200)]
Improve union unused field detection

6 years agoAuto merge of #43655 - bjorn3:more_doc_comments, r=arielb1
bors [Sun, 6 Aug 2017 12:46:20 +0000 (12:46 +0000)]
Auto merge of #43655 - bjorn3:more_doc_comments, r=arielb1

Make some comments doc comments in librustc/middle/cstore.rs

6 years agoFix invalid background highlights and add missing colors
Guillaume Gomez [Sun, 6 Aug 2017 11:34:24 +0000 (13:34 +0200)]
Fix invalid background highlights and add missing colors

6 years agoPreface 'cares' with 'only'
Ryan Leckey [Sun, 6 Aug 2017 10:16:42 +0000 (03:16 -0700)]
Preface 'cares' with 'only'

6 years agoAuto merge of #43488 - Florob:repeat-opt, r=arielb1
bors [Sun, 6 Aug 2017 08:09:59 +0000 (08:09 +0000)]
Auto merge of #43488 - Florob:repeat-opt, r=arielb1

Optimize initialization of arrays using repeat expressions

This PR was inspired by [this thread](https://www.reddit.com/r/rust/comments/6o8ok9/understanding_rust_performances_a_newbie_question/) on Reddit.
It tries to bring array initialization in the same ballpark as `Vec::from_elem()` for unoptimized builds.
For optimized builds this should relieve LLVM of having to figure out the construct we generate is in fact a `memset()`.

To that end this emits `llvm.memset()` when:
* the array is of integer type and all elements are zero (`Vec::from_elem()` also explicitly optimizes for this case)
* the array elements are byte sized

If the array is zero-sized initialization is omitted entirely.

6 years agoAdd support for Vector Add Carryout on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Add Carryout on PowerPC

6 years agoAdd support for Vector Add Saturated on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Add Saturated on PowerPC

6 years agoAuto merge of #43688 - frewsxcv:frewsxcv-bump-book, r=carols10cents
bors [Sat, 5 Aug 2017 22:10:14 +0000 (22:10 +0000)]
Auto merge of #43688 - frewsxcv:frewsxcv-bump-book, r=carols10cents

Bump 'src/doc/book' git submodule.

Primarily to pick up this change:

https://github.com/rust-lang/book/pull/866

...to move this PR forward:

https://github.com/rust-lang/rust/pull/43641

6 years agoBump 'src/doc/book' git submodule.
Corey Farwell [Sat, 5 Aug 2017 15:04:45 +0000 (11:04 -0400)]
Bump 'src/doc/book' git submodule.

Primarily to pick up this change:

https://github.com/rust-lang/book/pull/866

...to move this PR forward:

https://github.com/rust-lang/rust/pull/43641

6 years agoImprove dead code detection for unions
Guillaume Gomez [Sun, 30 Jul 2017 17:08:26 +0000 (19:08 +0200)]
Improve dead code detection for unions

6 years agoDon't warn on unused field on union
Guillaume Gomez [Fri, 21 Jul 2017 23:17:53 +0000 (01:17 +0200)]
Don't warn on unused field on union

6 years agoAuto merge of #43689 - edaniels:patch-1, r=GuillaumeGomez
bors [Sat, 5 Aug 2017 19:51:19 +0000 (19:51 +0000)]
Auto merge of #43689 - edaniels:patch-1, r=GuillaumeGomez

Fix typo in coerce_forced_unit docstring

6 years agoFix typo in coerce_forced_unit docstring
Eric Daniels [Sat, 5 Aug 2017 17:15:53 +0000 (13:15 -0400)]
Fix typo in coerce_forced_unit docstring

6 years agoAuto merge of #43652 - frewsxcv:frewsxcv-str-examples, r=QuietMisdreavus
bors [Sat, 5 Aug 2017 15:58:11 +0000 (15:58 +0000)]
Auto merge of #43652 - frewsxcv:frewsxcv-str-examples, r=QuietMisdreavus

String slice doc improvements.

None

6 years agoAuto merge of #43554 - eddyb:apfloat, r=nikomatsakis
bors [Sat, 5 Aug 2017 13:12:56 +0000 (13:12 +0000)]
Auto merge of #43554 - eddyb:apfloat, r=nikomatsakis

APFloat: Rewrite It In Rust and use it for deterministic floating-point CTFE.

As part of the CTFE initiative, we're forced to find a solution for floating-point operations.
By design, IEEE-754 does not explicitly define everything in a deterministic manner, and there is some variability between platforms, at the very least (e.g. NaN payloads).

If types are to evaluate constant expressions involving type (or in the future, const) generics, that evaluation needs to be *fully deterministic*, even across `rustc` host platforms.
That is, if `[T; T::X]` was used in a cross-compiled library, and the evaluation of `T::X` executed a floating-point operation, that operation has to be reproducible on *any other host*, only knowing `T` and the definition of the `X` associated const (as either AST or HIR).

Failure to uphold those rules allows an associated type (e.g. `<Foo as Iterator>::Item`) to be seen as two (or more) different types, depending on the current host, and such type safety violations typically allow writing of a `transmute` in safe code, given enough generics.

The options considered by @rust-lang/compiler were:
1. Ban floating-point operations in generic const-evaluation contexts
2. Emulate floating-point operations in an uniformly deterministic fashion

The former option may seem appealing at first, but floating-point operations *are allowed today*, so they can't be banned wholesale, a distinction has to be made between the code that already works, and future generic contexts. *Moreover*, every computation that succeeded *has to be cached*, otherwise the generic case can be reproduced without any generics. IMO there are too many ways it can go wrong, and a single violation can be enough for an unsoundness hole.
Not to mention we may end up really wanting floating-point operations *anyway*, in CTFE.

I went with the latter option, and seeing how LLVM *already* has a library for this exact purpose (as it needs to perform optimizations independently of host floating-point capabilities), i.e. `APFloat`, that was what I ended up basing this PR on.
But having been burned by the low reusability of bindings that link to LLVM, and because I would *rather* the floating-point operations to be wrong than not deterministic or not memory-safe (`APFloat` does far more pointer juggling than I'm comfortable with), I decided to RIIR.

This way, we have a guarantee of *no* `unsafe` code, a bit more control over the where native floating-point might accidentally be involved, and non-LLVM backends can share it.
I've also ported all the testcases over, *before* any functionality, to catch any mistakes.

Currently the PR replaces all CTFE operations to go through `apfloat::ieee::{Single,Double}`, keeping only the bits of the `f32` / `f64` memory representation in between operations.
Converting from a string also double-checks that `core::num` and `apfloat` agree on the interpretation of a floating-point number literal, in case either of them has any bugs left around.

r? @nikomatsakis
f? @nagisa @est31

<hr/>

Huge thanks to @edef1c for first demoing usable `APFloat` bindings and to @chandlerc for fielding my questions on IRC about `APFloat` peculiarities (also upstreaming some bugfixes).

6 years agoIndicate how to turn byte slices back into a string slice.
Corey Farwell [Sat, 5 Aug 2017 03:08:29 +0000 (23:08 -0400)]
Indicate how to turn byte slices back into a string slice.

6 years agoUpdate str::split_at_mut example to demonstrate mutability.
Corey Farwell [Fri, 4 Aug 2017 22:01:34 +0000 (18:01 -0400)]
Update str::split_at_mut example to demonstrate mutability.

6 years agoMake some comments doc comments in librustc/middle/cstore.rs
bjorn3 [Sat, 5 Aug 2017 08:42:53 +0000 (10:42 +0200)]
Make some comments doc comments in librustc/middle/cstore.rs

6 years agoAuto merge of #43640 - oli-obk:patch-5, r=nikomatsakis
bors [Sat, 5 Aug 2017 07:31:00 +0000 (07:31 +0000)]
Auto merge of #43640 - oli-obk:patch-5, r=nikomatsakis

Uplift some comments to Doc comments

6 years agoAuto merge of #43642 - mmatyas:unskip_aarch64_tests, r=sanxiyn
bors [Sat, 5 Aug 2017 05:08:12 +0000 (05:08 +0000)]
Auto merge of #43642 - mmatyas:unskip_aarch64_tests, r=sanxiyn

Unskip some tests on AArch64

I've been running the test suite remotely on an Acer Chromebook R13 and natively on an ARM Juno developer board, both AArch64 devices. Most of the tests that are skipped on AArch64 are due to testing stdcall/fastcall/x86-specific code or the debugger, but I've found a few tests that could be enabled there.

These have been skipped previously due to failing on the `aarch64-linux-android` and `mac-android` buildbots, more than 2 years ago (#23471, #23695). It seems we don't test those platforms any more, but as they do work on AArch64 Linux, I'd like to propose re-enabling them. All of them pass on my devices.

6 years agocodegen tests: Check type of `len` argument to `llvm.memset.*` based on the exact...
Florian Zeitz [Fri, 4 Aug 2017 14:58:12 +0000 (16:58 +0200)]
codegen tests: Check type of `len` argument to `llvm.memset.*` based on the exact intrinsic used

6 years agoAuto merge of #43639 - TobiasSchaffner:master, r=alexcrichton
bors [Sat, 5 Aug 2017 01:58:24 +0000 (01:58 +0000)]
Auto merge of #43639 - TobiasSchaffner:master, r=alexcrichton

Add L4Re Support in librustc_back

Add experimental support for x86_64-unknown-l4re-uclibc target, which covers the L4 Runtime Environment.

This pull request contains the changes that have to be made to librustc_back. It follows the changes humenda made in pull request https://github.com/rust-lang/libc/pull/591 to libc.

Next steps will be the modifications to the needed libraries. (libstd,  liballoc_system, libpanic_abort, libunwind)

Thanks to humenda for reviewing.

6 years agoAuto merge of #43615 - dhduvall:lto-unaligned-read, r=nagisa
bors [Fri, 4 Aug 2017 22:35:22 +0000 (22:35 +0000)]
Auto merge of #43615 - dhduvall:lto-unaligned-read, r=nagisa

Fix some unaligned reads on SPARC in LTO

This fixes #43593 by eliminating some undefined behavior.